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

[BUG] metrics with utf8 strings in path are not displayed #2641

Open
mcikosos opened this issue Oct 18, 2020 · 15 comments
Open

[BUG] metrics with utf8 strings in path are not displayed #2641

mcikosos opened this issue Oct 18, 2020 · 15 comments

Comments

@mcikosos
Copy link

mcikosos commented Oct 18, 2020

Describe the bug
metrics with utf8 strings in path are not displayed in graphs

To Reproduce
just send any metric with national chars in it

ex.
echo "local.random.gówno 5 date +%s" | nc ${SERVER} ${PORT}

Expected behavior
metrics show in graphs

Screenshots
no point

Environment (please complete the following information):

  • OS flavor: Ubuntu
  • Graphite-web version: latest docker - graphiteapp/graphite-statsd
  • Django/Python version: latest docker - graphiteapp/graphite-statsd
  • Setup type latest docker - graphiteapp/graphite-statsd
@mcikosos mcikosos added the bug label Oct 18, 2020
@mcikosos mcikosos changed the title [BUG] [BUG] metrics with utf8 strings in path are not showing Oct 18, 2020
@mcikosos
Copy link
Author

mcikosos commented Oct 18, 2020

When I change metric path in graphite web - using edit to change it to 'local.random.g?wno' - the data are shown

@deniszh
Copy link
Member

deniszh commented Oct 18, 2020

Hi @mcikosos ,

IIRC UTF-8 characters can work in tags names/values (because tags are hashed internally), but UTF-8 support in metrics itself is depending on your OS / filesystem setup. I mean, I'm not saying that's not a bug - and if someone can solve it in generic and backward compatible way - I would be very glad.

@piotr1212
Copy link
Member

I found a few issues with unicode chars in Graphite-web, carbon on the other hand does work.

This fixes two piotr1212@17e23ef but I never got around of making a PR. I think there was also one in the carbonlink code. And last, the images rendering code cannot handle unicode (metricnames in the legenda). The last one is the hardest to fix but probably the least important one. There is probably some more, potential places to look are str() calls

@mcikosos
Copy link
Author

IIRC UTF-8 characters can work in tags names/values (because tags are hashed internally), but UTF-8 support in metrics itself is depending on your OS / filesystem setup. I mean, I'm not saying that's not a bug - and if someone can solve it in generic and backward compatible way - I would be very glad.

Well I thought it is a BUG because carbon/whisper etc. works ok but if it was not supported from the start I can change it to "feature" ;)

@mcikosos mcikosos changed the title [BUG] metrics with utf8 strings in path are not showing [BUG] metrics with utf8 strings in path are not displayed Oct 18, 2020
@mcikosos
Copy link
Author

@piotr1212 can You make a PR? So some day it will be merged to master.

@piotr1212
Copy link
Member

Sorry, I don't expect to anytime soon.

@deniszh
Copy link
Member

deniszh commented Oct 19, 2020

Oh, cool, I didn't know that, @piotr1212 !
PR is welcome ofc, I will pick this up if nobody else.

@deniszh
Copy link
Member

deniszh commented Oct 22, 2020

@mcikosos : Fix is merged in master. UTF8_METRICS should be enabled in config (disabled by default because of possible negative performance consequences).

@mcikosos
Copy link
Author

I will check this ASAP

@stale
Copy link

stale bot commented Dec 21, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 21, 2020
@mcikosos
Copy link
Author

Issue still exists
I have graphiteapp/graphite-statsd:master
GRAPHITE_UTF8_METRICS=true in env
and still no data for metrics with utf8 chars :(

@deniszh
Copy link
Member

deniszh commented Dec 31, 2020 via email

@mcikosos
Copy link
Author

mcikosos commented Dec 31, 2020

example which does not work: home.Piętro.Suszarnia.Pralka.energy
when I change to home.Pi?tro.Suszarnia.Pralka.energy data are shown
I will try the example from the description to see if it works on my instance

@mcikosos
Copy link
Author

mcikosos commented Jan 1, 2021

I tested with test.random.pokój and no data is shown for that exact metric

@deniszh
Copy link
Member

deniszh commented Jan 1, 2021

@mcikosos : Yes, you're right. Looks like some part still missing. I see data coming but rendering part is not working, not in curl nor in browser. :(

%curl 'http://localhost/render/?target=test.random.pokój&format=json&from=-1min'
[]

but

% curl 'http://localhost/render/?target=test.random.pok?j&format=json&from=-1min'
[{"target": "test.random.pok\u00f3j", "tags": {"name": "test.random.pok\u00f3j"}, "datapoints": [[null, 1609532390], [null, 1609532400], [null, 1609532410], [null, 1609532420], [null, 1609532430], [null, 1609532440]]}]

Encoding URL not helping either (I think curl and browser dong that anyway):

[dzhdanov:~] % curl 'http://localhost/render/?target=test.random.pok%C3%B3j&format=json&from=-1min'
[]%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants