-
Couldn't load subscription status.
- Fork 25
feat(opentelemetry): allow more customization for hive tracing setup #1611
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the OpenTelemetry tracing setup to allow more customization for Hive tracing configuration. It extracts common options into a reusable BaseOptions type and simplifies resource creation logic.
- Extracted
BaseOptionstype from the originalOpentelemetrySetupOptionsto enable reuse across different setup functions - Refactored resource creation logic into a dedicated
createResourcehelper function for better maintainability - Updated
hiveTracingSetupto acceptBaseOptionsand provide default service name/version attributes
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| export type HiveTracingSetupOptions = BaseOptions & HiveTracingOptions; | ||
|
|
||
| export function hiveTracingSetup(config: HiveTracingSetupOptions) { |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hiveTracingSetup function signature change removes the contextManager and log parameters that were previously required. This is a breaking change - existing callers that pass these parameters separately will fail. Consider maintaining backward compatibility or documenting this as a breaking change.
| return baseResource.merge( | ||
| resourceFromAttributes({ | ||
| [ATTR_SERVICE_NAME]: userResource.serviceName, | ||
| [ATTR_SERVICE_VERSION]: userResource.serviceVersion, |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential undefined access: userResource.serviceVersion is accessed without checking if it exists. If userResource has serviceName but not serviceVersion, this will set the service version to undefined.
| [ATTR_SERVICE_VERSION]: userResource.serviceVersion, | |
| ...(userResource.serviceVersion !== undefined && { [ATTR_SERVICE_VERSION]: userResource.serviceVersion }), |
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-tools/batch-delegate |
10.0.2-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/delegate |
11.0.2-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/federation |
4.0.6-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/fusion-runtime |
1.2.6-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway |
2.1.11-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/logger |
1.0.7-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/nestjs |
2.0.16-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/plugin-aws-sigv4 |
2.0.11-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/plugin-opentelemetry |
1.1.0-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-prometheus |
2.0.14-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway-runtime |
2.1.10-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/stitch |
10.0.3-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/stitching-directives |
4.0.2-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-common |
1.0.7-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-http |
1.0.7-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-http-callback |
1.0.7-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-ws |
2.0.7-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/wrap |
11.0.2-alpha-c7cbc7a0bab8db3c4c9bf185db48a118d6612a84 |
npm ↗︎ unpkg ↗︎ |
🚀 Snapshot Release (Node Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared |
🚀 Snapshot Release (Bun Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ef2d546 to
22c9152
Compare
This PR allows to pass the same configuration options that can be passed to the classic
openTelemetrySetup.The main interest is to allow user to define its own
resource(with service name and version) and it's ownsamplingRateto limit the Hive Console Tracing traffic.