-
Notifications
You must be signed in to change notification settings - Fork 41
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
fix(database/influxdb): replace invisible chars and whitespaces with space #235
fix(database/influxdb): replace invisible chars and whitespaces with space #235
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the new into a separate function.
// https://docs.influxdata.com/influxdb/v2/reference/syntax/line-protocol/ | ||
// Line protocol does not support the newline character \n in tag or field values. | ||
// To be safe, remove all non-printable characters and spaces except ASCII space and U+0020. | ||
for _, tag := range tags { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this loop into a new function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4e60c98
to
8de9029
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
This fixes issues where users use '\n' in tag values (e.g. the owner) that is incompatible with InfluxDB's Line protocol.
8de9029
to
e87b23e
Compare
🎉 This PR is included in version 1.5.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Sanitize tag values before they are being sent to Influx.
This fixes issues where users use '\n' in tag values (e.g. the owner) that is incompatible with InfluxDB's Line protocol.'
Thanks a lot for @T0biii for the help in tracing this error and creating a solution!
Motivation and Context
We keep on seeing errors in the yanic log about
Because the user uses
peter@hase\n.de
as their owner name. This works in other parts of yanic, but causes issues with influx.Checklist: