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: centralize metric counter to observability package #1213

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

J0
Copy link
Contributor

@J0 J0 commented Aug 8, 2023

  • Move metric counter to observability package so that we can reuse it to track other metrics
  • Rename NetlifyMicroserviceClaims to AuthMicroserviceClaims

Supports the email rate limit task

@J0 J0 requested a review from a team as a code owner August 8, 2023 08:31
@J0 J0 merged commit dbee2fe into master Aug 8, 2023
@J0 J0 deleted the j0/refactor_metric_counter_location branch August 8, 2023 16:28
J0 added a commit that referenced this pull request Aug 8, 2023
## What kind of change does this PR introduce?

This PR aims to expose a set of email rate limit metrics as a Prometheus
metric that can then be consumed by an alerting system like Prometheus.
When a rate limit is triggered we increment a counter. This can then be
passed to a monitoring system such as Prometheus alert manager which can
fire off a notification (or similar) when a threshold (say 5 occurrences
in an hour) has been breached.

Extends: #1213 


The presence of the metric was tested via using the default
`prometheus.yml` file that comes on download. To test that the rate
limit is firing, we decreased `GOTRUE_RATE_LIMIT_EMAIL_SENT="5"` to 5
and ran `ab` against the endpoint like

`ab -p mass_signup.txt -T application/json -c 10 -n 50
http://localhost:9999/otp`

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

🎉 This PR is included in version 2.92.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

uxodb pushed a commit to uxodb/auth that referenced this pull request Nov 13, 2024
…e#1213)

- Move metric counter to observability package so that we can reuse it
to track other metrics
- Rename `NetlifyMicroserviceClaims` to `AuthMicroserviceClaims`


Supports the email rate limit task

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
uxodb pushed a commit to uxodb/auth that referenced this pull request Nov 13, 2024
## What kind of change does this PR introduce?

This PR aims to expose a set of email rate limit metrics as a Prometheus
metric that can then be consumed by an alerting system like Prometheus.
When a rate limit is triggered we increment a counter. This can then be
passed to a monitoring system such as Prometheus alert manager which can
fire off a notification (or similar) when a threshold (say 5 occurrences
in an hour) has been breached.

Extends: supabase#1213 


The presence of the metric was tested via using the default
`prometheus.yml` file that comes on download. To test that the rate
limit is firing, we decreased `GOTRUE_RATE_LIMIT_EMAIL_SENT="5"` to 5
and ran `ab` against the endpoint like

`ab -p mass_signup.txt -T application/json -c 10 -n 50
http://localhost:9999/otp`

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 13, 2024
…e#1213)

- Move metric counter to observability package so that we can reuse it
to track other metrics
- Rename `NetlifyMicroserviceClaims` to `AuthMicroserviceClaims`


Supports the email rate limit task

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 13, 2024
## What kind of change does this PR introduce?

This PR aims to expose a set of email rate limit metrics as a Prometheus
metric that can then be consumed by an alerting system like Prometheus.
When a rate limit is triggered we increment a counter. This can then be
passed to a monitoring system such as Prometheus alert manager which can
fire off a notification (or similar) when a threshold (say 5 occurrences
in an hour) has been breached.

Extends: supabase#1213 


The presence of the metric was tested via using the default
`prometheus.yml` file that comes on download. To test that the rate
limit is firing, we decreased `GOTRUE_RATE_LIMIT_EMAIL_SENT="5"` to 5
and ran `ab` against the endpoint like

`ab -p mass_signup.txt -T application/json -c 10 -n 50
http://localhost:9999/otp`

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 15, 2024
…e#1213)

- Move metric counter to observability package so that we can reuse it
to track other metrics
- Rename `NetlifyMicroserviceClaims` to `AuthMicroserviceClaims`


Supports the email rate limit task

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 15, 2024
## What kind of change does this PR introduce?

This PR aims to expose a set of email rate limit metrics as a Prometheus
metric that can then be consumed by an alerting system like Prometheus.
When a rate limit is triggered we increment a counter. This can then be
passed to a monitoring system such as Prometheus alert manager which can
fire off a notification (or similar) when a threshold (say 5 occurrences
in an hour) has been breached.

Extends: supabase#1213 


The presence of the metric was tested via using the default
`prometheus.yml` file that comes on download. To test that the rate
limit is firing, we decreased `GOTRUE_RATE_LIMIT_EMAIL_SENT="5"` to 5
and ran `ab` against the endpoint like

`ab -p mass_signup.txt -T application/json -c 10 -n 50
http://localhost:9999/otp`

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants