rcrowley / go-metrics

Go port of Coda Hale's Metrics library
Other
3.43k stars 493 forks source link

Options for exposing structured metrics in expvars #153

Closed aalpern closed 7 years ago

aalpern commented 8 years ago

This adds a few capabilities to the expvar support:

The defaults are all set so there's no change from existing behavior.

Output Examples

Setting a root key:

    "metrics": {
        "http.client.postmark.errors": 0,
        "http.client.postmark.method.GET.50-percentile": 0,
        "http.client.postmark.method.GET.75-percentile": 0,
        "http.client.postmark.method.GET.95-percentile": 0,
        "http.client.postmark.method.GET.99-percentile": 0,
        "http.client.postmark.method.GET.999-percentile": 0,

Setting a root key and structured output:

    "metrics": {
        "http.client.postmark.errors": {
            "count": 0
        },
        "http.client.postmark.method.GET": {
            "50-percentile": 0,
            "75-percentile": 0,
            "95-percentile": 0,
            "99-percentile": 0,
            "999-percentile": 0,
            "count": 0,
kamilchm commented 7 years ago

I would love to see it on master. @rcrowley ?