Skip to content

Commit

Permalink
fix: Remove duplicate _total suffix from counters
Browse files Browse the repository at this point in the history
  • Loading branch information
AgathaSorceress committed Jan 15, 2024
1 parent 3d73135 commit f8da4a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ file within the repository.

If you compile the open source software that we make available to develop your
own mobile, desktop or embeddable application, and cause that application to
connect to our servers for any purposes, you have to aggree to our Terms of
connect to our servers for any purposes, you have to agree to our Terms of
Service. In short, if you choose to connect to our servers, certain restrictions
apply as follows:

Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ impl RecorderMiddleware {
let http_requests_duration_seconds =
meter.f64_histogram("http.requests.duration.seconds").init();

let http_requests_total = meter.u64_counter("http.requests.total").init();
let http_unmatched_requests_total =
meter.u64_counter("http.mismatched.requests.total").init();
let http_requests_total = meter.u64_counter("http.requests").init();
let http_unmatched_requests_total = meter.u64_counter("http.mismatched.requests").init();

Self {
registry,
Expand Down
8 changes: 4 additions & 4 deletions tests/basic_metrics_output.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TYPE fox_counter_total counter
fox_counter_total{otel_scope_name="axum-opentelemetry"} 6
# TYPE http_mismatched_requests_total_total counter
http_mismatched_requests_total_total{otel_scope_name="axum-opentelemetry"} 10
# TYPE http_mismatched_requests_total counter
http_mismatched_requests_total{otel_scope_name="axum-opentelemetry"} 10
# TYPE http_requests_duration_seconds histogram
http_requests_duration_seconds_bucket{endpoint="/visible_fox",method="GET",status="200",otel_scope_name="axum-opentelemetry",le="0"} 0
http_requests_duration_seconds_bucket{endpoint="/visible_fox",method="GET",status="200",otel_scope_name="axum-opentelemetry",le="5"} 5
Expand All @@ -21,8 +21,8 @@ http_requests_duration_seconds_bucket{endpoint="/visible_fox",method="GET",statu
http_requests_duration_seconds_bucket{endpoint="/visible_fox",method="GET",status="200",otel_scope_name="axum-opentelemetry",le="+Inf"} 5
http_requests_duration_seconds_sum{endpoint="/visible_fox",method="GET",status="200",otel_scope_name="axum-opentelemetry"} FLOAT
http_requests_duration_seconds_count{endpoint="/visible_fox",method="GET",status="200",otel_scope_name="axum-opentelemetry"} 5
# TYPE http_requests_total_total counter
http_requests_total_total{endpoint="/visible_fox",method="GET",status="200",otel_scope_name="axum-opentelemetry"} 5
# TYPE http_requests_total counter
http_requests_total{endpoint="/visible_fox",method="GET",status="200",otel_scope_name="axum-opentelemetry"} 5
# HELP otel_scope_info Instrumentation Scope metadata
# TYPE otel_scope_info gauge
otel_scope_info{otel_scope_name="axum-opentelemetry"} 1
Expand Down

0 comments on commit f8da4a9

Please sign in to comment.