Azure / Azure/data-api-builder

[Bug]: No GraphQL operation trace spans

Open
#3,561 0 comments 0 reactions 0 assignees View on GitHub
2.x telemetry
Dominant language
C#
Stars
1.5k
Forks
370
Avg merge
3d 17h
Merged PRs (30d)
8

Description

GraphQL queries and mutations produce no dedicated trace spans. Complex operations — including 3-level nested relationship queries (User→Todos→Categories) — are invisible in distributed traces.

## Expected

Each GraphQL operation should produce a span with operation metadata:

```
Span: POST /graphql
Kind: Server
Attributes:
graphql.operation.type = query
graphql.operation.name = (anonymous)
graphql.document = { users { items { Id Name todos { items { id title categories { items { Id Name } } } } } } }
```

Hot Chocolate (DAB's GraphQL engine) supports OTEL instrumentation via `AddHotChocolateInstrumentation()` which emits spans for the query pipeline, parsing, validation, and field resolution.

## Actual

GraphQL requests only appear as HTTP-level logs in `Microsoft.AspNetCore.Hosting.Diagnostics` with `Path: /graphql`. There are no spans capturing the GraphQL operation type, query document, resolver execution, or field-level timing. A 3-level nested query and a simple `{ __schema { types { name } } }` introspection look identical in telemetry.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.