Skip to content
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

refactor: add reporting module to framework #673

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

Jannis
Copy link
Collaborator

@Jannis Jannis commented Apr 11, 2024

This moves all generalizable code dealing with logging, metrics and Kafka reporting into a reporting module inside the framework and refactors the existing gateway to use that.

What's good is that everything is generalizable, except for reporting client and indexer queries to Kafka, because the shape of these queries are specific to subgraphs. Therefor, the gateway now passes an event filter to the Kafka client to report any matching events with custom logic, which is defined via an event handler. This filtering and reporting was previously done inside the Kafka code, now it's customizable. That's all that really changes.

NOTE: I've tested that this still compiles, and I'm confident it doesn't break anything. But it may be worth testing locally or on testnet before rolling this out via a gateway release.

Copy link
Member

@Theodus Theodus left a comment

Choose a reason for hiding this comment

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

LGTM. Logs seem to be working locally.

gateway-framework/src/reporting/kafka.rs Outdated Show resolved Hide resolved
@Jannis Jannis merged commit 8374851 into main Apr 11, 2024
1 check passed
@Jannis Jannis deleted the jannis/framework-reporting branch April 11, 2024 18:33
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