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

Unicode handling issue in vmselect #613

Closed
zcavaliero opened this issue Jul 8, 2020 · 5 comments
Closed

Unicode handling issue in vmselect #613

zcavaliero opened this issue Jul 8, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@zcavaliero
Copy link

I have an issue where prometheus has a label that has a unicode character in it and when grafana pulls the data from promtheus, promtheus handles the conversion. When I do the same query with the vmselect in grafana, the unicode character is not handled the same and returns and error in grafana.

Examples of json returned:

Prometheus result:
{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"cf_application_info","application_id":"foo_bar","application_name":"foo_bar","buildpack":"client-certificate-mapper=1.11.0_RELEASE container-security-provider=1.16.0_RELEASE java-buildpack=\u001b[34mv4.25\u001b[0m-offline-https://github.com/cloudfoundry/java-buildpack.git#349e93b java-main java-opts java-security jvmkill-agent=1.16.0_RELEASE open-jdk...","deployment":"cf","detected_buildpack":"client-certificate-mapper=1.11.0_RELEASE container-security-provider=1.16.0_RELEASE java-buildpack=\u001b[34mv4.25\u001b[0m-offline-https://github.com/cloudfoundry/java-buildpack.git#349e93b java-main java-opts java-security jvmkill-agent=1.16.0_RELEASE open-jdk...","env":"prod","environment":"foo_bar","instance":"foo_bar:443","job":"cf_exporter","organization_id":"foo_bar","organization_name":"foo_bar","space_id":"foo_bar","space_name":"instances","stack_id":"foo_bar,"state":"STARTED"},"value":[1,"1"]}]}}

vmselect result:
{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"cf_application_info","application_id":"foo_bar","application_name":"foo_bar","buildpack":"client-certificate-mapper=1.11.0_RELEASE container-security-provider=1.16.0_RELEASE java-buildpack=�[34mv4.25�[0m-offline-https://github.com/cloudfoundry/java-buildpack.git#349e93b java-main java-opts java-security jvmkill-agent=1.16.0_RELEASE open-jdk...","deployment":"cf","detected_buildpack":"client-certificate-mapper=1.11.0_RELEASE container-security-provider=1.16.0_RELEASE java-buildpack=�[34mv4.25�[0m-offline-https://github.com/cloudfoundry/java-buildpack.git#349e93b java-main java-opts java-security jvmkill-agent=1.16.0_RELEASE open-jdk...","env":"prod","environment":"foo_bar","instance":"foo_bar:443","job":"cf_exporter","organization_id":"foo_bar","organization_name":"foo_bar","space_id":"foo_bar","space_name":"instances","stack_id":"foo_bar","state":"STARTED"},"value":[1,"1"]}]}}

@valyala valyala added the bug Something isn't working label Jul 8, 2020
valyala added a commit to valyala/quicktemplate that referenced this issue Jul 10, 2020
Updates VictoriaMetrics/VictoriaMetrics#613

Previously such char codes couldn't be parsed by JSON parsers.
valyala added a commit that referenced this issue Jul 10, 2020
This should fix incorrect encoding for json strings with char codes below 0x20

Updates #613
valyala added a commit that referenced this issue Jul 10, 2020
This should fix incorrect encoding for json strings with char codes below 0x20

Updates #613
@valyala
Copy link
Collaborator

valyala commented Jul 10, 2020

The issue must be fixed in the following commits:

@zcavaliero , could you build VictoriaMetrics from these commits according to the following docs and verify whether the issue is fixed there?

@zcavaliero
Copy link
Author

@valyala Can I just build the vmselect or do I need to build all three?

@zcavaliero
Copy link
Author

zcavaliero commented Jul 10, 2020

@valyala Nevermind, I just tested vmselect and everything looks good!!

{"status":"success","data":{"resultType":"vector","result":[{"metric":{"name":"cf_application_info","application_id":"foo_bar","application_name":"foo_bar","buildpack":"client-certificate-mapper=1.11.0_RELEASE container-security-provider=1.16.0_RELEASE java-buildpack=\u001b[34mv4.25\u001b[0m-offline-https://github.com/cloudfoundry/java-buildpack.git#349e93b java-main java-opts java-security jvmkill-agent=1.16.0_RELEASE open-jdk...","deployment":"cf","detected_buildpack":"client-certificate-mapper=1.11.0_RELEASE container-security-provider=1.16.0_RELEASE java-buildpack=\u001b[34mv4.25\u001b[0m-offline-https://github.com/cloudfoundry/java-buildpack.git#349e93b java-main java-opts java-security jvmkill-agent=1.16.0_RELEASE open-jdk...","env":"foo_bar","environment":"foo_bar","instance":"foo_bar:443","job":"foo_bar","organization_id":"foo_bar","organization_name":"foo_bar","space_id":"foo_bar","space_name":"instances","stack_id":"foo_bar","state":"STARTED"},"value":[1,"1"]}]}}

Will this get put into an official release?

Also, thank you so much for the speedy response and fix!!

@valyala
Copy link
Collaborator

valyala commented Jul 13, 2020

Will this get put into an official release?

Yes, the bugfix will be included in the next release. Thanks for the testing!

@valyala
Copy link
Collaborator

valyala commented Jul 14, 2020

@zcavaliero , the bugfix has been included in v1.38.1 release of VictoriaMetrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants