fix(adapter-opentelemetry): convert HTTP SERVER spans to access serve - #81
Open
Cid-oe wants to merge 1 commit into
Open
fix(adapter-opentelemetry): convert HTTP SERVER spans to access serve#81Cid-oe wants to merge 1 commit into
Cid-oe wants to merge 1 commit into
Conversation
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.
Resolves #78
Summary
When an HTTP server span from OpenTelemetry (OTLP JSON) was processed by
openTelemetryToResourceEvidence, the HTTP operation was normalized intoaccess: "call"becausespan.kindwas not inspected and HTTP method names (e.g.GET,POST) did not match the/server|serve/iregex. According to the OpenTelemetry trace specification and OTLP proto definitions,SpanKind.SERVER(2,"SPAN_KIND_SERVER") handles incoming requests and should be captured asaccess: "serve".Changes
SpanLikeinpackages/adapter-opentelemetry/src/index.tsto includekind?: unknown.normalizeOperationandaccessFromSpanto inspectspan.kindfor HTTP spans, defaulting to"serve"when the span kind represents a server span (2,"2","SPAN_KIND_SERVER","SERVER"), while maintaining full support for explicit operation overrides (e.g.,cellfence.resource.operation).tests/official-plugins.test.mjsverifying that HTTP SERVER spans (numeric2and string"SPAN_KIND_SERVER") produceaccess: "serve", CLIENT spans (3) produceaccess: "call", and explicit operation attributes take precedence.