-
Notifications
You must be signed in to change notification settings - Fork 235
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
allow multiple dashes in StatsD metric names #381
Conversation
There is a test that specifically said "double dashes are illegal" – it is intended to exercise a case that doesn't match this regex. Could you change it to use some other illegal character? |
Also, please add the DCO sign-off, instructions are behind the Details link |
It might also be useful to add a positive test like this: (line 1467) {
testName: "Config with multiple dashes",
config: `mappings:
- match: "*.fabio--requests.count"
name: "fabio_requests_count"
help: "Fabio request count"
labels:
hostname: "$1"`,
mappings: mappings{
{
statsdMetric: "test.fabio--requests.count",
name: "fabio_requests_count",
labels: map[string]string{
"hostname": "test",
},
},
},
}, }, |
cb2f338
to
e18c638
Compare
Signed-off-by: Evan Van Dam <[email protected]>
e18c638
to
abb7ec0
Compare
Something I am wondering: what happens if we accept a statsd metric with |
In my super quick testing it seems like it gets dropped if there's no mapping:
A mapping for
It seems reasonable enough to me but it's up to you folks! |
Hmm, but for metrics with a single dash there is an automatic mapping. It will be very confusing to users if some metrics are mapped automatically but others are not. Do you feel up to extending the metric name escaping so that it handles this input? |
Hey @matthiasr,it sounds like you folks know better than me to get this over the line. I don't write Go either so maybe I'm not the best to handle this if there's more to it than is already done 😅 |
I created a new issue for handling the default case: #389. |
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.
Thank you, and sorry for holding it up for so long!
Signed-off-by: Matthias Rampke <[email protected]>
See #380
@matthiasr I don't do any Go development so not sure if there's anything else to consider here 😅
Thanks!