question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

http_server_duration_bucket generates high cardinality metrics

See original GitHub issue

Describe the bug The Java agent, when configured to export metrics with Prometheus exporter, creates as expected the bucket http_server_duration_bucket.

This metric also has the http_route label, which produces high cardinality because it contains full paths like:

http_server_duration_bucket{container="xxx", endpoint="xxx", http_flavor="1.1", http_host="xxx", http_method="GET", http_route="/app/wsrest/userlogo/holding.png", http_scheme="http", http_status_code="200", instance="xxx:9464", job="xxx", le="7500.0", namespace="wms", pod="xxxx", service="wms"}

In my cluster this caused the number of time series to increase of ~300k !

Steps to reproduce

  1. Instrument a Java app to export metrics with Prometheus exporter
  2. Setup a Prometheus instance to scrape those metrics
  3. Query Prometheus for http_server_duration_bucket

What did you expect to see? http_server_duration_bucket should export lower cardinality metrics

What did you see instead? http_server_duration_bucket export high cardinality metrics

What version are you using? 1.12.1

Environment Compiler: (e.g., “AdoptOpenJDK 11.0.6”) OS: Ubuntu 20.04 Runtime (if different from JDK above): (e.g., “Oracle JRE 8u251”) OS (if different from OS compiled on): (e.g., “Windows Server 2019”)

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
irizzantcommented, Apr 13, 2022

Hi @mateuszrzeszutek @trask

Would it be possible for you to extract a part of your application as a repro app?

this request took me a lot of work!

Anyway, please check https://github.com/irizzant/otel-java-instrumentation-5753

If you run the reproducer, you will see that the exported Undertow metrics have http.route that get to the very single resources, for example you can see http.route reporting the single /jsf-demo/hello.xhtml

0reactions
mateuszrzeszutekcommented, Apr 7, 2022

Hey @irizzant , Would it be possible for you to extract a part of your application as a repro app? Without a working example it’s really hard to reason about the http.route attribute, since it usually isn’t set by the server instrumentations, but (one or more) controller/mvc framework.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to manage high cardinality metrics in Prometheus and ...
Consider the kube_pod_status_phase metric (one of the kube-state-metrics), which generates a new time series each time a pod changes state, say ...
Read more >
Understand and query high cardinality metrics
For New Relic Query Language (NRQL): how to understand high cardinality metrics and successfully query for them using NRQL.
Read more >
Ingest high-cardinality logs to generate metrics with ...
Explains how to use CloudWatch embedded metric format to ingest high-cardinality logs and extract metrics from them.
Read more >
Promtail generates very high cardinality prometheus metrics
I have only 5 services running on this node, but this generates up to 153 different labels sets (due to the metric being...
Read more >
What is high cardinality - Chronosphere
This is because microservices and containerized applications generate metrics data an order of magnitude more than legacy environments.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found