Commit 74ead2a4 authored by Nane Kratzke's avatar Nane Kratzke
Browse files

Aktualisieren deploy/tracing.yaml, hiphop/service.py, hiphop/requirements.txt Dateien

parent ce4a1cad
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: tracing
\ No newline at end of file
flask
requests
Flask-Opentracing
jaeger-client
\ No newline at end of file
from flask import Flask
from jaeger_client import Config
from flask_opentracing import FlaskTracing
import requests
service = os.environ.get('HIPHOP', 'hiphop')
tier = int(os.environ.get('TIER', '1'))
app = Flask(__name__)
config = Config(config = {
'sampler': {
'type': 'const',
'param': 1
},
'logging': True,
'reporter_batch_size': 1
}, service_name=service)
jaeger_tracer = config.initialize_tracer()
tracing = FlaskTracing(jaeger_tracer, True, app)
@app.route('/')
def index():
return redirect('/hip')
@app.route('/hip')
def hip():
r = ""
try:
r = requests.get(f"http://{service}-{tier + 1}").content
r = f"-{r}"
except Exception as ex:
print(ex)
return f"hop-{ tier }{ r }"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment