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

Grafana Live: Unable to push strings with certain valid Unicode characters #67818

Open
Sh4pe opened this issue May 4, 2023 · 1 comment
Open
Labels
area/backend/api area/live triage/needs-confirmation used for OSS triage rotation - reported issue needs to be reproduced

Comments

@Sh4pe
Copy link

Sh4pe commented May 4, 2023

What went wrong?

What happened:

I'm pushing metrics to Grafana Live over WebSockets. These metrics contain strings. When the strings contain a form feed (U+000C) or carriage return (U+000D), the metrics are rejected. In the Grafana logs, I even see that the line protocol telegram appears to be truncated after the carriage return - the timestamp is left off, see my examples below.

Error log in case of form feed:

ERROR[05-04|10:05:02] Error converting metrics                 logger=live.push_ws error="error converting metrics: error parsing metrics: metric parse error: expected field at 1:17: \"something test=\\\"\\f\\\" 1681164826166000000\"" frameFormat=labels_column

Error log in case of carriage return:

ERROR[05-04|10:05:08] Error converting metrics                 logger=live.push_ws error="error converting metrics: error parsing metrics: metric parse error: expected field at 1:18: \"something test=\\\"\"" frameFormat=labels_column

I've tested this against both v9.1.5 and v9.5.1 (bc353e4).

What did you expect to happen:

I expect that Grafana Live can consume any metric containing valid UTF-8 strings. In case that is not possible, I expect the strict subset of UTF-8 that is supported by Grafana Live to be documented somewhere.

How do we reproduce it?

Step 1:

Establish WebSocket connection to Grafana Live instance.

Step 2:

Send either of these line protocol messages (generated with Python code):

websocket_messages = [
    f'something_metric some_string="{chr(12)}" 1681164826166000000',
    f'something_metric some_string="{chr(13)}" 1681164826166000000'
]

Step 3:

See the error logs for the rejection message.

What Grafana version are you using?

v9.1.5, v9.5.1 (bc353e4)

Optional Questions:

Is the bug inside a Dashboard Panel?

Copy the panel's "get-help" data here

Grafana Platform?

None

User's OS?

No response

User's Browser?

No response

Is this a Regression?

None

Are Datasources involved?

No response

Anything else to add?

No response

@tonypowa tonypowa added triage/needs-confirmation used for OSS triage rotation - reported issue needs to be reproduced area/backend/api labels May 5, 2023
@Sh4pe
Copy link
Author

Sh4pe commented May 25, 2023

This might be related to #43765.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend/api area/live triage/needs-confirmation used for OSS triage rotation - reported issue needs to be reproduced
Projects
None yet
Development

No branches or pull requests

3 participants