You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use the custom traceId received from the upstream system as the request context in my current Flask project, and pass this traceId forward in the same header.
It’s possible to instrument OpenTelemetry and log the traceId in my Flask project, but it seems difficult to analyze incoming requests and extract the traceId from the headers set by the upstream server.
I haven’t found any documentation regarding parsing the traceId from headers in upstream systems and applying it to the current request context. I’m unsure if OpenTelemetry supports such operations.
GPT provided some insights, suggesting that I might be able to perform the related operations in app.before_request and app.after_request. The example code is as follows, but I am still unable to apply the traceId from the upstream system to the current Flask project.
Here is the code which will always crash when trying to start a new span using given trace id:
I would like to use the custom traceId received from the upstream system as the request context in my current Flask project, and pass this traceId forward in the same header.
It’s possible to instrument OpenTelemetry and log the traceId in my Flask project, but it seems difficult to analyze incoming requests and extract the traceId from the headers set by the upstream server.
I haven’t found any documentation regarding parsing the traceId from headers in upstream systems and applying it to the current request context. I’m unsure if OpenTelemetry supports such operations.
GPT provided some insights, suggesting that I might be able to perform the related operations in app.before_request and app.after_request. The example code is as follows, but I am still unable to apply the traceId from the upstream system to the current Flask project.
Here is the code which will always crash when trying to start a new span using given trace id:
I think I might need to implement a custom provider to replace the default
TracerProvider
.The text was updated successfully, but these errors were encountered: