Skip to content

Conversation

EmrysMyrddin
Copy link
Collaborator

This changes the default resource attributes when using setup utils from @graphql-hive/gateway/opentelemetry/setup

Related to #1540

@Copilot Copilot AI review requested due to automatic review settings September 23, 2025 20:31
Copy link
Contributor

@Copilot Copilot AI left a 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,
Copy link
Preview

Copilot AI Sep 23, 2025

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.

Suggested change
resource: resource,
resource,

Copilot uses AI. Check for mistakes.

if (!options.resource) {
return {
serviceName: 'hive-gateway',
serviceVersion: globalThis.__OTEL_PLUGIN_VERSION__ ?? 'unknown',
Copy link
Preview

Copilot AI Sep 23, 2025

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.

@EmrysMyrddin
Copy link
Collaborator Author

Is it a breaking change ? Since it changes the default service name and version ?

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 23, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

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 ↗︎

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 23, 2025

🚀 Snapshot Release (Binary for Linux-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 23, 2025

🚀 Snapshot Release (Binary for Linux-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 23, 2025

🚀 Snapshot Release (Binary for macOS-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 23, 2025

🚀 Snapshot Release (Binary for Windows-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 23, 2025

🚀 Snapshot Release (Binary for macOS-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 23, 2025

🚀 Snapshot Release (Node Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:2.1.8-alpha-09b8418c37f922f560d6c4418c42e08534879d20

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 23, 2025

🚀 Snapshot Release (Bun Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:2.1.8-alpha-09b8418c37f922f560d6c4418c42e08534879d20-bun

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.

2 participants