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

Add hook to GetRateLimit #31

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Baliedge
Copy link
Collaborator

@Baliedge Baliedge commented Oct 17, 2024

This PR implements a generalized hook into rate limit hits by providing a unidirectional channel to receive request/response data. The initial use case is to implement Prometheus metrics to monitor status of high value rate limit name/key pairs.

The user will populate Config.EventChannel with a channel and implement goroutine(s) to read from the channel. An event is triggered when a rate limit hit is applied at its owner peer and request/response structures are sent to the channel.

This is intended to work for all peering behaviors: batching, non-batching, and global.

Other auxiliary changes:

  • Upgrade golangci-lint to latest.
  • Update GitHub Actions in workflows.
  • Remove redundant call to golangci-lint in on-pull-request workflow.
  • cluster.StartWith() extended with options arguments to add support for EventChannel.

@Baliedge Baliedge marked this pull request as ready for review October 17, 2024 14:19
Copy link
Collaborator

@thrawn01 thrawn01 left a comment

Choose a reason for hiding this comment

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

LGTM! I'm assuming you are trying to track down a customer who is abusing the system?

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