Nick Gavalas

Results comments of Nick Gavalas

I've noticed this as well. There are long, blocking calls when converting the metrics to the string that gets output to the client, though my CPU traces squarely place the...

@zbjornson From my traces, the other major offender when we have a slow call is rendering histograms. In particular, this function seems quite slow: https://github.com/siimon/prom-client/blob/master/lib/histogram.js#L210-L217 I believe we could improve...

Okay so from what I can tell, `.get()` is only called in the Registry, so this is a pretty self-contained change. I'll benchmark it but I expect this to be...

Ah. Thoughts on exposing an internal version for `getMetricAsPrometheusString` and have the existing `get` flatten out the labels so external callers are undisturbed? Happy to put up the PR this...

Yeah, I'll work on a repro; I've only observed this in production so I'll need to try to figure out which labels are causing issues for histograms. I can share...

@zbjornson FWIW, I think the existing registry benchmarks capture the problem fairly well. I have my proposed change working locally, passing all tests, and... ``` ### Results: ┌────────────────────────────────────────┬────────────────────┬────────────────────┐ │ registry...

I can put up the PR if you want to discuss?

@zbjornson One more possible improvement idea: can we skip labels with empty values at serialization time? As far as I can tell, prometheus doesn't differentiate between `{foo=""}` and `{}`; empty...

@SuperQ Facepalm. Do you happen to know where it says that in the Prometheus docs? The reason I ask is because I need to know if the label ORDER also...

@shappir it looks like `next` merged into `master` yesterday (for example, this is in `master` now: https://github.com/siimon/prom-client/commit/a19a1ad653a5c4f286ce21cc25e198dcebdd03df), so probably `master`?