-
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
[Metricbeat] Migrate Kubernetes state_node Metricset to use ReporterV2 interface #10962
[Metricbeat] Migrate Kubernetes state_node Metricset to use ReporterV2 interface #10962
Conversation
jenkins, test this |
jenkins, test this again please |
5caf770
to
9f3daa6
Compare
Error in RabbitMQ seems unrelated https://beats-ci.elastic.co/job/elastic+beats+pull-request+multijob-linux/beat=metricbeat,label=linux-immutable/5499/console |
jenkins, test this |
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'm good with merging this as is.
Overall it looks like a prime candidate for the new http test framework. I can take a stab at it as soon as this is merged.
"RootFields": null, | ||
"ModuleFields": null, | ||
"MetricSetFields": { | ||
"_namespace": "node", |
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 would assume with v2 no _namespace
field should be needed anymore?
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 checked the code and it seems for prometheus modules namespace is used a bit different then I expected.
"RootFields": null, | ||
"ModuleFields": null, | ||
"MetricSetFields": { | ||
"_namespace": "node", |
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 checked the code and it seems for prometheus modules namespace is used a bit different then I expected.
return events, err | ||
m.enricher.Enrich(events) | ||
for _, event := range events { | ||
reporter.Event(mb.Event{MetricSetFields: event}) |
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.
If we just add the event to the MetricSetFields
here I think it will be reported under kubernetes.state_node
but looking at the existing data.json
it's under kubernetes.node
:
"kubernetes": {
"node": {
"cpu": {
"allocatable": {
"cores": 2
},
We need to respect the namespace.
@sayden Can you verify that?
@@ -115,7 +115,17 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) { | |||
|
|||
m.enricher.Enrich(events) | |||
for _, event := range events { | |||
reporter.Event(mb.Event{MetricSetFields: event}) | |||
var namespace 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.
Isn't the namespace for this metricset always node
?
Should be the same value as mapping.ExtraFields[mb.NamespaceKey]
d277ee1
to
3c4a590
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.
LGTM
Refer to #10774 for more info