Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opentelemetry: use attributes from semconv registry #3769

Open
1 of 3 tasks
guppy0130 opened this issue Feb 7, 2025 · 0 comments · May be fixed by #3786
Open
1 of 3 tasks

opentelemetry: use attributes from semconv registry #3769

guppy0130 opened this issue Feb 7, 2025 · 0 comments · May be fixed by #3786

Comments

@guppy0130
Copy link

Feature Request Type

  • Core functionality
  • Alteration (enhancement/optimization) of existing feature(s)
  • New behavior

Description

This blob:

self._operation_name = self.execution_context.operation_name
span_name = (
f"GraphQL Query: {self._operation_name}"
if self._operation_name
else "GraphQL Query"
)
self._span_holder[LifecycleStep.OPERATION] = self._tracer.start_span(
span_name, kind=SpanKind.SERVER
)
self._span_holder[LifecycleStep.OPERATION].set_attribute("component", "graphql")
if self.execution_context.query:
self._span_holder[LifecycleStep.OPERATION].set_attribute(
"query", self.execution_context.query
)

should probably use graphql.document, graphql.operation.name, and graphql.operation.type, as suggested by upstream: https://opentelemetry.io/docs/specs/semconv/attributes-registry/graphql/

it also appears component has been deprecated: open-telemetry/opentelemetry-specification#271

need to know:

  • if a PR from the community to implement this is desirable (happy to do this if so)
  • if the span names need to be unique (i.e., is the operation name in both the span name and graphql.operation.name?)
guppy0130 added a commit to guppy0130/strawberry that referenced this issue Feb 17, 2025
* use attributes defined in opentelemetry's semconv
* stop setting span attribute `component`, as that's been deprecated
* fixes strawberry-graphql#3769
@guppy0130 guppy0130 linked a pull request Feb 17, 2025 that will close this issue
11 tasks
guppy0130 added a commit to guppy0130/strawberry that referenced this issue Feb 17, 2025
* use attributes defined in opentelemetry's semconv
* stop setting span attribute `component`, as that's been deprecated
* fixes strawberry-graphql#3769
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant