Skip to content

Unable to produce db.client.operation.duration metrics #12972

@cyrille-leclerc

Description

@cyrille-leclerc

Describe the bug

Unable to produce db.client.operation.duration metrics that are supposed to be introduced in opentelemetry-jva-instrumentation v2.11 through #12806 .
None of export OTEL_SEMCONV_STABILITY_OPT_IN=database and -Dotel.semconv-stability.opt-in=database works to enable this metric.

Steps to reproduce

  • Use a demo java jdbc app like https://github.com/cyrille-leclerc/my-shopping-cart/tree/5a8839e7ca376d43097625f176277da294a1f996/frontend (startup command here)
  • Instrument the application with otel-java-instrumentation v2.11 and send metrics to a backend like Prometheus
  • Activate new OTel DB metrics with any of -Dotel.semconv-stability.opt-in=database and export OTEL_SEMCONV_STABILITY_OPT_IN=database
  • Start the application and generate traffic
  • Verify that
    • some DB client spans are produced
    • the otel instrumentation version is v2.11, for xample looking at the resource attribute telemetry.distro.version=2.11.0 on the spans

Expected behavior

The histogram metric db.client.operation.duration is produced.

Actual behavior

The metric db.client.operation.duration is missing.

Other db.client.* metrics are available: db.client.connections.create_time (histogram in ms), db.client.connections.idle.min (gauge), db.client.connections.pending_requests (gauge), db.client.connections.use_time (histogram in ms), db.client.connection.wait_time (histogram in ms)

Javaagent or library instrumentation version

v2.11.0

Environment

JDK:

OpenJDK Runtime Environment 17.0.13+0

OS:
MacOS 15.2

Additional context

cc @zeitlinger

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions