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

stats: sanitize metric names #481

Merged
merged 2 commits into from
Jan 15, 2024
Merged

Conversation

wybczu
Copy link
Contributor

@wybczu wybczu commented Jan 12, 2024

If the configuration contains a key value with a : or |, e.g.

- key: path
  value: "/foo:*"
  rate_limit:
    unit: minute
    requests_per_unit: 20

the reported statsd metrics are malformed.

@wybczu wybczu force-pushed the luk/sanitize-stats-key branch from 6f15176 to c5723b4 Compare January 12, 2024 14:02
If the configuration contains a key value with a `:` or `|`, e.g.

```
- key: path
  value: "/foo:*"
  rate_limit:
    unit: minute
    requests_per_unit: 20
```

the reported statsd metrics are malformed.

Signed-off-by: Lukasz Szczesny <luk@wybcz.pl>
@wybczu wybczu force-pushed the luk/sanitize-stats-key branch from c5723b4 to 3c86472 Compare January 12, 2024 14:05
Copy link
Member

@ysawa0 ysawa0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense. Could we add some tests for this?

@wybczu
Copy link
Contributor Author

wybczu commented Jan 12, 2024

This makes sense. Could we add some tests for this?

Sure thing! I'll update the PR over the weekend.

Signed-off-by: Lukasz Szczesny <luk@wybcz.pl>
@wybczu
Copy link
Contributor Author

wybczu commented Jan 15, 2024

@ysawa0 I updated the PR.

@ysawa0 ysawa0 merged commit 763fd8e into envoyproxy:main Jan 15, 2024
6 checks passed
@wybczu wybczu deleted the luk/sanitize-stats-key branch January 16, 2024 13:34
timcovar pushed a commit to goatapp/ratelimit that referenced this pull request Jan 16, 2024
* stats: sanitize metric names

If the configuration contains a key value with a `:` or `|`, e.g.

```
- key: path
  value: "/foo:*"
  rate_limit:
    unit: minute
    requests_per_unit: 20
```

the reported statsd metrics are malformed.

Signed-off-by: Lukasz Szczesny <luk@wybcz.pl>

* Add tests

Signed-off-by: Lukasz Szczesny <luk@wybcz.pl>

---------

Signed-off-by: Lukasz Szczesny <luk@wybcz.pl>
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.

2 participants