Repository navigation
feat: add direct Google Cloud telemetry exporters - #8541
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @jerop, 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 telemetry capabilities by introducing direct integration with Google Cloud services for traces, metrics, and logs. This change simplifies the setup for users who wish to send telemetry data to GCP by removing the need for a separate OpenTelemetry Collector in most scenarios. It also provides a new configuration option to retain collector-based export for more advanced use cases, offering greater flexibility in telemetry management.
Highlights
- Direct Google Cloud Telemetry Exporters: Introduced new direct exporters for Google Cloud Trace, Monitoring, and Logging, allowing telemetry data to be sent directly to GCP services without requiring an intermediate OpenTelemetry Collector.
- New
useCollectorSetting: Added auseCollectorboolean setting to the telemetry configuration, which allows users to explicitly choose between direct GCP export (whenfalse) or collector-based OTLP export (whentrue) for advanced use cases, even when targeting GCP. - Conditional Exporter Selection Logic: Implemented logic to automatically select the appropriate telemetry exporters: direct GCP exporters are used when
target=gcp, theOTLP_GOOGLE_CLOUD_PROJECTenvironment variable is set, anduseCollector=false. Otherwise, it falls back to OTLP exporters or file-based export. - Updated Telemetry Documentation: The
docs/telemetry.mdfile has been significantly rewritten and reorganized to clearly explain the new direct GCP export method as the recommended approach, alongside the advanced collector-based and local file-based options. A new configuration table was added, including theuseCollectorsetting. - New Dependencies: Added
@google-cloud/opentelemetry-cloud-monitoring-exporter,@google-cloud/opentelemetry-cloud-trace-exporter,@google-cloud/logging, and@opentelemetry/resource-detector-gcpto support the new direct GCP telemetry export functionality.
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
-
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. ↩
d7493d5 to
a91715e
Compare
a91715e to
9553db6
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces direct telemetry export to Google Cloud, which is a great simplification for users. The implementation is solid, and the documentation has been significantly improved. I've identified a critical issue in the log payload construction that could lead to data loss, and a couple of high-severity issues related to type safety and documentation usability. Addressing these will make this new feature more robust and user-friendly.
|
Size Change: +3.67 MB (+26.96%) 🚨 Total Size: 17.3 MB
ℹ️ View Unchanged
|
3937168 to
abafca8
Compare
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
abafca8 to
ade6cd3
Compare
owenofbrien
left a comment
There was a problem hiding this comment.
Just a couple of questions, but overall, LGTM. Thanks for knocking this out. It will simplify our internal quality debugging workflows greatly!
- Add direct GCP exporters for traces, metrics, and logs - Implement GcpTraceExporter using @google-cloud/opentelemetry-cloud-trace-exporter - Implement GcpMetricExporter using @google-cloud/opentelemetry-cloud-monitoring-exporter - Implement GcpLogExporter using @google-cloud/logging with severity mapping - Add useCollector setting to control exporter selection (settings.json only) - Use direct exporters when target=gcp, OTLP_GOOGLE_CLOUD_PROJECT is set, and useCollector=false - Fall back to OTLP exporters when useCollector=true for advanced use cases - Add comprehensive test coverage for new functionality - Update documentation with simplified configuration guide
ade6cd3 to
f2f96ba
Compare
…ters (google-gemini#8541) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixes #6792