-
Notifications
You must be signed in to change notification settings - Fork 224
Add .NET network + HTTP connection spans #1192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add .NET network + HTTP connection spans #1192
Conversation
7d7c232
to
9a4ba14
Compare
9a4ba14
to
eb80b71
Compare
f6f4a99
to
0e56f65
Compare
ae799fd
to
46d772f
Compare
.NET 9 introduced additions to `System.Net` distributed tracing which define a contract following OTel recommendations: - dotnet/runtime#104251 adjusted the HTTP client request activity so it natively complies with OTel recommendations. This included adding standard tags. - dotnet/runtime#103922 introduced activities breaking down the HTTP connection setup. This PR documents the activities together with their attributes in a manner similar to the metrics docs added by #37213. The matching semconv PR is open-telemetry/semantic-conventions#1192. Conceptual docs are being introduced in #42830. Moreover, the PR also adjusts certain parts of the metrics doc in order to make it more accurate, synchronize it with the activities doc and incorporate the changes from #42810. --------- Co-authored-by: Genevieve Warren <[email protected]> Co-authored-by: Miha Zupan <[email protected]>
@@ -16,3 +16,9 @@ groups: | |||
as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. | |||
Tabs, carriage returns, and line feeds should be converted to \t, \r, and | |||
\n respectively. | |||
- id: dns.answers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a request/response logging mechanism.
Is there a reason .NET prefers these as span attributes vs. Events?
Note: I don't want to open the giant can of worms of Events vs. Span Attributes. I'm just trying to understand rationale here and from the non-.NET portion of semantic conventions, I don't think this impacts choice of span-attribute vs. event-attribute for dns.answers
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed your comment @jsuereth
what would be the reason to report dns.answers
in an event?
Here's an example of this PR in action

DNS lookup takes 30ms and can fail, it's a valid span. And then there are a few addresses lookup returns, they make sense on the span that captures DNS lookup.
Am I missing something?
…smatch between yanml and md
e521e1d
to
7e734d9
Compare
It's reported as a child of *HTTP client request* span. | ||
|
||
The span ends when the connection is obtained - it could happen when an existing connection becomes available or once | ||
a new connection is established, so the duration of *Wait For Connection* span is different from duration of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's try to generalize it and try to address similar problems - concurrency, mutexes, etc, look at absl
This PR introduces additional network-level spans to-be emitted by .NET 9 🤞
Related to #454, #1226
In particular:
On .NET every
ActivitySource
(aka tracer) is opt-in, so users have full control over what they are enabling.The volume of new telemetry is expected to be low (with caveats):
Overall, the feature is intended to help debug issues like: