Skip to content

Simplify query logs#107

Merged
Theodus merged 2 commits intomainfrom
theodus/logs
Jan 26, 2022
Merged

Simplify query logs#107
Theodus merged 2 commits intomainfrom
theodus/logs

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented Jan 25, 2022

Previously, the logs used for data science and production investigations were spread across "client query result", "indexer query result", and the indexer_response_err fields. This collects all this information throughout the lifecycle of a query. When a response is returned to the client, there will now be a singe "Client query result" event, and a set of "Indexer attempt" events. Logs for ISA scoring remain separate.

@That3Percent That3Percent requested review from goaaron and removed request for Jannis and That3Percent January 25, 2022 20:03
) {
tracing::info!(
ray_id = %query.ray_id,
query_id = %query.id,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that query_id and ray_id are going to be doing the same job?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can remove the query_id later

QueryEngineError::FeesTooHigh(count) => {
format!("No suitable indexer found, {} indexers requesting higher fees for this query", count)
}
QueryEngineError::MissingBlock(_) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

For sake of logging these can be status codes I think.

indexer_query: &IndexerQuery,
indexer: &Address,
allocation: &Address,
indexer_query: &str,
Copy link
Contributor

Choose a reason for hiding this comment

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

how is indexer_query different from plain query?

) -> Result<QueryResponse, QueryEngineError> {
) -> Result<(), QueryEngineError> {
use QueryEngineError::*;
let subgraph = query.subgraph.as_ref().unwrap().clone();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you just use query as the sole function argument?

Previously, the logs used for data science and production investigations
were spread across "client query result", "indexer query result", and
the `indexer_response_err` fields. This collects all this information
throughout the lifecycle of a query. When a response is returned to the
client, there will now be a singe "Client query result" event, and a set
of "Indexer attempt" events. Logs for ISA scoring remain separate.
@Theodus Theodus merged commit a5ab269 into main Jan 26, 2022
@Theodus Theodus deleted the theodus/logs branch January 26, 2022 17:19
@Theodus Theodus mentioned this pull request Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants