miekg / caddy-prometheus

Prometheus metrics middleware for caddy
Apache License 2.0
65 stars 26 forks source link

Add time to first write as response_latency_seconds (fixes #40) #41

Closed calmh closed 6 years ago

miekg commented 6 years ago

Thanks! This should update the README.md as well though.

calmh commented 6 years ago

Sure. Do you want me to do that?

calmh commented 6 years ago

When looking at it now I realize that the other response metrics don't have the family and proto labels. Is this for historic reasons, or do you want to avoid having those on response metrics? I could see a point in having for example the ..._size_bytes do accounting per proto and family, but the response latency I'm adding here shouldn't be dependent on either of those so perhaps cleanest to avoid the labels?

miekg commented 6 years ago

Adding those labels doesn't add any overhead and if you don't care you can just aggregate them without using those labels.

So lets extend the family and proto to all?

calmh commented 6 years ago

I did that, and went one step further and added the status label to all response metrics. It makes sense at least for the latency metric, where 404s are probably instantaneous and not interesting, etc.