Skip to content

Commit ff4d435

Browse files
authored
fix(repo): Change metrics endpoints to return plain text (#496)
1 parent a25fc1e commit ff4d435

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
- name: Install nextest
182182
uses: taiki-e/cache-cargo-install-action@v2
183183
with:
184-
tool: cargo-nextest
184+
tool: cargo-nextest@0.9.100
185185
locked: true
186186

187187
- name: Install dependencies
@@ -275,7 +275,7 @@ jobs:
275275
- name: Install nextest
276276
uses: taiki-e/cache-cargo-install-action@v2
277277
with:
278-
tool: cargo-nextest
278+
tool: cargo-nextest@0.9.100
279279
locked: true
280280

281281
- name: Setup Database

cluster/docker/monitoring/prometheus/prometheus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ scrape_configs:
4949
scrape_interval: 5s
5050
scrape_timeout: 2s
5151
scheme: http
52-
metrics_path: /api/v1/metrics
52+
metrics_path: /metrics
5353
static_configs:
5454
- targets:
5555
- '192.168.0.116:9002'
@@ -58,7 +58,7 @@ scrape_configs:
5858
scrape_interval: 5s
5959
scrape_timeout: 2s
6060
scheme: http
61-
metrics_path: /api/v1/metrics
61+
metrics_path: /metrics
6262
static_configs:
6363
- targets:
6464
- '192.168.0.116:9003'

crates/web-utils/src/server/http/handlers.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ pub async fn get_metrics<T: StateProvider>(
1111
) -> impl IntoResponse {
1212
Response::builder()
1313
.status(StatusCode::OK)
14-
.header(
15-
header::CONTENT_TYPE,
16-
"application/openmetrics-text; version=1.0.0; charset=utf-8",
17-
)
14+
.header(header::CONTENT_TYPE, "text/plain; charset=utf-8")
1815
.body(axum::body::Body::from(state.get_metrics().await))
1916
.unwrap_or_else(|e| {
2017
// Fallback in case of response building error (unlikely)

0 commit comments

Comments
 (0)