tailscale/metrics
Anton Tolchanov b615a1d4db metrics: use constants for metric types
NewMultiLabelMap does not return an error so it's easy for someone to
pass an incorrect/unsupported metric type and serve invalid metrics to
Prometheus.

This would read as `metrics.Counter` and `metrics.Gauge` when used,
which seems readable enough; but if you think bare strings are better,
an alternative to this approach might be to verify string value in
`NewMultiLabelMap` and panic?

Updates tailscale/corp#22075

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2024-08-14 10:17:43 +01:00
..
fds_linux.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
fds_notlinux.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
metrics_test.go all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
metrics.go metrics: add missing comma in histogram JSON export 2023-09-07 15:28:12 -07:00
multilabelmap_test.go metrics: use constants for metric types 2024-08-14 10:17:43 +01:00
multilabelmap.go metrics: use constants for metric types 2024-08-14 10:17:43 +01:00