From 830b3041a99068290dcd8c728f134b3ea324558e Mon Sep 17 00:00:00 2001 From: Theo Butler Date: Wed, 7 Dec 2022 14:46:29 -0500 Subject: [PATCH] Fix reports --- graph-gateway/src/client_query.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/graph-gateway/src/client_query.rs b/graph-gateway/src/client_query.rs index d41630ae..28e6bc23 100644 --- a/graph-gateway/src/client_query.rs +++ b/graph-gateway/src/client_query.rs @@ -237,6 +237,8 @@ async fn handle_client_query_inner( payload: QueryBody, domain: String, ) -> anyhow::Result { + report.network = subgraph_info.network.clone(); + let api_key = ctx .api_keys .value_immediate() @@ -443,6 +445,12 @@ async fn handle_client_query_inner( ); } + report.fee = selections + .iter() + .map(|s| &s.fee) + .fold(GRT::zero(), |sum, fee| sum + *fee) + .as_f64(); + let mut indexer_query_context = IndexerQueryContext { indexer_client: ctx.indexer_client.clone(), kafka_client: ctx.kafka_client.clone(), @@ -590,9 +598,9 @@ async fn handle_indexer_query( fee = ctx.report.fee, blocks_behind = ctx.report.blocks_behind, indexer_errors = %ctx.report.indexer_errors, - response_time_ms = %ctx.report.response_time_ms, + response_time_ms = ctx.report.response_time_ms, status = %ctx.report.status, - status_code = %ctx.report.status_code, + status_code = ctx.report.status_code, "Indexer attempt", );