Repository navigation
fix(quotas): Correct reporting of rate limits for transactions - #1555
Merged
Merged
Conversation
jan-auer
commented
Oct 27, 2022
| }); | ||
|
|
||
| if enforcement.event_metrics_active() { | ||
| state.extracted_metrics.clear(); |
Member
Author
There was a problem hiding this comment.
This was introduced in #1537, but it is now dead code. Metrics will always be extracted at this point, and as such event_metrics_active can never be true.
This is not a problem, since the extracted metrics will be sent to the project cache and be dropped there. Over there, we have proper outcome logging for metrics implemented. It's an unnecessary indirection, but is the smallest change to get this consistent and working.
jan-auer
commented
Oct 27, 2022
|
|
||
| assert!(limits.is_limited()); | ||
| assert!(enforcement.event_metrics.is_active()); | ||
| assert!(!enforcement.event_metrics.is_active()); |
Member
Author
There was a problem hiding this comment.
This change is intentional. We don't want an enforcement -- and not record outcomes -- if metrics had been extracted already. The outcome would be logged somewhere else.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #1537 Relay started to under-report outcomes for rate limited transactions.
The root cause is that
Enforcementwas not updated to emit outcomes formetrics.
This reveals that enforcements for metrics should be recorded only if metrics
have not been extracted from a transaction item yet. In this case, metrics can
still be considered part of the transaction item and as such an outcome is
needed. In contrast, once metrics have been extracted, responsibility for
recording outcomes is moved to the recipient of metrics.