Commit 6384d72b authored by Alexandre Vincent's avatar Alexandre Vincent
Browse files

trace x-app-id even in None case

parent 81e990de
Pipeline #51560 passed with stages
in 12 minutes and 34 seconds
......@@ -104,8 +104,7 @@ class TracingMiddleware(BaseHTTPMiddleware):
attribute_value=request_content_length)
app_id = request.headers.get(conf.APP_ID_HEADER_NAME)
if app_id is not None:
tracer.add_attribute_to_current_span(attribute_key=conf.APP_ID_HEADER_NAME,
tracer.add_attribute_to_current_span(attribute_key=conf.APP_ID_HEADER_NAME,
attribute_value=app_id)
@staticmethod
......
......@@ -91,7 +91,8 @@ def test_about_call_traces_existing_app_id(client: TestClient):
# one call was exported, without x-app-id
assert len(wdms_app.trace_exporter.exported) == 1 # one call => one export
spandata = wdms_app.trace_exporter.exported[0]
assert 'x-app-id' not in spandata.attributes.keys()
assert 'x-app-id' in spandata.attributes.keys()
assert spandata.attributes['x-app-id'] is None
# x-app-id header -> works as well
client.get(build_url("/about"), headers={'x-app-id': 'some app id'})
......
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