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

Removed the lazy static from the prometheus metrics #286

Merged
merged 2 commits into from
Apr 9, 2024
Merged

Conversation

adam-cattermole
Copy link
Member

@adam-cattermole adam-cattermole commented Apr 5, 2024

Removes the lazy static reference to prometheus metrics and uses an Arc instead. This solves the issue with updating the use_limit_name_label on limited calls (resulting in a internal server error 500) as it's now initialised correctly.

The http server now uses a RateLimitData struct that contains the metrics and the limiter.

@adam-cattermole adam-cattermole self-assigned this Apr 5, 2024
@adam-cattermole adam-cattermole marked this pull request as ready for review April 5, 2024 15:47
Copy link
Member

@alexsnaps alexsnaps left a comment

Choose a reason for hiding this comment

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

Tainted... but LGTM 🤣
@eguzki maybe?

@alexsnaps alexsnaps requested a review from eguzki April 9, 2024 11:21
@eguzki eguzki merged commit ae41cd9 into main Apr 9, 2024
21 checks passed
@eguzki eguzki deleted the no_lazy_static branch April 9, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants