Skip to content

[Bug]: OpenTelemetry - Missing root span #5244

@fredrikeriksson

Description

@fredrikeriksson

Description

It seems that the produced Trace is missing a root span.
The trace hierarchy is otherwise fine, but the missing root span creates issues in Grafanas Traces Drilldown.
See image:
Image

  1. The trace does not appear in the tab "Root spans" as there are none.
  2. Trace Service and Trace Name is "empty"

Impact is relatively low as you can still use drilldown to find the trace under "All Spans" and drilldown further.
But it's a bit confusing for users that don't know how this is supposed to work.

Also:
Using the Grafana LGTM stack docker.io/grafana/otel-lgtm which uses vanilla OpenTelemetry and not Alloy.

Expected Behavior

Expects root span to be sent so Traces Drilldown works better.

Actual Behavior

No root span is sent.

Steps to Reproduce

Followed Open Telemetry bootstrapping as per docs: https://tunit.dev/docs/examples/opentelemetry/
Setup a LGTM instance with docker compose:

# docker-compose.yaml
volumes:
  grafana-data:
services:
  grafana-lgtm:
    image: docker.io/grafana/otel-lgtm
    restart: unless-stopped
    volumes:
      - grafana-data:/data
    ports:
      - 4040:4040
      - 3000:3000
      - 4317:4317
      - 4318:4318

Warning

If running behind a web proxy that presents a self signed CA Grafana Drilldown Plugins will not install automatically as that CA is most likely not in the image's trusted cert store.
In that case run:

docker exec -it -w /otel-lgtm/grafana {stackname*}-grafana-lgtm-1 bin/grafana cli plugins install grafana-metricsdrilldown-app --pluginsDir /data/grafana/plugins --insecure 
docker exec -it -w /otel-lgtm/grafana {stackname*}-grafana-lgtm-1 bin/grafana cli plugins install grafana-lokiexplore-app --pluginsDir /data/grafana/plugins --insecure 
docker exec -it -w /otel-lgtm/grafana {stackname*}-grafana-lgtm-1 bin/grafana cli plugins install grafana-exploretraces-app --pluginsDir /data/grafana/plugins --insecure 

* stackname is usually the folder where the docker-compose.yaml resides.

Force insecure gRPC:

.AddOtlpExporter(c =>
{
     c.Endpoint = new Uri("http://localhost:4317");
})

TUnit Version

1.21.6

.NET Version

.NET 10

Operating System

Windows

IDE / Test Runner

dotnet CLI (dotnet test / dotnet run)

Error Output / Stack Trace

Additional Context

No response

IDE-Specific Issue?

  • I've confirmed this issue occurs when running via dotnet test or dotnet run, not just in my IDE

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions