Skip to content
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

Add .NET network + HTTP connection spans #1192

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Jun 27, 2024

This PR introduces additional network-level spans to-be emitted by .NET 9 🤞

Related to #454, #1226

In particular:

  1. DNS, TLS, and socket connect spans that track individual stages of connection establishment
  2. wrapper HTTP connection setup span for above spans
  3. wait-for-connection span that signals when a connection is not immediately available for the request
    • link that connects wait-for-connection to the connection setup
    • is expected to be off by default

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):

image

Overall, the feature is intended to help debug issues like:

  • misconfigured connection pool
  • DNS/TLS
  • abandoned response streams (or slow response stream reading) that result in connection staying busy
  • ...

docs/dotnet/dotnet-connection-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-connection-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-connection-traces.md Outdated Show resolved Hide resolved
@lmolkova lmolkova force-pushed the dotnet-http-connection-spans branch from 7d7c232 to 9a4ba14 Compare July 3, 2024 00:59
@lmolkova lmolkova force-pushed the dotnet-http-connection-spans branch from 9a4ba14 to eb80b71 Compare July 6, 2024 03:51
@lmolkova lmolkova force-pushed the dotnet-http-connection-spans branch from f6f4a99 to 0e56f65 Compare July 8, 2024 19:49
@lmolkova lmolkova changed the title Add .NET HTTP connection spans Add .NET network + HTTP connection spans Jul 8, 2024
@lmolkova lmolkova marked this pull request as ready for review July 8, 2024 23:16
@lmolkova lmolkova requested review from a team July 8, 2024 23:16
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
@lmolkova lmolkova force-pushed the dotnet-http-connection-spans branch from ae799fd to 46d772f Compare July 11, 2024 06:41
@lmolkova lmolkova added never stale PRs marked with this label will be never staled and automatically closed and removed Stale labels Oct 20, 2024
Copy link

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, I wanted to do it in tandem with dotnet/docs#43872 to make sure the review goes deep enough.

docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
docs/dotnet/dotnet-network-traces.md Outdated Show resolved Hide resolved
@lmolkova lmolkova force-pushed the dotnet-http-connection-spans branch from e101225 to 16bbfee Compare December 10, 2024 05:59
@lmolkova lmolkova requested review from a team as code owners December 10, 2024 05:59
@lmolkova
Copy link
Contributor Author

@antonfirsov I think I addressed you comments (all except listing error codes), could you please take another look?

@lmolkova lmolkova force-pushed the dotnet-http-connection-spans branch from 859c881 to e521e1d Compare December 10, 2024 07:02
antonfirsov added a commit to dotnet/docs that referenced this pull request Dec 10, 2024
.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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
never stale PRs marked with this label will be never staled and automatically closed
Projects
Development

Successfully merging this pull request may close these issues.

5 participants