Conversation
➖ Are we earthbuild yet?No change in "earthly" occurrences 📈 Overall Progress
Keep up the great work migrating from Earthly to Earthbuild! 🚀 💡 Tips for finding more occurrencesRun locally to see detailed breakdown: ./.github/scripts/count-earthly.shNote that the goal is not to reach 0. |
Summary of ChangesHello, 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 addresses an issue where OpenTelemetry resource attributes were being duplicated due to redundant configuration options. By removing these unnecessary options, the change ensures that telemetry data is correctly and cleanly generated, preventing potential misinterpretations or inefficiencies in observability. Highlights
Changelog
Activity
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.
Code Review
This pull request correctly removes redundant OpenTelemetry resource options (WithSchemaURL, WithFromEnv, and WithTelemetrySDK) from the resource.New call. These options are already covered when merging with resource.Default(), so this change correctly prevents duplicate attributes.
While reviewing the resource handling, I noticed a related issue in the same file: the otelResource is not applied to the logger provider. The setupLoggerProvider function does not accept the resource, and sdklog.NewLoggerProvider is called without sdklog.WithResource(res). This will result in logs missing important resource attributes like service.name.
To fix this, I recommend the following changes:
- Update the
setupLoggerProviderfunction signature to accept a*resource.Resource. - In the
Setupfunction, pass theotelResourcetosetupLoggerProvider. - Inside
setupLoggerProvider, usesdklog.WithResource(res)when creating theloggerProvider.
This will ensure that logs have the same resource attributes as traces and metrics, providing consistent telemetry data.
This fixes the duplicate OTel attributes, including the schema one.
The
resource.Default()already returns these attributes.