BackgroundWorker, HTTP request and tracing #58419
Unanswered
AlexandreBossard
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Where would the traceparent header be coming from in the background service? You're talking about an outbound http request from the background worker right? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a BackgroundWorker in my asp (net8) service that periodically polls another service through http. Contrary to a request emitted from an HttpContext (Controller or Minimal API), the HttpClient (DI'ed) request emitted from the BackgroundService does not contain the
traceparent
http header, unless I add this snippet to my Program.cs:I have not found in the documentation a proper explanation on how to accomplish this. I have seen examples using openTelemtry, but I don't currently use it, so I would prefer not to introduce it only for this use case.
Is there a better way to do this ?
Beta Was this translation helpful? Give feedback.
All reactions