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

fluent-plugin-grafana-loki: Escape double-quotes in labels, and suppress labels with value nil #928

Merged
merged 1 commit into from
Sep 17, 2019

Conversation

candlerb
Copy link
Contributor

Which issue(s) this PR fixes:
Fixes #927

  • Double-quotes within label values are escaped
  • Label values of nil suppress the label (but empty string is still passed through as label)

Special notes for your reviewer:

The condition unless data_labels.nil? is superfluous, as it was checked two lines earlier, so I have removed this.

If you want to suppress empty strings as well as nil, then ... if v and v != ""

If you want to keep nil as empty string, then v.to_s.gsub(...) (since nil.gsub gives an error)

@candlerb candlerb changed the title Escape double-quotes in labels, and suppress labels with value nil fluent-plugin-grafana-loki: Escape double-quotes in labels, and suppress labels with value nil Aug 21, 2019
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cyriltovena cyriltovena merged commit 35d5a15 into grafana:master Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fluent-plugin-grafana-loki can generate invalid requests
2 participants