Standardized metrics export - feature flagged#125
Standardized metrics export - feature flagged#125chrishagglund-ship-it wants to merge 22 commits into
Conversation
…ont'd (missing file oops)
…th regards to how metrics are tracked
|
One thing on the metrics wiring: the Can we wrap the emit in a try/catch (or a small safeEmit helper) so a collector blowing up just gets logged and the request still goes through? Same goes for the other observer calls added on the request path, e.g. |
| _metricUri?: string, | ||
| ): void { | ||
| const key = `${method}:${uri}:${status}`; | ||
| this.observeSummary(this.metrics.apiRequestDurationMs, key, durationMs, "api_request", "endpoint"); |
There was a problem hiding this comment.
Now that this path is wired into the live HTTP pipeline, ignoring the template here is a cardinality problem. _metricUri (the bounded path template) is accepted but unused, and the key is built from the interpolated uri, so id-bearing endpoints each become their own endpoint series and their own Map entry, e.g. GET:/api/workflow/<uuid>:200. Any app calling things like getWorkflow(id) will grow this unbounded.
The canonical collector already uses metricUri ?? uri. Legacy should use the template the same way so the endpoint label stays bounded.
There was a problem hiding this comment.
agreed - i think wiring it up was unintentional, the metrics in main branch don't include this in the output. i think keeping it in the legacy output as a new newly outputted thing (but correctly without cardinality problem) is fine b/c it is just adding a new metric and doesn't change any existing one. wdyt (get rid of it from legacy to match main existing output, or keep it in but do it right?)
Provides cross-sdk standardized metrics output format, enabled by setting
WORKER_CANONICAL_METRICS=true, see standardized metrics catalog for the proposed standard metrics catalogsee TOOL-34 for more info