Add opentelemtry distro
parent
be8ace4b7e
commit
0f39624765
@ -0,0 +1,24 @@
|
|||||||
|
import logging
|
||||||
|
from random import randint
|
||||||
|
|
||||||
|
from flask import Flask
|
||||||
|
from flask import request
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/rolldice")
|
||||||
|
def roll_dice():
|
||||||
|
player = request.args.get('player', default=None, type=str)
|
||||||
|
result = str(roll())
|
||||||
|
if player:
|
||||||
|
logger.warn("%s is rolling the dice: %s", player, result)
|
||||||
|
else:
|
||||||
|
logger.warn("Anonymous player is rolling the dice: %s", result)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def roll():
|
||||||
|
return randint(1, 6)
|
@ -1,5 +0,0 @@
|
|||||||
class Example:
|
|
||||||
"""An example class"""
|
|
||||||
|
|
||||||
def __init__(self, name):
|
|
||||||
self.name = name
|
|
@ -1,2 +1,4 @@
|
|||||||
flask<3
|
flask<3
|
||||||
|
gunicorn
|
||||||
|
opentelemetry-distro
|
||||||
werkzeug<3
|
werkzeug<3
|
||||||
|
Loading…
Reference in New Issue