grafana / grafana/pyroscope-dotnet

Trace to Profile in aspnetcore nested Activities

Open
#66 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
38
Forks
14
Avg merge
20h 15m
Merged PRs (30d)
10

Description

The PyroscopeSpanProcessor works like a charm with aspnetcore, I see the pyroscope.profile.id in the root span and the linked profile includes the cpu/mem intensive call stack

        [HttpGet]
        public async Task<string> Get()
        {
            ... cpu/mem intensive work ...
        }

But it does not work when manually defining child Activities. With the following example I see the pyroscope.profile.id in the root span but the linked profile does not include the cpu/mem intensive call stack and there is no pyroscope.profile.id on the MyCustomActivity child span.

        [HttpGet]
        public async Task<string> Get()
        {
                using (var activity = ActivitySource.StartActivity("MyCustomActivity", ActivityKind.Internal, default(ActivityContext)))
                {
                     ... cpu/mem intensive work ...
                }
        }

Environment

.Net 8
opentelemetry.instrumentation.aspnetcore 1.8.1
pyroscope-dotnet v0.2.0-opentelemetry
pyroscope.0.8.14-glibc-x86_64

See: https://github.com/grafana/pyroscope-dotnet/blob/main/Pyroscope/Pyroscope.OpenTelemetry/PyroscopeSpanProcessor.cs#L12

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Pyroscope/Pyroscope.OpenTelemetry/PyroscopeSpanProcessor.cs at the linked location and reproduce the .NET 8 example with a manually created nested Activity. Compare the root and MyCustomActivity spans and the linked profile. Done means the child span receives pyroscope.profile.id and its CPU/memory-intensive call stack appears in the linked profile.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.