-
Notifications
You must be signed in to change notification settings - Fork 41.2k
MetricRegistryMetricReader produces unordered Iterable with metrics #3761
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
Comments
Maby it would be better to change |
But, than should be used constructor with predifined custom comparator |
I opened a Pool Request #3770 |
This issue still exists. It'd be nice to get it fixed. The commit above is one option. Another might be to change the implementation of the Anyway here's my 👍 to getting this implemented. |
As I said in my comment on #3770, I'm not convinced that |
@jayanderson Using a LinkedHashMap wouldn't help with the raiser's requirement. Also, insertion order, while stable for the lifetime of the JVM, won't produce predictable results across multiple runs so I'm struggling to see the benefit. |
I've mentioned that this is the minor thing because it's mostly visual convenience for developer rather than real production issue. We do not use HTTP endpoint for metrics submission in production. Maybe adding |
Hi. I have faced the same issue. My solution was following:
Hope it helps. Thanks. |
The lack of sorting had me annoyed while developing on my local machine, too, but I can understand @wilkinsona in saying that sorting should be done on the client side. As a tip for those being annoyed by viewing unsorted metrics in the browser: use the JSON Viewer chrome plugin and set its option |
This has been superseded by the planned move to Micrometer-based metrics (#9970) |
This is minor but sometimes quite annoying issue.
MetricRegistryMetricReader
uses simpleHashSet
to collect metrics from registry. As result they appear it unpredictable order when exported to web/jmx view. It would be expected to see metrics ordered by name instead ofThe text was updated successfully, but these errors were encountered: