graphite-web icon indicating copy to clipboard operation
graphite-web copied to clipboard

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

Open mcikosos opened this issue 5 years ago • 15 comments

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 avatar Oct 18 '20 17:10 mcikosos

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

mcikosos avatar Oct 18 '20 17:10 mcikosos

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.

deniszh avatar Oct 18 '20 18:10 deniszh

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

This fixes two https://github.com/piotr1212/graphite-web/commit/17e23efecb6cb40059264fabd3ea36718065176e 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

piotr1212 avatar Oct 18 '20 19:10 piotr1212

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 avatar Oct 18 '20 21:10 mcikosos

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

mcikosos avatar Oct 18 '20 21:10 mcikosos

Sorry, I don't expect to anytime soon.

piotr1212 avatar Oct 19 '20 07:10 piotr1212

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

deniszh avatar Oct 19 '20 09:10 deniszh

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

deniszh avatar Oct 22 '20 16:10 deniszh

I will check this ASAP

mcikosos avatar Oct 22 '20 19:10 mcikosos

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[bot] avatar Dec 21 '20 20:12 stale[bot]

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

mcikosos avatar Dec 30 '20 16:12 mcikosos

Hello,

I’m afraid we will need exact metrics names to check, because simple tests (built in and test run) shows that setting works.

On Wed, 30 Dec 2020 at 17:20, mcikosos [email protected] wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/graphite-project/graphite-web/issues/2641#issuecomment-752678729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJLTVTEF32K2B3AVR4J65TSXNHL7ANCNFSM4SVG5YOQ .

deniszh avatar Dec 31 '20 08:12 deniszh

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 avatar Dec 31 '20 15:12 mcikosos

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

mcikosos avatar Jan 01 '21 19:01 mcikosos

@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'
[]%

deniszh avatar Jan 01 '21 20:01 deniszh