-
Notifications
You must be signed in to change notification settings - Fork 24
feat: support otel for sdk #175
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
feat: support otel for sdk #175
Conversation
2897fb0 to
5dddefb
Compare
8ce14d2 to
5dddefb
Compare
5dddefb to
51769e5
Compare
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.
Pull Request Overview
This PR adds OpenTelemetry (OTEL) support to the OpenGemini Java SDK, enabling distributed tracing for query and write operations. The implementation introduces an interceptor pattern for tracing database operations and includes necessary infrastructure for telemetry configuration.
Key changes:
- Added OpenTelemetry dependencies and configuration for tracing
- Implemented interceptor pattern with
OtelInterceptorfor automatic span creation - Enhanced Query and Write API classes with attribute storage for span management
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Added OpenTelemetry dependencies, updated version numbers, and build configuration |
| OtelInterceptor.java | New interceptor implementation for creating and managing tracing spans |
| Interceptor.java | New interface defining the interceptor contract for operations |
| OpenTelemetryConfig.java | Configuration class for initializing OpenTelemetry with Jaeger exporter |
| Write.java | New API class for write operations with attribute support |
| Query.java | Enhanced existing Query class with attribute storage and new constructors |
| Point.java | Added fluent builder methods for creating Point instances |
| package-info.java | Added package documentation for interceptor package |
Comments suppressed due to low confidence (1)
pom.xml:1
- Dependencies are duplicated. Lines 121-140 and 153-172 contain identical OpenTelemetry dependencies, and lines 143-147 and 174-178 contain duplicate okhttp dependencies. Remove the duplicate entries to avoid confusion and potential conflicts.
<?xml version="1.0" encoding="UTF-8"?>
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
opengemini-client/src/main/java/io/opengemini/client/interceptor/OtelInterceptor.java
Outdated
Show resolved
Hide resolved
opengemini-client/src/main/java/io/opengemini/client/interceptor/OtelInterceptor.java
Show resolved
Hide resolved
| <groupId>io.opengemini</groupId> | ||
| <artifactId>opengemini-client-parent</artifactId> | ||
| <version>0.3.3</version> | ||
| <version>0.3.4</version> |
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.
please split feature and project version
opengemini-client-api/src/main/java/io/opengemini/client/api/Write.java
Outdated
Show resolved
Hide resolved
51769e5 to
79734bf
Compare
opengemini-client/src/main/java/io/opengemini/client/impl/OpenGeminiClient.java
Outdated
Show resolved
Hide resolved
79734bf to
963ae09
Compare
… Operations Signed-off-by: chenhuan <xiangyuyu_2024@qq.com>
963ae09 to
6f72fe6
Compare
What problem does this PR solve?
Provides distributed tracing capability for the OpenGemini Java client, enabling users to achieve call chain visualization, performance analysis, and troubleshooting through the OpenTelemetry ecosystem (such as Jaeger), thereby enhancing system observability.
What is changed and how it works?
Added the Interceptor interface and OtelInterceptor implementation to insert OpenTelemetry tracing logic before and after query (Query) and write (Write) operations, including Span creation, attribute setting, and status marking.
Extended the Query and Write classes by adding a Map<String, Object> attribute map to store context information such as tracing Spans.
Modified the OpenGeminiClient class to introduce an interceptor flow when executing query and write operations, ensuring the tracing logic is triggered.
Added the OpenTelemetryConfig configuration class and related dependency management to support the configuration and use of Tracer.
How has this been tested?
Configure an OpenTelemetry exporter (Jaeger), execute query and write operations, and verify whether tracing data is generated and reported normally, ensuring that the creation, attributes, and status of Spans meet expectations.
Checklist:
*related documents:
openGemini/openGemini.github.io#163