pushgateway
The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not pushgateway’s official test suite, and the pushgateway project is not affiliated with atago.
Summary #
1 suite · 5 scenarios
Contents #
- pushgateway (self-hosted metrics gateway) — 5 scenarios
pushgateway (self-hosted metrics gateway) #
Source: test/e2e/thirdparty/pushgateway/pushgateway.atago.yaml
Scenario: a pushed metric appears on the scrape endpoint #
Given #
- Background service
pushgatewayis started:pushgateway --web.listen-address=127.0.0.1:18092.
When #
# HTTP POST /metrics/job/atago_e2e
# HTTP GET /metrics
Then #
- after
HTTP POST /metrics/job/atago_e2e:- HTTP status is
200
- HTTP status is
- after
HTTP GET /metrics:- HTTP status is
200 - body contains
job="atago_e2e" - body matches
/atago_e2e_metric\{[^}]*job="atago_e2e"[^}]*\} 3.14/
- HTTP status is
Scenario: deleting a job group removes its metrics #
Given #
- Background service
pushgatewayis started:pushgateway --web.listen-address=127.0.0.1:18093.
When #
# HTTP POST /metrics/job/ephemeral
# HTTP DELETE /metrics/job/ephemeral
# HTTP GET /metrics
Then #
- after
HTTP POST /metrics/job/ephemeral:- HTTP status is
200
- HTTP status is
- after
HTTP DELETE /metrics/job/ephemeral:- HTTP status is
202
- HTTP status is
- after
HTTP GET /metrics:- HTTP status is
200 - body does not contain
ephemeral_metric
- HTTP status is
Scenario: a malformed exposition body is rejected and never ingested #
Given #
- Background service
pushgatewayis started:pushgateway --web.listen-address=127.0.0.1:18099.
When #
# HTTP POST /metrics/job/badjob
# HTTP GET /metrics
Then #
- after
HTTP POST /metrics/job/badjob:- HTTP status is
400 - body contains
text format parsing error
- HTTP status is
- after
HTTP GET /metrics:- HTTP status is
200 - body does not contain
job="badjob"
- HTTP status is
Scenario: POST merges into a group while PUT replaces it #
Given #
- Background service
pushgatewayis started:pushgateway --web.listen-address=127.0.0.1:18100.
When #
# HTTP POST /metrics/job/svc
# HTTP POST /metrics/job/svc
# HTTP GET /metrics
# HTTP PUT /metrics/job/svc
# HTTP GET /metrics
Then #
- after
HTTP POST /metrics/job/svc:- HTTP status is
200
- HTTP status is
- after
HTTP POST /metrics/job/svc:- HTTP status is
200
- HTTP status is
- after
HTTP GET /metrics:- HTTP status is
200 - body contains
metric_a,metric_b
- HTTP status is
- after
HTTP PUT /metrics/job/svc:- HTTP status is
200
- HTTP status is
- after
HTTP GET /metrics:- HTTP status is
200 - body contains
metric_c - body does not contain
metric_a,metric_b
- HTTP status is
Scenario: a grouping label decorates every metric in the group #
Given #
- Background service
pushgatewayis started:pushgateway --web.listen-address=127.0.0.1:18101.
When #
# HTTP POST /metrics/job/svc/instance/host1
# HTTP GET /metrics
Then #
- after
HTTP POST /metrics/job/svc/instance/host1:- HTTP status is
200
- HTTP status is
- after
HTTP GET /metrics:- HTTP status is
200 - body matches
/labeled_metric\{[^}]*instance="host1"[^}]*job="svc"[^}]*\} 9/
- HTTP status is