-
Notifications
You must be signed in to change notification settings - Fork 1k
Add OpenTelemetry Tracing #5054
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: v3.0
Are you sure you want to change the base?
Conversation
- Upgrade curl to v8.14.0 - Make json easily integrable with cmake projects - Add abseil-cpp, protobuf and otel-cpp Signed-off-by: Wazir Ahmed <[email protected]>
Closes #5000. Signed-off-by: Wazir Ahmed <[email protected]>
- Handle configuration changes - Span stack per session to handle context switching - Marcos for creating trace point with session context Closes #5001. Signed-off-by: Wazir Ahmed <[email protected]>
Signed-off-by: Wazir Ahmed <[email protected]>
Signed-off-by: Wazir Ahmed <[email protected]>
…t` is invalid Signed-off-by: Wazir Ahmed <[email protected]>
- Add `otel_span_filters` table and handle load/save operations. - Handle filtering via `OTelTracer` class, treat filters as an allow list. - Modify `OTelTracer` class to achieve the following. - `OTelTracer` should be the only interface other ProxySQL modules rely on to do any operation related to telemtry. - Spans should be created by calling `OTelTracer::StartSpan()`, instead of calling `OTelSpan`'s constructor directly. Closes #5002. Signed-off-by: Wazir Ahmed <[email protected]>
Signed-off-by: Wazir Ahmed <[email protected]>
Signed-off-by: Wazir Ahmed <[email protected]>
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.
Summary of Changes
Hello @wazir-ahmed, 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 introduces comprehensive OpenTelemetry tracing capabilities to the system. It involves integrating the necessary SDKs and libraries, overhauling significant portions of the build system, and implementing core logic to generate and manage trace spans. The new tracing functionality is fully configurable and supports filtering, with all settings manageable through the admin interface.
Highlights
- OpenTelemetry Integration: I've integrated the OpenTelemetry C++ SDK along with its core dependencies (Abseil, Protobuf, and nlohmann/json) into the project's build system and codebase. This enables distributed tracing capabilities.
- Build System Enhancements: Extensive modifications have been made to the Makefiles across the project and its dependencies. This includes adopting CMake for building new external libraries, centralizing compiler flags, and updating include/library paths to accommodate the new tracing infrastructure.
- Core Tracing Logic: New
OTelTracer
andOTelSpan
classes have been introduced to manage OpenTelemetry configuration, tracer providers, and the lifecycle of individual spans. This includes a customunsafe_shared_ptr
for performance in non-concurrent contexts. - Session-Level Tracing: Root spans are now automatically created for each MySQL and PostgreSQL session, providing a foundational tracing context for operations within those sessions. A span stack (
OTelSpanStack
) is used to manage parent-child relationships between spans. - Configurability and Filtering: OpenTelemetry tracing can be configured via new
otel_variables
inproxysql.cfg
. Additionally, a newotel_span_filters
table in the admin database allows for fine-grained control over which spans are generated, based on file, line number, and span name.LOAD
andSAVE
commands are available for managing these settings.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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 or fill out our survey to provide feedback.
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. ↩
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 introduces OpenTelemetry tracing, which is a significant and valuable addition for observability. The changes are extensive, touching the build system, adding new dependencies, and integrating the tracing logic throughout the codebase.
Overall, the implementation is well-structured. I've identified a few critical and high-severity issues related to potential memory leaks, exception safety, and correctness bugs that should be addressed before merging. I've also left some comments on potential improvements and TODOs that were left in the code.
Please review the detailed comments on the specific files. Great work on this feature!
Signed-off-by: Wazir Ahmed <[email protected]>
Signed-off-by: Wazir Ahmed <[email protected]>
Signed-off-by: Wazir Ahmed <[email protected]>
|
Signed-off-by: Wazir Ahmed <[email protected]>
|
Closes #4999.