Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics: register skipper_filter_create_duration_seconds #3129

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions metrics/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ func (p *Prometheus) registerMetrics() {
p.registry.MustRegister(p.routeLookupM)
p.registry.MustRegister(p.responseM)
p.registry.MustRegister(p.routeErrorsM)
p.registry.MustRegister(p.filterCreateM)
p.registry.MustRegister(p.filterRequestM)
p.registry.MustRegister(p.filterAllRequestM)
p.registry.MustRegister(p.filterAllCombinedRequestM)
Expand Down
23 changes: 23 additions & 0 deletions metrics/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,29 @@ func TestPrometheusMetrics(t *testing.T) {
},
expCode: http.StatusOK,
},
{
name: "Filter creation latency",
addMetrics: func(pm *metrics.Prometheus) {
pm.MeasureFilterCreate("filter1", time.Now().Add(-15*time.Millisecond))
RomanZavodskikh marked this conversation as resolved.
Show resolved Hide resolved
},
expMetrics: []string{
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="0.005"} 0`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="0.01"} 0`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="0.025"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="0.05"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="0.1"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="0.25"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="0.5"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="1"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="2.5"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="5"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="10"} 1`,
`skipper_filter_create_duration_seconds_bucket{filter="filter1",le="+Inf"} 1`,
`skipper_filter_create_duration_seconds_sum{filter="filter1"} 0.015`,
`skipper_filter_create_duration_seconds_count{filter="filter1"} 1`,
},
expCode: http.StatusOK,
},
{
name: "Measuring the filter requests should get the duration of the filter requests.",
addMetrics: func(pm *metrics.Prometheus) {
Expand Down
Loading