-
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 mapping for munin and options to override service type and name #10322
Conversation
jenkins, test this again please |
If we go with Could it happen that 2 different services create a conflict? @exekias Your input here would be great. |
Ok, I'll go for
Do we have a name for the settings to override I'll use namespace by now to set both values instead of adding it to the metric names.
Metric names should match There can be two plugins writing to the same fields things with different meanings, in that case there won't be mapping conflicts and the user can set namespace/service.type to differentiate. |
@@ -4,8 +4,10 @@ | |||
Munin node metrics exporter | |||
release: beta | |||
fields: | |||
- name: munin | |||
type: group | |||
- name: munin.* |
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.
you can remove the .*
part, it seems that's how we normally do it in fields.yml, the timeseries.instance
code will be easier too
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.
This looks needed in this case, maybe because I am setting up dynamic templates for two levels now.
- name: munin.* | ||
type: object | ||
object_type: double | ||
object_type_mapping_type: 'long' |
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 long here? I would perhaps expect:
object_type_mapping_type: "*"
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 needed objects to keep being objects, I have added two patterns now, one for the level of groups and another one for the metrics.
I don't have a strong opinion on prepending |
metricbeat/module/munin/node/node.go
Outdated
return event, nil | ||
|
||
event := mb.Event{ | ||
Service: m.serviceType, |
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.
The service type should not be munin
by the service that is monitored. So if apache
is monitored with munin, service.type
should be apache. Because of this we should also have it set by the user. I wonder if we should make it required for the user to have it set or make it optional?
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 had a discussion with @exekias and he proposed to have this as general option for all modules instead. Can you remove it from here and potentially open a separate PR with introducing these settings?
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.
The service type should not be
munin
by the service that is monitored. So ifapache
is monitored with munin,service.type
should be apache. Because of this we should also have it set by the user. I wonder if we should make it required for the user to have it set or make it optional?
After reading this I think that another option for events could be to use the plugin name as a different field and not for the path, so if we have now an event like this:
{
"service": {
"type": "munin",
"name": "somerole"
},
{
"munin": {
"metrics": {
"apache": {
"accesses": 42,
"errors": 2
},
"cpu": {
"system": 0.8
},
}
}
}
Have instead two like this:
{
"service": {
"type": "apache",
"name": "somerole"
},
{
"observer": {
"type": "munin"
},
"munin": {
"plugin": {
"name": "apache"
},
"metrics": {
"accesses": 42,
"errors": 2
}
}
}
{
"service": {
"type": "cpu",
"name": "somerole"
},
{
"observer": {
"type": "munin"
},
"munin": {
"plugin": {
"name": "cpu",
},
"metrics": {
"system": 0.8
}
}
}
This would be more aligned with ECS-like metrics.
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 had a discussion with @exekias and he proposed to have this as general option for all modules instead. Can you remove it from here and potentially open a separate PR with introducing these settings?
I totally agree with having an option for service.name
for all modules. Not so sure for service.type
, I think that the type should be set in general by the module (do we want to allow arbitrary service.type
for service modules?)
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.
- +1 on only allowing to set the
service.type
for the "input" modules. We should not allow to have it overwritten in other modules - It's very interesting that you set the observer above as munin and not metricbeat. @webmat This gets even more interesting now ;-)
- I like the idea of the plugin field. How easily can this mapping be done? I assume we only have data from 1 plugin at the time?
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 will add a general option for service.name
in other PR.
The setting of service.type
and observer.type
will also go in another PR, I think there can be some shared code for that in all "input" modules.
The plugin field would be quite easy, the items
we are looping on here, should rather be called plugins
🙂. I'll give a try to this 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.
PR to add service.name
#10427
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 pretty excited about this change. Especially the split up by plugin looks really good.
@@ -507,7 +507,15 @@ metricbeat.modules: | |||
enabled: true | |||
period: 10s | |||
hosts: ["localhost:4949"] | |||
node.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.
Should we mention this removal in the changelog?
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 removed this mention now that the refactor is so impactful. But I'll re-add something about that, yes 👍
Make munin module more future-proof in its way to GA by adding a more strict
field mapping and name validation, and options to override ECS fields for
service type and name.
Changes here:
munin.metrics
, this way we can add moremunin subfields in the future if needed.
munin.metrics.*
is expected to be a numeric metric.