-
Notifications
You must be signed in to change notification settings - Fork 3
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
QueryAPI Logging Features + UI/UX changes #388
Conversation
</ButtonGroup> | ||
</Col> | ||
</Row> | ||
{debugMode && heights.length > 0 && ( |
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.
In a future PR will add feature to add blocks to debug mode directly from the indexer logs table
c7e2d38
to
22aeec1
Compare
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.
These are awesome changes! I think they address a lot of the friction points of the indexer logs. Just have two questions about the changes.
|
||
const processLogs = (data) => { | ||
const logEntries = data.indexer_log_entries.map((row) => ({ | ||
block_height: row.block_height, |
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.
Just to confirm, if the indexer is stuck on a block and it replays the block again and again in that state, will the logs show multiple rows with the same block height? Or merge them all under one block height?
This parlays into my next question. If the block heights do get repeated, then is there any value in having timestamps for each log? Each block height would correspond to a single runner execution, so logs would be quite close to each other.
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.
It would merge all attempted execution logs of a block under one entry. So for block x, you could see multiple duplicate logs signifying that it had been attempted multiple times.
This is the reason why the timestamps exist. To be able to get a mental model of how long each block invocation took
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.
Ahh I see. I think that's fine, as long as all the logs inside the block are still ordered by timestamp. Maybe we can take a look at existing blocked indexers and see what the experience looks like.
This PR addresses a few painpoints of logging and QueryAPI Indexer development.
Logs can now be seen through the QueryAPI editor window via a
Show Logs
button.- No need to switch between
Indexer Status
&Editor
window anymore saving time and frustration with the editor taking a few seconds to load.- Enables more powerful integrations with the editor for future PRs (e.g: adding blocks to debug directly from the indexer Logs table)
Logs are easier to digest now and search now.
- Logs are grouped by
block_height
so now the user sees all the messages belonging to a block's execution together.- Additionally the user can use the
search
functionality to search for any block_height where the function was executed to view its log in entirety.- Logs have relative dates now e.g (4 mins ago...)
- BlockHeights can be clicked on to take you to the explorer link
Simplifying QueryAPI links.
- There is no need for
&view=status/editor-window
to be passed in anymore.- As long as
selectedIndexerPath
is defined, the user is sent to the editor window. If&view=status
is passed the user is redirected to the indexer logs page within the editor window.- Note: I have a PR on
queryapi/docs
to reflect these changes: chore: change links to reflect changes on queryapi docs#1584Notes: Instead of using GraphQL to fetch logs, we are using a feature of Hasura which
restifies
your graphql queries.You can find details here: https://near-queryapi.api.pagoda.co/console/api/rest/list
Other small updates
This PR does not add WS support. This will be done in a future PR.