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

Update to otel 0.20.0 #3649

Merged
merged 34 commits into from
Sep 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f6a67b6
Update to opentelemetry 0.20
Sep 15, 2023
b85c699
Add comment
Sep 18, 2023
e4ab716
Make creation of registered metrics atomic otherwise there would be a…
Sep 19, 2023
8ede811
Add dev docs
Sep 19, 2023
e9b6b8f
Improve dev docs a bit more
Sep 20, 2023
0cb3f3d
Improve dev docs a bit more
Sep 20, 2023
4b6181e
Update dev-docs/metrics.md
BrynCooke Sep 20, 2023
630c634
Add test for multiple calls to metrics
Sep 20, 2023
26fc686
Doc fixes
Sep 20, 2023
62b2d69
No need to use a boxed meter
Sep 20, 2023
356673c
Preallocate vecs to the correct size.
Sep 20, 2023
9f9a1a6
Fix metric that accidentally got renamed.
Sep 20, 2023
2117044
Add another lock for a prometheus test
Sep 20, 2023
0b8561f
Fix service.name detection.
Sep 21, 2023
094c2b9
Lint
Sep 21, 2023
95dc614
Changelog
Sep 21, 2023
9dd2ca8
Merge branch 'dev' into bryn/otel-update
Sep 21, 2023
588d67f
Changelog
Sep 21, 2023
1c5869b
Docs and changelog
Sep 21, 2023
f0c9354
Add gauge test and add some docs.
Sep 21, 2023
aa2fab7
Fix accidentally renamed metric
Sep 21, 2023
67957bd
Add tests for metric names
Sep 21, 2023
069742c
Merge dev
Sep 22, 2023
040dfb7
improve metrics macros (#3880)
bnjjj Sep 22, 2023
48ecaa3
Make metrics assertions type specific
Sep 25, 2023
a3fa457
Fix gauge test
Sep 25, 2023
0a65766
Make prom tests ignore reload.
Sep 25, 2023
286f3e7
Make linux use xlarge for builds in circle
Sep 26, 2023
b900187
Merge dev
Sep 26, 2023
8a65c2e
Update changelog
Sep 26, 2023
fba92d2
Fix alpha ordering in cargo toml
Sep 26, 2023
40acb7b
Add constant for unknown_service
Sep 26, 2023
5f69d6c
Merge dev
Sep 26, 2023
6516f2c
Update cargo lock
Sep 27, 2023
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
Prev Previous commit
Next Next commit
Fix metric that accidentally got renamed.
bryn committed Sep 20, 2023
commit 9f9a1a68d2f19f1f3522751f4d2ecec23c6d7db2
2 changes: 1 addition & 1 deletion apollo-router/src/plugins/telemetry/mod.rs
Original file line number Diff line number Diff line change
@@ -902,7 +902,7 @@ impl Telemetry {
);

f64_histogram!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a rename? (appending _seconds)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a rename. The original code is referencing metrics.http_requests_duration which is declared as: apollo_router_http_request_duration_seconds.

"apollo_router_http_requests_duration",
"apollo_router_http_request_duration_seconds",
"Duration of HTTP requests.",
request_duration.as_secs_f64(),
metric_attrs
Original file line number Diff line number Diff line change
@@ -2,16 +2,16 @@
source: apollo-router/src/plugins/telemetry/mod.rs
expression: prometheus_metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this change, but won't this impact existing consumers of http_request_duration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm now confused also. Checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metric was always called: apollo_router_http_request_duration_seconds_bucket. Pretty unfortunate.

In terms of why the snapshot has changed, it's because we no longer specify lots of extra attributes just for this prometheus test. The test is focused just on did prometheus serve up a result and did it look OK.

Extra attributes are still tested in the new tests that use the testing macros, such as: test_supergraph_metrics_ok

---
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="+Inf"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.001"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.005"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.015"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.05"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.1"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.2"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.3"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.4"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="0.5"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="1"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="10"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="5"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="+Inf"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.001"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.005"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.015"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.05"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.1"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.2"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.3"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.4"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="0.5"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="1"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="10"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="5"} 1
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
source: apollo-router/src/plugins/telemetry/mod.rs
expression: prometheus_metrics
---
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="+Inf"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="10"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="20"} 1
apollo_router_http_requests_duration_bucket{status="200",otel_scope_name="apollo/router",le="5"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="+Inf"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="10"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="20"} 1
apollo_router_http_request_duration_seconds_bucket{status="200",otel_scope_name="apollo/router",le="5"} 1