Skip to content

Conversation

@stephenafamo
Copy link

Support wrapper TracerProviders (e.g. Pyroscope), avoid panic, init SDK only when global is noop (#3709)

Checklist (if applicable):

@google-cla
Copy link

google-cla bot commented Jan 20, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the go label Jan 20, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @stephenafamo, 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 flexibility and robustness of the Go tracing system by introducing support for wrapper TracerProvider implementations and enabling context-scoped tracing. It isolates the reflection server's tracing configuration, preventing potential conflicts with the main application's global tracing setup. These changes ensure better compatibility with various OpenTelemetry integrations and provide more granular control over tracing behavior within different parts of the codebase.

Highlights

  • Wrapper TracerProvider Support: The core TracerProvider function now correctly identifies and returns wrapper trace.TracerProvider implementations, preventing panics and improving compatibility with external tracing systems like Pyroscope.
  • Context-Scoped Tracing: Introduced mechanisms to associate TracerProvider instances with specific contexts, enabling isolated tracing configurations for different application components.
  • Reflection Server Isolation: The reflection server now operates with its own dedicated TracerProvider, ensuring its tracing activities do not conflict with or impact the global tracing setup of the main application.
  • Flexible Span Processor Registration: New helper functions allow registering span processors on any trace.TracerProvider that supports the necessary interfaces, enhancing modularity and extensibility.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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 does an excellent job of adding support for wrapper TracerProviders, which resolves a panic when other tracing libraries are used. The approach of checking against the initial provider and using interface-based programming is solid. The introduction of context-scoped tracer providers and the isolation of the reflection server's tracing are great enhancements for modularity. I've provided a few suggestions to further improve the robustness of the provider interaction and to clean up a TODO comment that appears to be resolved by these changes.

@stephenafamo
Copy link
Author

For the most up to date status, view the checks section at the bottom of the pull request.

@pavhl kindly sign the CLA

@stephenafamo
Copy link
Author

/gemini review

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

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants