Skip to content

Conversation

@jnschaeffer
Copy link
Contributor

What kind of change does this PR introduce?

This PR adds two new metrics, gotrue_email_send_operations_counter_total and gotrue_email_send_errors_counter_total, for tracking email send operations and errors respectively. The purpose of these metrics is to track email delivery independently of the various API handlers that may send email within Auth.

What is the current behavior?

Users who want to track email sending operations in Auth must use indirect metrics like HTTP status codes to determine whether an email was successfully sent.

What is the new behavior?

The gotrue_email_send_operations_counter_total counter will increment each time Auth attempts to send an email after performing validation and checking rate limits. The gotrue_email_send_errors_counter_total counter will increment each time an email send attempt fails.

This commit adds two new metrics,
gotrue_email_send_operations_counter_total and
gotrue_email_send_errors_counter_total, for tracking email send
operations and errors respectively. The purpose of these metrics is to
track email delivery independently of the various API handlers that
may send email within Auth.
@jnschaeffer jnschaeffer requested a review from a team as a code owner January 2, 2026 20:26
@coveralls
Copy link

coveralls commented Jan 2, 2026

Pull Request Test Coverage Report for Build 21297341599

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 7 (28.57%) changed or added relevant lines in 1 file are covered.
  • 648 unchanged lines in 14 files lost coverage.
  • Overall coverage increased (+0.04%) to 68.819%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/mail.go 2 7 28.57%
Files with Coverage Reduction New Missed Lines %
internal/api/samlacs.go 3 3.82%
internal/api/pkce.go 8 79.71%
internal/api/sso.go 14 70.18%
internal/models/flow_state.go 18 80.0%
internal/api/context.go 22 77.71%
internal/api/oauthserver/auth.go 26 0.0%
internal/api/oauthserver/service.go 29 77.06%
internal/models/oauth_client.go 31 73.23%
internal/api/middleware.go 39 76.65%
internal/api/verify.go 39 75.6%
Totals Coverage Status
Change from base Build 20599680500: 0.04%
Covered Lines: 14849
Relevant Lines: 21577

💛 - Coveralls

@jnschaeffer jnschaeffer enabled auto-merge (squash) January 2, 2026 21:14
@jnschaeffer jnschaeffer requested a review from cstockton January 23, 2026 18:45
@jnschaeffer jnschaeffer merged commit 0096575 into master Jan 23, 2026
5 of 6 checks passed
@jnschaeffer jnschaeffer deleted the feat/add-email-metrics branch January 23, 2026 21:51
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.

4 participants