Skip to content

System.Diagnostics.Activity memory footprint concern #96822

Open

Description

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

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions