Skip to content

feat(server-utils): Migrate @opentelemetry/instrumentation-graphql to orchestrion#21885

Draft
chargome wants to merge 3 commits into
developfrom
cg/orchestrion-graphql
Draft

feat(server-utils): Migrate @opentelemetry/instrumentation-graphql to orchestrion#21885
chargome wants to merge 3 commits into
developfrom
cg/orchestrion-graphql

Conversation

@chargome

@chargome chargome commented Jul 1, 2026

Copy link
Copy Markdown
Member

WIP

@chargome chargome self-assigned this Jul 1, 2026
@chargome

chargome commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

bugbot run

Comment thread packages/node/src/sdk/experimentalUseDiagnosticsChannelInjection.ts
Comment thread packages/server-utils/src/integrations/tracing-channel/graphql/spans.ts Outdated
Comment thread packages/node/src/integrations/tracing/index.ts
@chargome

chargome commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d573508. Configure here.

// Important for e.g. @sentry/aws-serverless because this would otherwise overwrite the name again.
rootSpan.updateName(
`${spanToJSON(rootSpan).data['original-description']} (${getGraphqlOperationNamesFromAttribute(existingOperations)})`,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root span name omits operation

Medium Severity

In finalizeExecuteSpan, when sentry.graphql.operation on the root span is already a string, the attribute is updated to an array including the new operation, but rootSpan.updateName still formats the suffix from the old string-only existingOperations, so the renamed root span can omit the current GraphQL operation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d573508. Configure here.

In finalizeExecuteSpan, when the root span's sentry.graphql.operation attribute was
already a string, it was merged into an array for the attribute but the renamed span
suffix was still formatted from the stale string-only value — dropping the current
operation from the displayed name.

Derive both the attribute and the rename suffix from a single merged value so they can
no longer diverge. Reachable array-branch behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 this pull request may close these issues.

1 participant