Skip to content

Commit

Permalink
Varnish 3 (#51)
Browse files Browse the repository at this point in the history
* Test the Prometheus gather
The "gauge should be a Counter" error doesn't present until the Prometheus module attempts to gather the metrics for display (see https://github.com/prometheus/client_golang/blob/4efc3ccc7a660996803fff4721a2643b33dc3f77/prometheus/registry.go#L610).

This test runs through the test varnishstat files and collects them into a Prometheus registry and then calls `Gather()` to ensure there are no errors.

* Add test for varnish 3 scraping and gathering

* Remove the `main_n_ban` grouping.
This is no longer used in Varnish 4+ as the metric was renamed to `n_bans` rather than `n_ban`. And in Varnish 3 it breaks as the `n_ban` and `n_ban_gone` are `i` (Integer) flags while all the other `n_ban*` metrics are `a` (Accumulator) flags. (See https://github.com/varnishcache/varnish-cache/blob/3.0/include/vsc_fields.h#L142-L148)

* Revert accidental update to go.mod
  • Loading branch information
glennslaven authored and jonnenauha committed Oct 27, 2019
1 parent abeb459 commit b58ac81
Show file tree
Hide file tree
Showing 3 changed files with 1,274 additions and 15 deletions.
7 changes: 0 additions & 7 deletions prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,6 @@ var (
total: "main_n_wrk",
desc: "Number of worker threads",
},
&grouping{
newPrefix: "main_bans",
prefix: "main_n_ban",
total: "main_n_ban",
desc: "Number of bans",
labelKey: "action",
},
}
fqNames = map[string]string{
"varnish_lck_colls": "varnish_lock_collisions",
Expand Down
Loading

0 comments on commit b58ac81

Please sign in to comment.