fastly / fastly-exporter

A Prometheus exporter for the Fastly Real-time Analytics API
Apache License 2.0
99 stars 36 forks source link

Adding edge/shield-specific hit and miss fields #103

Closed mattcallahan closed 1 year ago

mattcallahan commented 2 years ago

Adds the following edge/shield-specific hit and miss fields:

shawnps commented 2 years ago

Hi @mattcallahan thanks for the PR. I've reached out to the repo admins to see if we can enable CI actions for PRs. Will update this ticket when I hear back.

SuperQ commented 2 years ago

One thing we typically do in Prometheus is to pick one of two, hits or misses, if there is also an "all" option.

So we don't actually need to exposes misses here, because the end user can derive misses from edge_request - edge_hit_requests.

It's also still possible to calculate hit/miss ratios with math like this:

1 - (edge_hit_requests / edge_request)
hermanschaaf commented 2 years ago

@SuperQ

One thing we typically do in Prometheus is to pick one of two, hits or misses, if there is also an "all" option.

This is likely to be good enough in many cases, but be aware that edge_requests is not necessarily equal to edge_hit_requests + edge_miss_requests--if I'm not mistaken the total edge_requests also includes passes, errors, pipe and synthetic responses, which are not counted as either hit or miss.

SuperQ commented 2 years ago

@hermanschaaf Interesting, if there's more than hit and miss, it makes sense to have them as labels.

Really, it would be preferable if the upstream API provided something like this:

edge_requests{response="hit"} 1
edge_requests{response="miss"} 1
edge_requests{response="pass"} 1
...

This way sum(edge_requests) would include all valid responses.

leklund commented 1 year ago

These fields were finally added in #131 and released in v7.5.0