Skip to content

Commit 017470e

Browse files
committed
feat(api): remove path attribute from http request count metrics
1 parent 681d031 commit 017470e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/synd_api/src/serve/layer/request_metrics.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@ where
5757
let status = response.status().as_u16();
5858

5959
// https://opentelemetry.io/docs/specs/semconv/http/http-metrics/
60-
// should be http.server.request ?
61-
metric!(monotonic_counter.request = 1, path, status);
60+
// Considiering the case of not found(404), recording the path as
61+
// an attribute leads to an inability to control cardinality.
62+
// Therefore, the path is not recorded.
63+
metric!(
64+
monotonic_counter.http.server.request = 1,
65+
http.response.status.code = status
66+
);
6267

6368
// instrument graphql latency
6469
if path == "/graphql" && method == Method::POST {

0 commit comments

Comments
 (0)