Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process_start_time_seconds HELP description inconsistency between Prometheus and micrometer #5290

Closed
weissn1 opened this issue Jul 8, 2024 · 1 comment
Labels
enhancement A general enhancement registry: prometheus A Prometheus Registry related issue
Milestone

Comments

@weissn1
Copy link

weissn1 commented Jul 8, 2024

According to Prometheus documentation (https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics), the HELP string of the metric "process_start_time_seconds" needs to be "Start time of the process since unix epoch in seconds.", but in micrometer it is "Start time of the process since unix epoch."

Currently, if two metrics of the same name but with different HELP description are pushed into the same group, the Pushgateway will notice, pick one HELP message over the other and write a warning message in the logs.

For example:

msg="metric families inconsistent help strings" err="Metric families have inconsistent help strings. The latter will have priority. This is bad. Fix your pushed metrics!"

msg="metric families overlap" err="Metric family has the same name as a metric family used by the Pushgateway itself but it has a different help string. Changing it to the standard help string. This is bad. Fix your pushed metrics!"

Can we fix this HELP description in micrometer to stop these logs?

Environment

  • Micrometer version 1.8.13
  • Micrometer registry prometheus
  • OS: Red Hat Enterprise Linux release 8.9 (Ootpa)
  • Java version: OpenJDK Runtime Environment (Red_Hat-11.0.22.0.7-1) (build 11.0.22+7-LTS)
  • Pushgateway version: 1.6.0
  • Prometheus version: 2.45.0

Please refer to the following issue: #2413
I understand that we can't change the general description under UptimeMetrics since other registries don't necessarily use seconds as their time unit.

        TimeGauge.builder("process.start.time", runtimeMXBean, TimeUnit.MILLISECONDS, RuntimeMXBean::getStartTime)
            .tags(tags)
            .description("Start time of the process since unix epoch.")
            .register(registry);

But I believe that we can change the description for the Prometheus registry by adding a new MeterFilter under PrometheusRenameFilter.

@shakuzen
Copy link
Member

I think we can add it to the PrometheusRenameFilter. Would you be willing to submit a pull request for it?

@shakuzen shakuzen added enhancement A general enhancement registry: prometheus A Prometheus Registry related issue and removed waiting-for-triage labels Jul 10, 2024
@shakuzen shakuzen added this to the 1.14.x milestone Jul 10, 2024
@shakuzen shakuzen added the help wanted An issue that a contributor can help us with label Jul 10, 2024
@shakuzen shakuzen modified the milestones: 1.14.x, 1.14.0-M3 Sep 3, 2024
@shakuzen shakuzen removed the help wanted An issue that a contributor can help us with label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement registry: prometheus A Prometheus Registry related issue
Projects
None yet
Development

No branches or pull requests

2 participants