Skip to content

Missing explicit bounds for db.client.commands.duration and db.client.connections.create_time #6167

Closed

Description

@KeterSCP

Here histogram for command duration is created without passing explicit bucket boundaries via advice parameter.

CommandDuration = Meter.CreateHistogram<double>(
"db.client.commands.duration",
unit: "s",
description: "The duration of database commands, in seconds.");

This leads to default bucket boundaries being reported as:

ExplicitBounds #0: 0.000000
ExplicitBounds #1: 5.000000
ExplicitBounds #2: 10.000000
ExplicitBounds #3: 25.000000
ExplicitBounds #4: 50.000000
ExplicitBounds #5: 75.000000
ExplicitBounds #6: 100.000000
ExplicitBounds #7: 250.000000
ExplicitBounds #8: 500.000000
ExplicitBounds #9: 750.000000
ExplicitBounds #10: 1000.000000
ExplicitBounds #11: 2500.000000
ExplicitBounds #12: 5000.000000
ExplicitBounds #13: 7500.000000
ExplicitBounds #14: 10000.000000

All my commands fall into bucket #1.

It is clear that those boundaries are not suitable for command duration measured in seconds.

Official OTel semantic convention for database duration metrics states:

This metric SHOULD be specified with ExplicitBucketBoundaries of [ 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10 ].

db.client.connections.create_time has the same issue.

Activity

  1. changed the title [-]Missing explicit bounds for `db.client.commands.duration`[/-] [+]Missing explicit bounds for `db.client.commands.duration` and `db.client.connections.create_time`[/+] on Jul 26, 2025
  2. added theissue type on Oct 27, 2025
  3. added this to the 9.0.5 milestone on Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions