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

Merged
merged 9 commits into from
Oct 21, 2024
Merged

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?

@Baliedge
Copy link
Collaborator Author

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

More like fine tuning existing rate limit policy, but need to know how close to the limit current big customers are running at.

@Baliedge Baliedge merged commit 7c6030c into gubernator-io:master Oct 21, 2024
4 checks passed
@Baliedge Baliedge deleted the Baliedge/metrics2 branch October 21, 2024 14: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