-
Notifications
You must be signed in to change notification settings - Fork 10.9k
fix(core): append correct OTLP paths for HTTP exporters #16836
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
fix(core): append correct OTLP paths for HTTP exporters #16836
Conversation
Summary of ChangesHello @sebastien-prudhomme, 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 resolves a critical issue where OTLP HTTP exporters were failing to send telemetry data due to incorrect URL construction. The fix ensures that the OpenTelemetry SDK correctly appends the necessary signal paths (for traces, logs, and metrics) to the provided base endpoint, making the telemetry collection functional. Additionally, it improves URL parsing by gracefully handling trailing slashes in the configured endpoint. 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 correctly identifies the need to append OTLP signal paths to the base HTTP endpoint. However, the current implementation introduces a Server-Side Request Forgery (SSRF) vulnerability due to improper validation of the configurable OTLP endpoint, potentially allowing attackers to send requests to arbitrary internal network addresses. Furthermore, the string replacement method used for URL construction is not robust and can lead to invalid URLs if the endpoint contains query parameters.
4f09688 to
11b0cda
Compare
|
Hi there! Thank you for your contribution to Gemini CLI. To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md. This pull request is being closed because it is not currently linked to an issue. You can easily reopen this PR once you have linked it to an issue. How to link an issue: Thank you for your understanding and for being a part of our community! |
|
Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request. To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues. If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding! |
Summary
Fixes OTLP HTTP exporter initialization by appending the correct signal paths (
/v1/traces,/v1/logs,/v1/metrics) to the base URL. It uses the nativeURLobject for robust and secure URL construction.Details
When using OTLP over HTTP, the OpenTelemetry exporters require the full URL for each signal endpoint, not just the base address of the collector. Previously, the code used the raw
parsedEndpointfor all exporters, which would fail if the user only provided the base URL (e.g.,http://localhost:4318).This change:
URLconstructor to robustly append standard OTLP paths for traces, logs, and metrics.Related Issues
How to Validate
npm test -w @google/gemini-cli-core -- src/telemetry/sdk.test.tsPre-Merge Checklist