-
Notifications
You must be signed in to change notification settings - Fork 124
feat(server): add hive tracing integration #7410
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
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
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.
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.
📚 Storybook DeploymentThe latest changes are available as preview in: https://pr-7410.hive-storybook.pages.dev |
💻 Website PreviewThe latest changes are available as preview in: https://pr-7410.hive-landing-page.pages.dev |
|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tag: |
4675707 to
3ae37f7
Compare
| HIVE_TARGET: hiveConfig.require('target'), | ||
| HIVE_USAGE_ENDPOINT: serviceLocalEndpoint(usage.service), | ||
| HIVE_TRACING: '1', | ||
| HIVE_TRACING_ENDPOINT: environment.isProduction |
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.
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" |
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.
Also let's not forget to update to release version before publishing !
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:
TracingInstancemethodsbuildandstarthave been replaced bysetupTracingInstanceno longer have ansdkattributeTracingInstanceno longer offer atracerProvidermethod. Usetrace.getTracerProviderinsteadHIVE_USAGE_TARGETtoHIVE_TARGET(this is used by both Usage and Tracing)HIVE_USAGE_ACCESS_TOKENtoHIVE_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:
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
exportsfield inpackage.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