Skip to content

ClickHouse HTTP client instrumentation does not work when no database selected #11851

@devurandom

Description

@devurandom

Describe the bug

OpenTelemetry JavaAgent 2.6.0 should add instrumentation to the ClickHouse JavaAgent. I tried it with our application (Java 11, Clojure 1.11.3, ClickHouse HTTP Client 0.6.2, using the built-in Java HTTP Client). As with previous JavaAgent versions, I only see the spans created by io.opentelemetry.java-http-client.

Steps to reproduce

  1. Start an OpenTelemetry stack on http://localhost:4317.
  2. Follow the instructions in https://github.com/devurandom/opentelemetry-java-instrumentation-clickhouse-clojure-mwe to run the sample application.
  3. Observe a HTTP client span with name POST, but no ClickHouse client span.

I looked at the traces using OpenTelemetry Collector ingesting into Grafana Tempo, and using https://github.com/dotnet/aspire/tree/main/src/Aspire.Dashboard locally, but both only show the io.opentelemetry.java-http-client spans.

Expected behavior

I expected to see two nested spans, one created by the ClickHouse client instrumentation, the other created by the HTTP client instrumentation.

Actual behavior

I only see a HTTP client span with name POST, but no ClickHouse client span.

Javaagent or library instrumentation version

v2.6.0

Environment

JDK:

❯ java --version
openjdk 21.0.3 2024-04-16
OpenJDK Runtime Environment (Red_Hat-21.0.3.0.9-1) (build 21.0.3+9)
OpenJDK 64-Bit Server VM (Red_Hat-21.0.3.0.9-1) (build 21.0.3+9, mixed mode, sharing)

OS:

❯ grep PRETTY /etc/os-release
PRETTY_NAME="Fedora Linux 40 (KDE Plasma)"

Additional context

This continues #11660 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions