This adds a few capabilities to the expvar support:
Makes the exported percentiles configurable (I like having the 98th as well as 99th available)
Adds an option to group all the metrics as a map under a common key (i.e. you can put them all in "metrics", as opposed to just at the root of the expvar JSON blob). A collector grabbing metrics from the /debug/metrics endpoint can then just process everything under the metrics key, rather than maintaining a list of non-metrics keys to exclude.
Adds an option to output metrics as maps, grouping all the rates & percentiles, etc... into a single map per metric, instead of making them all into separate vars (Hi @mihasya! this might look familiar to you :dash: :ship:), which works better than flat for some metrics collectors.
The defaults are all set so there's no change from existing behavior.
This adds a few capabilities to the
expvar
support:"metrics"
, as opposed to just at the root of the expvar JSON blob). A collector grabbing metrics from the/debug/metrics
endpoint can then just process everything under the metrics key, rather than maintaining a list of non-metrics keys to exclude.The defaults are all set so there's no change from existing behavior.
Output Examples
Setting a root key:
Setting a root key and structured output: