-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create metrics to track block ingestion and GraphQL query execution #1403
Conversation
chain/ethereum/src/block_ingestor.rs
Outdated
@@ -115,6 +147,10 @@ where | |||
LogCode::BlockIngestionStatus | |||
}; | |||
if distance > 0 { | |||
self.ingestor_metrics.observe_blocks_synced( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the right place IMHO. At this point we have't written the block to our db yet, so as far as our system is concerned, we are not up to date with the chain yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the right place would be an inspect
here: https://github.com/graphprotocol/graph-node/pull/1403/files#diff-dc8c393601039a99522fbd9bdd37b8dbR233-R235
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow how that would work. Also generally, it is tricky because ingest_blocks()
will get called again for any missing blocks.
What about observing the chain_head_number
from the ChainHeadUpdateListener
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that idea!
801f0b6
to
0a08711
Compare
512085d
to
7ee9d96
Compare
This PR creates two new metrics structs for instrumenting the Block Ingestor and the GraphQL server.
BlockIngestorMetrics
with a gauge vec to track the number of blocks being synced from Ethereum, labeled by networks name.GraphQLServiceMetrics
which includes a histogram vec for tracking query execution time of successful queries, labeled by subgraph deployment id.