Skip to content

Conversation

@enisdenjo
Copy link
Member

@enisdenjo enisdenjo commented Nov 24, 2025

Closes #1540, closes #1552

  • Use hive-gateway as the default service name
  • Use Hive Gateway's version as the service version (not the OTEL plugin's, that goes in hive.otel.version)
  • Ensure there's proper hive tracing processor options
  • Use https://api.graphql-hive.com/otel/v1/traces as the default endpoint for hive tracing

Bonus

Reduced flakiness of Cloudflare E2E tests and clarify errors.

@gemini-code-assist
Copy link

Summary of Changes

Hello @enisdenjo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refines the OpenTelemetry integration by centralizing resource creation logic and establishing more sensible default values for service names and versions. It also strengthens the configuration validation for Hive Tracing processors, ensuring essential parameters like access tokens and endpoints are correctly provided. These changes aim to make the observability setup more robust, consistent, and user-friendly.

Highlights

  • Improved OTEL Resource Defaults: The default OpenTelemetry service name is now set to 'hive-gateway', and the service version is derived from the Hive Gateway's global version (globalThis.__VERSION__), providing more meaningful default identifiers for tracing.
  • Optional Service Version in Resource Definition: The serviceVersion property within the resource type definition has been made optional, allowing for more flexible resource configurations where a service version might not always be explicitly required.
  • Enhanced Hive Tracing Processor Configuration: The setup for the HiveTracingSpanProcessor now includes explicit checks for accessToken and endpoint when a custom processor is not provided, ensuring these critical configuration parameters are always present, either via options or environment variables.
  • Centralized Resource Creation Logic: The logic for creating and merging OpenTelemetry resources has been refactored and centralized into a single createResource function, improving consistency and maintainability across the OpenTelemetry setup.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several improvements to the OpenTelemetry integration. It sets more sensible defaults for the service name and version in OTEL resources, using hive-gateway and the gateway's version respectively. The hiveTracingSetup function has been significantly refactored for better clarity and robustness, especially in how it configures the Hive tracing processor.

My review focuses on the new createResource function. While the refactoring is a good step, I've identified a potential bug in how it handles an explicitly undefined serviceVersion and have suggested a cleaner implementation that fixes this issue and improves readability.

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 24, 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.19-alpha-1bfda770fe8ac08e452e19fceb9f1e162148ae75 npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 2.0.24-alpha-1bfda770fe8ac08e452e19fceb9f1e162148ae75 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-opentelemetry 1.2.1-alpha-1bfda770fe8ac08e452e19fceb9f1e162148ae75 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 2.1.5-alpha-1bfda770fe8ac08e452e19fceb9f1e162148ae75 npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 24, 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 Nov 24, 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 Nov 24, 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 Nov 24, 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 Nov 24, 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.19-alpha-1bfda770fe8ac08e452e19fceb9f1e162148ae75-bun

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 24, 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.19-alpha-1bfda770fe8ac08e452e19fceb9f1e162148ae75

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 24, 2025

🚀 Snapshot Release (Binary for macOS-X64)

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

Download

@enisdenjo enisdenjo merged commit 3706a2c into main Nov 24, 2025
49 of 70 checks passed
@enisdenjo enisdenjo deleted the default-resources branch November 24, 2025 14:57
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.

otel resource attributes for service name and version are confusing

2 participants