Skip to content

Conversation

@EmrysMyrddin
Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin commented Dec 11, 2025

Description

Adds Hive Tracing integration in addition to the existing OTEL setup.

I've also updated OTEL packages to the latest and used Hive Gateway setup helper instead of NodeSDK.

Ref CONSOLE-1646

Breaking Changes

I've made breaking changes, but I can work around most of them if needed:

  • TracingInstance methods build and start have been replaced by setup
  • TracingInstance no longer have an sdk attribute
  • TracingInstance no longer offer a tracerProvider method. Use trace.getTracerProvider instead
  • Renamed HIVE_USAGE_TARGET to HIVE_TARGET (this is used by both Usage and Tracing)
  • Renamed HIVE_USAGE_ACCESS_TOKEN to HIVE_ACCESS_TOKEN (this is use by both Usage and Tracing)

Usage

The integration is not enabled by default because it requires some configuration.
Provide the following env variables to enable it:

HIVE_TRACING=1
HIVE_TARGET=<your-target>
HIVE_ACCESS_TOKEN=<your-access-token>

# Optionally, you can override the default collector endpoint
HIVE_TRACING_ENDPOINT=https://...

Workarounds

Due to the fact our tsconfig uses the old module resolution mode, modules with multiple entrypoints can't be imported if they are defined using exports field in package.json.

To workaround this without making to much changes to the current setup, I've just added manually the plugin entrypoints in the tsconfig path, which is not ideal but the simplest solution in my opinion.

To make it work with unit tests, I also had to do a change in the way the plugin is bundled: graphql-hive/gateway#1791

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @EmrysMyrddin, 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 enhances the application's observability by integrating Hive Tracing alongside the existing OpenTelemetry infrastructure. It involves a comprehensive update of OpenTelemetry dependencies and a refactoring of the tracing initialization process, streamlining how tracing is configured and enabled across various services. The changes also unify environment variable naming for Hive services, improving configuration consistency.

Highlights

  • Hive Tracing Integration: Introduced a new integration for Hive Tracing, complementing the existing OpenTelemetry setup.
  • OpenTelemetry Package Updates: Upgraded various OpenTelemetry packages to their latest versions, ensuring compatibility and leveraging new features.
  • Simplified Tracing Setup: Refactored the TracingInstance class to use a single setup() method, replacing the previous build() and start() methods, and leveraging the Hive Gateway setup helper for streamlined configuration.
  • Unified Hive Configuration: Standardized environment variable names for Hive services, renaming HIVE_USAGE_TARGET to HIVE_TARGET and HIVE_USAGE_ACCESS_TOKEN to HIVE_ACCESS_TOKEN for consistency across usage and tracing.
  • GraphQL Handler Tracing Enhancements: Updated the GraphQL handler to utilize the new @graphql-hive/plugin-opentelemetry for more granular control over tracing, including the ability to ignore specific internal requests.
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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

🚀 Snapshot Release (alpha)

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

Package Version Info
hive 8.14.0-alpha-20251215233133-7db3c4fcdc427878af55abcfe7552833d42cdc4c npm ↗︎ unpkg ↗︎

Copy link
Contributor

@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 successfully integrates Hive Tracing, updates OpenTelemetry packages, and refactors the tracing setup to use the Hive Gateway setup helper. The changes are well-structured and align with the description. I've found one critical issue in the shutdown logic that needs to be addressed.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

📚 Storybook Deployment

The latest changes are available as preview in: https://pr-7410.hive-storybook.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

💻 Website Preview

The latest changes are available as preview in: https://pr-7410.hive-landing-page.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tag: 7db3c4fcdc427878af55abcfe7552833d42cdc4c

HIVE_TARGET: hiveConfig.require('target'),
HIVE_USAGE_ENDPOINT: serviceLocalEndpoint(usage.service),
HIVE_TRACING: '1',
HIVE_TRACING_ENDPOINT: environment.isProduction
Copy link
Contributor

@n1ru4l n1ru4l Dec 15, 2025

Choose a reason for hiding this comment

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

note: using the public endpoints to avoid having to solve a circular pulumi dependency of graphql api and otel :D We can alter on fix it.

package.json Outdated
"miniflare@3>undici": "5.29.0",
"tailwindcss": "3.4.17"
"tailwindcss": "3.4.17",
"@graphql-hive/plugin-opentelemetry": "1.3.0-alpha-9dd631a2329aa1d677cca642b666a55a497a691e"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also let's not forget to update to release version before publishing !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants