fix(tracing): mark database query/mutation spans as client, not internal - #10869
Open
eeshsaxena wants to merge 2 commits into
Open
fix(tracing): mark database query/mutation spans as client, not internal#10869eeshsaxena wants to merge 2 commits into
eeshsaxena wants to merge 2 commits into
Conversation
Signed-off-by: Eesh Saxena <yadavswapnul@gmail.com>
Signed-off-by: Eesh Saxena <yadavswapnul@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10868.
Problem
Spans for database queries and mutations are created with
SpanKindSKInternal("internal"), but per the OTel database span semantic conventions a database call is aclientspan. Because of the wrong kind, exporters that map OTel span kinds to their own types (e.g. Datadog) classify these ascustomrather than a DB span, which breaks OTel-trace → DB-monitoring correlation.The
DataConnectorbackend already gets this right — it usesSKClientfor both its query and mutation spans — so Postgres and MSSQL are simply out of line with it.Fix
Change the
newSpan ... SKInternaltoSKClientfor the DB query/mutation spans in both backends, matchingDataConnectorand the semantic conventions.The issue only mentions the Postgres query span, but the same defect is present on every sibling DB span, so all of them are corrected together:
Backends/Postgres/Instances/Transport.hs—Postgres Query for root field ...and bothPostgres Mutation for root field ...spans.Backends/MSSQL/Instances/Transport.hs—MSSQL Query for root field ...andMSSQL Mutation for root field ...spans.These are the only
SKInternaluses in the two transport modules, and each is a database span; no non-DB internal spans are affected.SKClientrenders as"client"(seeTracing.TraceId).