Repository navigation
fix(metrics): Enforce metric name length limit [INGEST-1205] - #1238
Conversation
|
|
||
| let key = key | ||
| .validate_name(&self.config) | ||
| .map_err(|()| AggregateMetricsError)?; |
There was a problem hiding this comment.
Please double check my reasoning, but I think returning an AggregateMetricsError here causes the entire batch of buckets to fail:
relay/relay-metrics/src/aggregation.rs
Lines 1134 to 1143 in 043479f
Not sure what the best solution is, either swallow the error here or change merge_all to swallow the error there.
There was a problem hiding this comment.
ah right. fwiw that bogus code came from https://github.com/getsentry/relay/pull/1235/files#diff-9bce334fb404ce42d375eab0d36d6bb5d79f4d373c8c92c02f8a70dfea0cc1d8R1083
i'm gonna play around with this a bit and see
|
I'll wait for #1235 to be merged, because of the dropping buckets fix and some refactoring on validation logic (readability + reduce code duplication). |
untitaker
left a comment
There was a problem hiding this comment.
feel free to merge after fixing the comment
The more checks a BucketKey has the more overwhelmed the method would be. Separated into smaller and more concise methods. The metric name is validated first because failing means dropping the bucket. Tags are checked afterward.
This option defines the maximum length of a metric, not the length of the tags' keys and values. Since this value is going to be used mostly to compare strings, making it `usize` instead of any other integer size, for convenience.
569b716 to
5fa5085
Compare
Instructions and example for changelogFor changes exposed to the Python package, please add an entry to For changes to the Relay server, please add an entry to
To the changelog entry, please add a link to this PR (consider a more descriptive message): - Enforce metric name length limit. ([#1238](https://github.com/getsentry/relay/pull/1238))If none of the above apply, you can opt out by adding #skip-changelog to the PR description. |
* master: fix(metrics): Enforce metric name length limit (#1238)
* master: fix(metrics): Enforce metric name length limit (#1238)
Discard metrics with too-long names before aggregating them to buckets. A metric name and its tags' keys and values are too long if they exceed the 200-byte threshold.
These limits are configurable in the
config.yml: