Commit 72d2dc8d authored by Nane Kratzke's avatar Nane Kratzke
Browse files

inject span

parent fcc4d3db
......@@ -2,6 +2,7 @@ from flask import Flask, redirect, request
from jaeger_client import Config
from flask_opentracing import FlaskTracer #, FlaskTracing
import opentracing
from opentracing.propagation import Format
import requests
import traceback
import os
......@@ -38,7 +39,9 @@ def hip():
with opentracing.tracer.start_span(operation_name=url, child_of=parent_span) as span:
print(f"{span}")
span.set_tag("http.url", url)
r = requests.get(url)
headers = dict(request.headers)
tracer.inject(span, Format.HTTP_HEADERS, headers)
r = requests.get(url, headers=headers)
span.set_tag("http.status_code", r.status_code)
print(r)
r = r.content.decode('utf-8')
......
Markdown is supported
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