feat: support otel for sdk#175
Merged
weiping-code merged 1 commit intoopenGemini:mainfrom Oct 17, 2025
Merged
Conversation
2897fb0 to
5dddefb
Compare
zhiheng123
approved these changes
Sep 20, 2025
8ce14d2 to
5dddefb
Compare
5dddefb to
51769e5
Compare
zhiheng123
approved these changes
Oct 14, 2025
There was a problem hiding this comment.
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
hezhangjian
reviewed
Oct 14, 2025
| <groupId>io.opengemini</groupId> | ||
| <artifactId>opengemini-client-parent</artifactId> | ||
| <version>0.3.3</version> | ||
| <version>0.3.4</version> |
Member
There was a problem hiding this comment.
please split feature and project version
hezhangjian
reviewed
Oct 14, 2025
hezhangjian
reviewed
Oct 14, 2025
hezhangjian
reviewed
Oct 14, 2025
hezhangjian
reviewed
Oct 14, 2025
hezhangjian
reviewed
Oct 14, 2025
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
weiping-code
approved these changes
Oct 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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