Skip to content

Commit

Permalink
Fix monotonic counter type (#3723)
Browse files Browse the repository at this point in the history
This fixes a bug where you would encounter error logs: monotonic counter
must be u64 or f64. This metric will be ignored.
  • Loading branch information
o0Ignition0o authored Sep 1, 2023
2 parents a6e2a2a + 59d2c27 commit 60a72f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apollo-router/src/plugins/authentication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
2 changes: 1 addition & 1 deletion apollo-router/src/query_planner/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion apollo-router/src/query_planner/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 60a72f9

Please sign in to comment.