Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changesets/fix_renee_consistent_uplink_type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Fix inconsistent `type` attribute in `apollo.router.uplink.fetch.duration` metric ([PR #5816](https://github.com/apollographql/router/pull/5816))

The router now always reports a short name in the `type` attribute for the `apollo.router.fetch.duration` metric, instead of sometimes using a fully-qualified Rust path and sometimes using a short name.

By [@goto-bus-stop](https://github.com/goto-bus-stop) in https://github.com/apollographql/router/pull/5816
4 changes: 2 additions & 2 deletions apollo-router/src/uplink/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ where
tracing::info!(
histogram.apollo_router_uplink_fetch_duration_seconds =
now.elapsed().as_secs_f64(),
query = std::any::type_name::<Query>(),
query,
url = url.to_string(),
"kind" = "http_error",
error = e.to_string(),
Expand All @@ -441,7 +441,7 @@ fn query_name<Query>() -> &'static str {
let mut query = std::any::type_name::<Query>();
query = query
.strip_suffix("Query")
.expect("Uplink structs mut be named xxxQuery")
.expect("Uplink structs must be named xxxQuery")
.get(query.rfind("::").map(|index| index + 2).unwrap_or_default()..)
.expect("cannot fail");
query
Expand Down