Skip to content

Commit

Permalink
agent: fix metrics namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
andydunstall committed May 26, 2024
1 parent b505752 commit 881d7d9
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions agent/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,35 @@ type Metrics struct {
// forward address in seconds. Labelled by response status code and
// endpoint ID.
ForwardRequestLatency *prometheus.HistogramVec

// ServerConnectionErrorsTotal is the total number of errors attempting to
// connect to the server.
ServerConnectionErrorsTotal prometheus.Counter
}

func NewMetrics() *Metrics {
return &Metrics{
ForwardRequestsTotal: prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "forward",
Namespace: "piko",
Subsystem: "forward",
Name: "requests_total",
Help: "Total requests to the forward address.",
},
[]string{"method", "status", "endpoint_id"},
[]string{"status", "method", "endpoint_id"},
),
ForwardErrorsTotal: prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "forward",
Namespace: "piko",
Subsystem: "forward",
Name: "errors_total",
Help: "Total errors from the forward address.",
},
[]string{"endpoint_id"},
),
ForwardRequestLatency: prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "forward",
Namespace: "piko",
Subsystem: "forward",
Name: "request_latency_seconds",
Help: "Forward request latency in seconds",
Buckets: prometheus.ExponentialBuckets(0.01, 2, 10),
Buckets: prometheus.DefBuckets,
},
[]string{"status", "endpoint_id"},
),
Expand Down

0 comments on commit 881d7d9

Please sign in to comment.