feat(tracing-spans): add otel.kind = "client" for OpenTelemetry compatibility#2937
Merged
tyt2y3 merged 1 commit intoSeaQL:masterfrom Feb 27, 2026
Merged
Conversation
…ility This ensures DB spans are recognized as Client spans by OpenTelemetry-compatible APM tools (Datadog, Jaeger, etc.), enabling proper DB span visualization and SQL query tracking. The tracing-opentelemetry crate uses the otel.kind field to determine SpanKind. Without this, spans default to Internal and may not be properly categorized as database operations by APM backends.
Huliiiiii
approved these changes
Feb 1, 2026
Member
|
sorry I missed this |
tyt2y3
approved these changes
Feb 27, 2026
🎉 Released In 2.0.0-rc.35 🎉Huge thanks for the contribution! |
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.
Summary
This PR adds
otel.kind = "client"to thedb_span!macro, ensuring DB spans are properly recognized as Client spans by OpenTelemetry-compatible APM tools.Problem
When using
tracing-opentelemetryas the bridge betweentracingand OpenTelemetry, DB spans created by sea-orm are not recognized as database client calls because:tracing-opentelemetryuses theotel.kindfield to determineSpanKindSpanKind::InternalSpanKind::Client+db.systemattribute to identify DB operationsSolution
Add
otel.kind = "client"to thedb_span!macro. This is the documented approach for setting SpanKind via tracing spans.Changes