Skip to content

Conversation

@chenhuansome
Copy link
Contributor

@chenhuansome chenhuansome commented Sep 20, 2025

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?

  1. 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.

  2. Extended the  Query  and  Write  classes by adding a  Map<String, Object>  attribute map to store context information such as tracing Spans.

  3. Modified the  OpenGeminiClient  class to introduce an interceptor flow when executing query and write operations, ensuring the tracing logic is triggered.

  4. 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:

  • [✓ ] My code follows the style guidelines of this project
  • [✓ ] have performed a self-review of my own code
  • [✓ ] have commented my code, particularly in hard-to-understand areas
  • [ ] have made corresponding changes to the documentation
  • [✓ ] My changes generate no new warnings
  • [ ] have added tests that prove my feature works
  • [✓ ] New and existing unit tests pass locally with my changes
  • [✓ ] Any dependent changes have been merged and published in downstream modules

*related documents:
openGemini/openGemini.github.io#163

@dosubot
Copy link

dosubot bot commented Sep 20, 2025

Documentation Updates

Checked 2 published document(s). No updates required.

How did I do? Any feedback?  Join Discord

@chenhuansome chenhuansome force-pushed the opentelemetry-integration branch from 2897fb0 to 5dddefb Compare September 20, 2025 06:24
@chenhuansome chenhuansome force-pushed the opentelemetry-integration branch from 8ce14d2 to 5dddefb Compare September 27, 2025 16:07
@chenhuansome chenhuansome force-pushed the opentelemetry-integration branch from 5dddefb to 51769e5 Compare October 12, 2025 11:26
@hezhangjian hezhangjian requested a review from Copilot October 14, 2025 03:43
Copy link

Copilot AI left a 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 OtelInterceptor for 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.

<groupId>io.opengemini</groupId>
<artifactId>opengemini-client-parent</artifactId>
<version>0.3.3</version>
<version>0.3.4</version>
Copy link
Member

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

@chenhuansome chenhuansome force-pushed the opentelemetry-integration branch from 51769e5 to 79734bf Compare October 14, 2025 14:42
@chenhuansome chenhuansome force-pushed the opentelemetry-integration branch from 79734bf to 963ae09 Compare October 17, 2025 12:40
… Operations

Signed-off-by: chenhuan <xiangyuyu_2024@qq.com>
@chenhuansome chenhuansome force-pushed the opentelemetry-integration branch from 963ae09 to 6f72fe6 Compare October 17, 2025 12:46
@weiping-code weiping-code merged commit eac4fd3 into openGemini:main Oct 17, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants