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

Validation doesn't work for tagged metrics #410

Open
ihard opened this issue Apr 15, 2020 · 6 comments
Open

Validation doesn't work for tagged metrics #410

ihard opened this issue Apr 15, 2020 · 6 comments

Comments

@ihard
Copy link

ihard commented Apr 15, 2020

build from latest master
With

match *
    validate ^[0-9.e+-]+\ [0-9.e+-]+$ else drop
    ;

test metric

echo "test_metric;instance=hostname1;env=dev 30 `date +%s`" >/dev/tcp/127.0.0.1/2003

go to dev null
if comment section

#match *
#    validate ^[0-9.e+-]+\ [0-9.e+-]+$ else drop
#    ;

the metric successfully enters the storage and is visible in Grafana

@grobian
Copy link
Owner

grobian commented Apr 17, 2020

your validation rule requires a space, isn't it to be expected that no metric will match that?

@ihard
Copy link
Author

ihard commented Apr 17, 2020

Doesn't the validation expression only check the value?
The verification expression is taken from the documentation.
Metrics without tags pass verification successfully.

echo "test.metric 30 `date +%s`" >/dev/tcp/127.0.0.1/2003

@grobian
Copy link
Owner

grobian commented Apr 22, 2020

Right you are, I'm obviously not remembering well any more. I stand corrected.

@grobian
Copy link
Owner

grobian commented Apr 22, 2020

I'm not sure if you use tags or not, but I have a hunch that if you add ; to the allowed chars setting, it will work as expected. Tag support basically hides the tag from the routing model, but also breaks validation in this way.

@ihard
Copy link
Author

ihard commented Apr 22, 2020

It really helped, thank you. It wasn't quite obvious.
I use tags in metrics and I was confused by this description of the release:

3.3 (23-03-2018)
dispatcher tags support was added, it is only activated when the
; character is not in the list of allowed characters (-c flag).
Note that by default this character is not allowed, hence tags support
enabled.

With the
-c -_=;
option, tagged metrics work in version 3.6.

@grobian
Copy link
Owner

grobian commented Apr 23, 2020

I think eventually this is very similar to #398: we need something to validate tags I think.

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

No branches or pull requests

2 participants