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

System.Diagnostics.Activity memory footprint concern #96822

Open
CodeBlanch opened this issue Jan 11, 2024 · 3 comments
Open

System.Diagnostics.Activity memory footprint concern #96822

CodeBlanch opened this issue Jan 11, 2024 · 3 comments

Comments

@CodeBlanch
Copy link
Contributor

We have this issue open in OpenTelemetry .NET: open-telemetry/opentelemetry-dotnet#3290

The spec says the SDK should always create a span / Activity (even when it isn't being sampled) but we don't currently do that because we feel like the GC pressure will be too high.

Opening this issue primarily because I don't think this has been tracked anywhere.

Random ideas...

  • [API Proposal]: System.Diagnostics.ActivityContext.Current ability or similar #86966 has an idea to detach the context from the Activity. I think the goal is different but perhaps something like that might help.
  • Perhaps we could move the data kept on Activity to a sub-class which is only instantiated when needed to lower the footprint of Activity itself.
  • Some kind of pooling? Tricky because an Activity instance may be kept around for a while before it is exported (batching).

/cc @alanwest @cijothomas @utpilla

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 11, 2024
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 11, 2024
@teo-tsirpanis teo-tsirpanis added area-System.Diagnostics.Activity and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 11, 2024
@ghost
Copy link

ghost commented Jan 11, 2024

Tagging subscribers to this area: @dotnet/area-system-diagnostics-activity
See info in area-owners.md if you want to be subscribed.

Issue Details

We have this issue open in OpenTelemetry .NET: open-telemetry/opentelemetry-dotnet#3290

The spec says the SDK should always create a span / Activity (even when it isn't being sampled) but we don't currently do that because we feel like the GC pressure will be too high.

Opening this issue primarily because I don't think this has been tracked anywhere.

Random ideas...

  • [API Proposal]: System.Diagnostics.ActivityContext.Current ability or similar #86966 has an idea to detach the context from the Activity. I think the goal is different but perhaps something like that might help.
  • Perhaps we could move the data kept on Activity to a sub-class which is only instantiated when needed to lower the footprint of Activity itself.
  • Some kind of pooling? Tricky because an Activity instance may be kept around for a while before it is exported (batching).

/cc @alanwest @cijothomas @utpilla

Author: CodeBlanch
Assignees: -
Labels:

untriaged, area-System.Diagnostics.Activity

Milestone: -

@tarekgh
Copy link
Member

tarekgh commented Jan 11, 2024

CC @noahfalk @reyang

@tarekgh tarekgh added this to the Future milestone Jan 11, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 11, 2024
@Oberon00
Copy link

For the motivation as to why OTel always creates a Span ID, see open-telemetry/opentelemetry-specification#1225 and linked PRs & issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants