summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient/metrics.go
diff options
context:
space:
mode:
authorBrian Palmer <brianp@tailscale.com>2025-03-03 13:13:16 -0700
committerBrian Palmer <brianp@tailscale.com>2025-03-03 13:13:16 -0700
commit67d9def2d1af633f5772652cf4c69b56cac45c52 (patch)
treeecf88d82b4b5f079a7b370d538b48d18fe6734f1 /control/controlclient/metrics.go
parentce6ce81311cc53df4498f2e8757b52be50801d64 (diff)
downloadtailscale-brianp/controlclient-timings.tar.xz
tailscale-brianp/controlclient-timings.zip
controlclient: add timing metrics for control requestsbrianp/controlclient-timings
Updates #26869
Diffstat (limited to 'control/controlclient/metrics.go')
-rw-r--r--control/controlclient/metrics.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/control/controlclient/metrics.go b/control/controlclient/metrics.go
new file mode 100644
index 000000000..8f8bfe40e
--- /dev/null
+++ b/control/controlclient/metrics.go
@@ -0,0 +1,39 @@
+package controlclient
+
+import (
+ "github.com/prometheus/client_golang/prometheus"
+ "github.com/prometheus/client_golang/prometheus/promauto"
+)
+
+var (
+ loginLatencies = promauto.NewHistogram(prometheus.HistogramOpts{
+ Name: "controlclient_login_latency_seconds",
+ Help: "Control login time",
+ // 15 buckets from 10ms to 1m.
+ Buckets: prometheus.ExponentialBucketsRange(0.01, 60, 15)},
+ )
+ dialLatencies = promauto.NewHistogram(prometheus.HistogramOpts{
+ Name: "controlclient_dial_latency_seconds",
+ Help: "Control dial time",
+ // 15 buckets from 10ms to 1m.
+ Buckets: prometheus.ExponentialBucketsRange(0.01, 60, 15)},
+ )
+ initialMapRequestLatencies = promauto.NewHistogram(prometheus.HistogramOpts{
+ Name: "controlclient_initial_map_request_latency_seconds",
+ Help: "Initial map request/response time",
+ // 15 buckets from 10ms to 1m.
+ Buckets: prometheus.ExponentialBucketsRange(0.01, 60, 15)},
+ )
+ updateHealthLatencies = promauto.NewHistogram(prometheus.HistogramOpts{
+ Name: "controlclient_update_health_latency_seconds",
+ Help: "Update health request/response time",
+ // 15 buckets from 10ms to 1m.
+ Buckets: prometheus.ExponentialBucketsRange(0.01, 60, 15)},
+ )
+ answerPingLatencies = promauto.NewHistogram(prometheus.HistogramOpts{
+ Name: "controlclient_answer_ping_latency_seconds",
+ Help: "Answer ping request/response time",
+ // 15 buckets from 10ms to 1m.
+ Buckets: prometheus.ExponentialBucketsRange(0.01, 60, 15)},
+ )
+)