Skip to content

ClickHouse Java Client v2 is not instrumented #14364

@mznet

Description

@mznet

Is your feature request related to a problem? Please describe.

Currently, OTEL supports tracing for ClickHouse Java Client v1 via the ClickhouseClient class, however, ClickHouse Java Client v2 introduces Client class, which are not currently instrumented by the OTEL Java Agent.

As v2 is becoming the standard approach for interacting with ClickHouse, it would be valuable to support instrumentation for its new API structure.

Describe the solution you'd like

OTEL Agent should trace ClickHouse via Client class or v2 interface.

Describe alternatives you've considered

No response

Additional context

Here is an example

public Client clickhouseClient() {
    return new Client.Builder()
        .addEndpoint(Protocol.HTTP, host, port, false)
        .setUsername("default")
        .setPassword("")
        .setDefaultDatabase(database)
        .build();
}
QueryResponse queryResponse = clickhouseClient.query("SELECT * FROM logs_v2 LIMIT 10").get();

Map<String, Object> result = new HashMap<>();
result.put("success", true);
result.put("message", "Logs retrieved successfully (10 records)");
result.put("data", queryResponse.toString());
result.put("rowCount", queryResponse.getReadRows());

return CompletableFuture.completedFuture(result);

ClickHouse Java Client v1
Image

ClickHouse Java Client v2
Image

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

Labels

contribution welcomeRequest makes sense, maintainers probably won't have time, contribution would be welcomeenhancementNew feature or requestnew instrumentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions