Skip to content

[Feature Request] Use seconds as base unit for metrics in PrometheusHistogramMetricsTracker #2379

@nschile

Description

@nschile

Hi there! I am currently using HikariCP with Prometheus for monitoring and noticed that the PrometheusHistogramMetricsTracker currently tracks durations in milliseconds/nanoseconds. Prometheus Best Practices on Naming, recommends the base unit for durations be seconds.

Standardizing measurements to seconds across diverse systems and libraries simplifies dashboard creation and alerting rules, as it removes the need to remember which specific service reports in milliseconds versus seconds. It allows for a "consistent-by-default" approach across the entire observability stack.

Proposed Change

I would like to propose either:

  1. Updating/Configuring the existing tracker: Adding a configuration option to toggle the unit of measurement to seconds.
  2. A New Implementation: Creating a new implementation (e.g., PrometheusSecondsHistogramMetricsTracker) that uses seconds as the base unit.

I am happy to open a pull request to implement this change. Before I start, I wanted to check if you are open to the change and if you have a preference for which approach (configuration vs. new implementation) fits the project's vision best.

Looking forward to your thoughts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions