-
Notifications
You must be signed in to change notification settings - Fork 25
fix(opentelemetry): better default resource for hive gateway #1552
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 improves the default resource attributes for OpenTelemetry setup in the Hive Gateway by adding better defaults for service identification.
- Adds resource parameter to
hiveTracingSetup
function for custom service name and version configuration - Creates gateway-specific setup functions that automatically provide default service name and version
- Exports the
OpentelemetrySetupOptions
type for external use
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/plugins/opentelemetry/src/setup.ts | Exports OpentelemetrySetupOptions type and adds resource parameter support to hiveTracingSetup |
packages/gateway/src/opentelemetry/setup.ts | Creates new gateway setup module with wrapper functions that provide default "hive-gateway" service identification |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
resource: resourceFromAttributes({ | ||
'hive.target_id': config.target, | ||
}), | ||
resource: resource, |
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 variable assignment resource: resource
can be simplified to just resource
using ES6 shorthand property notation.
resource: resource, | |
resource, |
Copilot uses AI. Check for mistakes.
if (!options.resource) { | ||
return { | ||
serviceName: 'hive-gateway', | ||
serviceVersion: globalThis.__OTEL_PLUGIN_VERSION__ ?? 'unknown', |
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.
There's a typo in the JSDoc comment above. 'an simple object' should be 'a simple object'.
Copilot uses AI. Check for mistakes.
Is it a breaking change ? Since it changes the default service name and version ? |
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@graphql-hive/gateway |
2.1.8-alpha-09b8418c37f922f560d6c4418c42e08534879d20 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/nestjs |
2.0.13-alpha-09b8418c37f922f560d6c4418c42e08534879d20 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/plugin-aws-sigv4 |
2.0.8-alpha-09b8418c37f922f560d6c4418c42e08534879d20 |
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
|
This changes the default resource attributes when using setup utils from
@graphql-hive/gateway/opentelemetry/setup
Related to #1540