-
Notifications
You must be signed in to change notification settings - Fork 93
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
ref(server): Add a dedicated metric for transaction usage #2571
Conversation
This is ready for review while I fix integration tests. |
tags: TransactionDurationTags { | ||
has_profile: self.has_profile, | ||
has_profile: self.has_profile, // TODO: Stop producing this in v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we still producing this tag until we update the consumers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no functional need to remove the tag, everything works correctly with and without the tag, but as @jjbayer pointed out we need to keep it until the consumers are fully updated.
buckets: Vec<Bucket>, | ||
quotas: Q, | ||
scoping: Scoping, | ||
usage: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usage
may be hard to understand outside this scope. What do you think about making this an enum of two variants (usage and transaction duration)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. The metrics rate limiter overall has a convoluted signature, so I chose the simplest change to follow up with a proper refactoring. I'm not yet sure about whether this should be an enum, the config, or something else, so I'd prefer to stick with the simplest choice. Would that work?
tags: TransactionDurationTags { | ||
has_profile: self.has_profile, | ||
has_profile: self.has_profile, // TODO: Stop producing this in v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to.
Adds a dedicated and cheap counter metric for usage tracking. It contains the
has_profile
tag, which will later be removed from the durations metric to lower its cardinality.This metric should improve the performance of all usage queries. In the long term, it allows to decouple product metrics from bookkeeping.