-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add missing namespace field in http server metricset #7890
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
7ce51e8
to
62c1c67
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.
Could you update the data.json
file? https://github.com/elastic/beats/blob/master/metricbeat/module/http/server/_meta/data.json
@@ -83,10 +84,10 @@ func (m *MetricSet) Run(reporter mb.PushReporterV2) { | |||
reporter.Error(err) | |||
} else { | |||
event := mb.Event{} | |||
event.ModuleFields = common.MapStr{} | |||
metricSetName := fields[mb.NamespaceKey].(string) | |||
ns := fields[mb.NamespaceKey].(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.
Could you add an , ok
check to make sure type conversion works?
delete(fields, mb.NamespaceKey) | ||
event.ModuleFields.Put(metricSetName, fields) | ||
event.MetricSetFields = fields |
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.
Did you check if this has the expected outcome? Will this put it always under server
or the namespace set below?
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.
it will put under the http.<namespace>
62c1c67
to
e506836
Compare
@ruflin the |
if ok { | ||
ns = fmt.Sprintf("http.%s", ns) | ||
delete(fields, mb.NamespaceKey) | ||
} else { |
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.
Why do you have an else
here?
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.
my bad
e506836
to
95a9c47
Compare
95a9c47
to
dacaa08
Compare
@ruflin should be backport to 6.x ? |
Yes, I'd say we should backport it, I'll do it. |
This PR adds back the missing `metricset.namespace` field in to payloads generated by http server. (cherry picked from commit 08dfd03)
This PR adds back the missing `metricset.namespace` field in to payloads generated by http server. (cherry picked from commit 08dfd03)
This PR adds back the missing `metricset.namespace` field in to payloads generated by http server. (cherry picked from commit 08dfd03)
This PR adds back the missing `metricset.namespace` field in to payloads generated by http server. (cherry picked from commit 08dfd03) Co-authored-by: Vijay Samuel <[email protected]>
This PR adds back the missing `metricset.namespace` field in to payloads generated by http server. (cherry picked from commit 08dfd03) Co-authored-by: Vijay Samuel <[email protected]>
…lastic#9071) This PR adds back the missing `metricset.namespace` field in to payloads generated by http server. (cherry picked from commit 21e1600) Co-authored-by: Vijay Samuel <[email protected]>
This PR adds back the missing
metricset.namespace
field in to payloads generated by http server.