From 59d2c2762512caf28fa5264cf16de5e5358d9636 Mon Sep 17 00:00:00 2001 From: o0Ignition0o Date: Fri, 1 Sep 2023 17:13:42 +0200 Subject: [PATCH] Fix monotonic counter type This fixes a bug where you would encounter error logs: monotonic counter must be u64 or f64. This metric will be ignored. --- apollo-router/src/plugins/authentication/mod.rs | 2 +- apollo-router/src/query_planner/execution.rs | 2 +- apollo-router/src/query_planner/fetch.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apollo-router/src/plugins/authentication/mod.rs b/apollo-router/src/plugins/authentication/mod.rs index 3fab8ed230..b90c814b7a 100644 --- a/apollo-router/src/plugins/authentication/mod.rs +++ b/apollo-router/src/plugins/authentication/mod.rs @@ -627,7 +627,7 @@ fn authenticate( monotonic_counter.apollo_authentication_success_count = 1u64, kind = %AUTHENTICATION_KIND ); - tracing::info!(monotonic_counter.apollo.router.operations.jwt = 1); + tracing::info!(monotonic_counter.apollo.router.operations.jwt = 1u64); return Ok(ControlFlow::Continue(request)); } diff --git a/apollo-router/src/query_planner/execution.rs b/apollo-router/src/query_planner/execution.rs index a97f0fc06c..0cb52f333f 100644 --- a/apollo-router/src/query_planner/execution.rs +++ b/apollo-router/src/query_planner/execution.rs @@ -76,7 +76,7 @@ impl QueryPlan { ) .await; if !deferred_fetches.is_empty() { - tracing::info!(monotonic_counter.apollo.router.operations.defer = 1); + tracing::info!(monotonic_counter.apollo.router.operations.defer = 1u64); } Response::builder().data(value).errors(errors).build() diff --git a/apollo-router/src/query_planner/fetch.rs b/apollo-router/src/query_planner/fetch.rs index 83509ee3be..41e2b233e3 100644 --- a/apollo-router/src/query_planner/fetch.rs +++ b/apollo-router/src/query_planner/fetch.rs @@ -290,7 +290,7 @@ impl FetchNode { self.response_at_path(parameters.schema, current_dir, paths, response); if let Some(id) = &self.id { if let Some(sender) = parameters.deferred_fetches.get(id.as_str()) { - tracing::info!(monotonic_counter.apollo.router.operations.defer.fetch = 1); + tracing::info!(monotonic_counter.apollo.router.operations.defer.fetch = 1u64); if let Err(e) = sender.clone().send((value.clone(), errors.clone())) { tracing::error!("error sending fetch result at path {} and id {:?} for deferred response building: {}", current_dir, self.id, e); }