-
Notifications
You must be signed in to change notification settings - Fork 28
Allow to set dimensions for metrics #57
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
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.
LGTM, pending the two pieces of feedback i left.
lib/fluent/plugin/out_sumologic.rb
Outdated
end | ||
|
||
unless metadata.nil? | ||
headers['X-Sumo-Metadata'] = metadata |
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.
As discussed on Slack, let's confirm Metadata is the best use, as opposed to dimensions.
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.
I change it to dimensions, but regarding another discussion I'm not sure if we want to merge those changes or not
lib/fluent/plugin/out_sumologic.rb
Outdated
conf['custom_fields'] = nil | ||
end | ||
|
||
if conf['custom_metadata'].nil? || conf['custom_metadata'].strip.length == 0 |
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.
Should we do some validation on the configuration? Testing it is actually a KVP string?
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.
I added simple validation 👍
U updated PR description due to changes |
b31d158
to
8a1f307
Compare
8a1f307
to
a7b3a3c
Compare
It would be nice to add some dimensions directly from configuration.
custom_dimensions
allows to add dimensions inX-Sumo-Dimensions
header.https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source#supported-http-headers