Uh oh!
There was an error while loading. Please reload this page.
Add standard tags to HttpClient native trace instrumentation - #104251
Conversation
Uh oh!
There was an error while loading. Please reload this page.
vishweshbankwar
commented
Jul 1, 2024
@antonfirsov - Are you planning to add support for this? |
ghost
commented
Jul 1, 2024
@antonfirsov@vishweshbankwar are there plans to add a feature in the runtime or OTel SDK to enable enrichment of the activity? Using a custom |
antonfirsov
commented
Jul 1, 2024
@vishweshbankwar does that text mean that the tags should be passed to |
That part would stay same. |
antonfirsov
commented
Jul 1, 2024
samsp-msft
commented
Jul 2, 2024
My goals for getting this in (without Enrichment) is so that the instrumentation libraries are not needed for the basic scenarios, especially being able to do auto-instrumentation out of process via EventPipe, such as with .NET Monitor. In that scenario, we want the Activities to have the OTel data directly on them, so when its collected, it has everything that is needed. In that scenario, the application will not have referenced the OTel libraries or setup OTel etc. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
noahfalk
left a comment
There was a problem hiding this comment.
This looks pretty good to me. A couple things to consider called out in comments inline. Thanks @antonfirsov!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cijothomas
commented
Jul 3, 2024
Thanks for the additional context! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
antonfirsov
commented
Jul 5, 2024
lmolkova
commented
Jul 5, 2024
🥇 Thanks! Just noticed: could we also set display name to method? (the one in the
|
antonfirsov
commented
Jul 5, 2024
@lmolkova does that count as a breaking change? |
Uh oh!
There was an error while loading. Please reload this page.
lmolkova
commented
Jul 5, 2024
The OperationName is still the same, but more importantly - did anyone use plain HTTP client instrumentation before? Adding @vishweshbankwar in case he has any thoughts. |
Uh oh!
There was an error while loading. Please reload this page.
vishweshbankwar
commented
Jul 8, 2024
Agree with @lmolkova. In general, I have only seen OperationName being used in older SDKs which won't be impacted with this. |
vishweshbankwar
commented
Jul 8, 2024
OTel instrumentation library would continue to exist and provide enrichment/filtering. In terms of implementation, it will no longer need to set tags/status on activity. |
antonfirsov
commented
Jul 9, 2024
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |

Add the following standard tags to the HTTP Request Activities started in DelegatingHandler:
Stable attributes not being added for now, they are not being included by the OTel SDK either:
Just like in #103769,
url.fullis being redacted by removing UserInfo and the query string, while exposing aSystem.Net.Http.DisableQueryRedactionswitch for opting-out from the latter. This is equivalent to the built-in redaction of OTel SDK, except that the query string is being replaced by a single*instead of replacing values only (key1=*&key2=*), since this is more performant.Given that the vast majority of current users of HttpClient's distributed tracing relies on the OTel SDK, this redaction technique should not regress those users. In .NET 10 we plan to implement something configurable.
Contributes to #93019, except the enrichment and the propagator aspects which are no longer realistic to address for .NET 9.
@vishweshbankwar note that this is breaking the SDK, since it should now conditionally compile against .NET 9+ so it doesn't double job adding tags. PTAL if it meets your expectations.
cc @samsp-msft@noahfalk
PS: For Aspire dashboard output see #104251 (comment)