-
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
Unify default module configurations #6908
Conversation
Changes are duplicated so there is only need to review 32 files under |
79b7642
to
69eee1a
Compare
#- core | ||
#- diskio | ||
#- socket | ||
processes: ['.*'] |
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 is the default, should we leave it commented out?
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.
Here is the meta issue where we discussed the initial changes: #6668 We should separate the discussion here between the short config and reference config:
short config:
- We removed the
metricsets
from the config.yml to make sure always the defaults apply. So if we add one more metricset, the config does not have to change and you automatically get the new metricset. I like the config without the metricsets as it focuses on the modules. Most users are at first probably not interested in the metricsets. - period: Our take was to remove it if it's the default and only leave it in if it deviates. It makes the config shorter
- +1 on
module
andhosts
- Instead of adding lots of comments, we should link to the docs page. The reference config is that contains all the comments.
I personally would prefer that we keep the short config really short and use the reference for all the comments etc. I think this PR starts to blur the lines again.
@@ -1,2 +1,4 @@ | |||
- module: aerospike | |||
metricsets: ["namespace"] |
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 reason we left out the metricsets in the short config is to make sure we always have the default behaviour an it's not influence by the config. So if we add one more metricset to the defaults, a user will get it automatically without having to change the config.
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 see this point, what about having them commented?
@@ -1,2 +1,4 @@ | |||
- module: aerospike | |||
metricsets: ["namespace"] | |||
period: 10s |
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 remember @andrewkroh suggested to remove period. The part I like about it is that it makes the config even shorter.
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.
One option would be to only include the period when it's not the default of 10s.
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.
In general, I would prefer to keep it as it adds visibility to the setting, any user opening the config file for the module will know what that is and how it works really quick. If we remove it they need to go back to the docs.
@@ -1,7 +1,16 @@ | |||
- module: ceph | |||
metricsets: ["cluster_health", "cluster_status", "monitor_health"] | |||
metricsets: | |||
- cluster_health |
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 the new structure here, makes it easier to comment one.
period: 10s | ||
hosts: ["localhost:5000"] |
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.
oh, seems like we forgot hosts here :-(
- cluster_disk | ||
- osd_tree | ||
- osd_df | ||
- pool_disk | ||
period: 1m |
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 is a good example I think where having period in makes sense.
@@ -1,2 +1,8 @@ | |||
- module: windows | |||
period: 60s | |||
metricsets: ["perfmon"] |
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 is not enabled by default so it should not be 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.
I commented it out
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.
👍
# - core | ||
# - diskio | ||
# - socket | ||
|
||
- module: system | ||
period: 1m | ||
metricsets: |
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 think it might make sense to use the ignore_types
option instead of the filter. Or maybe these mounts are filtered by default now?
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.
That's a good question, @jsoriano do your recent changes affect 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.
Oh sorry, I forgot this question. My latest changes filter by default the filesystem types marked as nodev
in /proc/filesystems
, and remove duplications caused by bind mounts and similar. Probably this is enough to have meaningful events by default without needing these processors.
period: 60s | ||
metricsets: ["perfmon"] | ||
period: 10s | ||
perfmon.counters: |
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.
While it would be a deviance from the defaults, I think that including an example would be very helpful to users. We have some in the docs.
period: 10s | ||
metricsets: | ||
- cpu | ||
- load |
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.
load
doesn't exist for Windows. Does load
get deleted during packaging for Windows (check before-build
in the Makefile)?
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 should, but it's a good point, I must test this
Since we split module configurations into modules.d folder, we can keep configurations more verbose, so users can have a quick reference when opening them for editing. This change unifies configuration files using the followin rules: * Write at least the following settings, in this order: `module`, `metricsets`, `period`, `hosts`. * Default metricsets list shown as it helps to know what's the list, or disable just one. Inline if there is only one metricset, one line per metricset if there is more than one. * Some modules have exceptions and include more definitions, different defaults. * Comments are allowed (and encouraged), both to explain a setting and to suggest a full configuration. * `enabled` setting is not shown at all, modules are enabled by using `metricbeat modules enable <module name>`. Use comments to suggest settings that are disabled by default.
36a3790
to
2581f7e
Compare
290b591
to
ddf9cc9
Compare
0b5829c
to
efc0520
Compare
I gave this another spin: included link to docs + commented metricsets |
@@ -20,7 +20,9 @@ in <<configuration-metricbeat>>. Here is an example configuration: | |||
---- | |||
metricbeat.modules: | |||
- module: golang | |||
metricsets: ["expvar","heap"] | |||
# metricsets: |
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.
Nit: Could you put the # directly before the metricset
without space? It's more similar to what we do everywhere else.
@@ -19,28 +19,32 @@ in <<configuration-metricbeat>>. Here is an example configuration: | |||
---- | |||
metricbeat.modules: | |||
- module: jolokia | |||
metricsets: ["jmx"] | |||
# metricsets: ["jmx"] |
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.
Comment above applies to all #
# Password of hosts. Empty by default. | ||
#password: secret | ||
|
||
# By setting raw to true, all raw fields from the status metricset will be added to the 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.
Let's remove this from here as I don't want to encourage people to use it.
@@ -1,2 +1,17 @@ | |||
- module: mysql | |||
hosts: ["tcp(127.0.0.1:3306)/"] | |||
# metricsets: ["status"] |
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 we use here also the -
notation already?
hosts: ["localhost:8080"] | ||
status_path: "/status" |
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.
Is this a default? If yes, it should be commented out.
# should never take longer then period, as otherwise calls can pile up. | ||
#timeout: 1s | ||
|
||
# Optional fields to be added to each 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.
This is not specific to redis, lets remove it.
# Max number of concurrent connections. Default: 10 | ||
#maxconn: 10 | ||
|
||
# Filters can be used to reduce the number of fields sent. |
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 is not redis specific, lets remove it.
|
||
# TODO add module release status if beta or experimental | ||
header = """# Module: {module} | ||
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/{docs_branch}/metricbeat-module-{module}.html |
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.
Nice
|
||
""" | ||
|
||
# Create directory for module confs |
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 we have the docs link also in the reference config file?
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 gave this a try but it would change reference file for all beats, and URL patterns are different. Also, not sure if it's that useful there, as it's the reference file. What do you think?
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 this is the module collection only for metricbeat, why did it change the other config files?
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 was talking about reference file, which is being collected by a different script
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.
Got it, lets leave it out for now then.
@@ -10,6 +10,7 @@ ES_BEATS?=.. | |||
GOX_OS=netbsd linux windows | |||
GOX_FLAGS=-arch="amd64 386 arm ppc64 ppc64le" | |||
|
|||
DOCS_BRANCH=$(shell grep doc-branch ../libbeat/docs/version.asciidoc | cut -c 14-) |
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 for now but just want to mention that this pretty fragile as we found out other cases.
@@ -251,7 +253,8 @@ metricbeat.modules: | |||
|
|||
#-------------------------------- HTTP Module -------------------------------- | |||
- module: http | |||
metricsets: ["json"] | |||
#metricsets: |
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 in the reference file have the enabled
one commented out to make it more clear? I like it in the short config to make sure the defaults keep working but here it's more about documenting it?
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.
We are close :-)
@@ -1,2 +1,4 @@ | |||
- module: aerospike | |||
# metricsets: ["namespace"] |
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 be before metricsets directly for consistency.
@@ -1,2 +1,21 @@ | |||
- module: postgresql | |||
#metricsets: | |||
# # Stats about every PostgreSQL database |
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 remove the comments for the metricsets. For these details we have the docs.
hosts: ["localhost:15672"] | ||
|
||
username: guest |
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 this be commented out or is guest
a common default?
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.
Yes, guest
exists by default.
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.
So it's better to connect by default with guest/guest
the have no credentials?
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.
guest
/guest
can be seen as some kind of "no credentials" for rabbitmq :)
By default it always exists, and I don't know if it is possible to connect with rabbitmq without credentials. I think it'd be good if metricbeat tries to connect with these credentials by default too, so it can collect some metrics out of the box.
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.
SGTM. Not part of this PR but I wonder if we should in these case then also set them directly in the code as defaults.
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.
Yes, good point, I'll take care of this.
Since we split module configurations into modules.d folder, we can keep configurations more verbose, so users have a quick reference when opening them for editing. This change unifies configuration files using the followin rules: * Write at least the following settings, in this order: `module`, `metricsets`, `period`, `hosts`. * Default metricsets list shown as it helps to know what's the list, or disable just one. Inline if there is only one metricset, one line per metricset if there is more than one. * Some modules have exceptions and include more definitions, or different defaults. * Comments are allowed (and encouraged), both to explain a setting and to suggest a full configuration. * `enabled` setting is not shown at all, modules are enabled by using `metricbeat modules enable <module name>`. Use comments to suggest settings that are disabled by default.
Since we split module configurations into modules.d folder, we can keep configurations more verbose, so users have a quick reference when opening them for editing. This change unifies configuration files using the followin rules: * Write at least the following settings, in this order: `module`, `metricsets`, `period`, `hosts`. * Default metricsets list shown as it helps to know what's the list, or disable just one. Inline if there is only one metricset, one line per metricset if there is more than one. * Some modules have exceptions and include more definitions, or different defaults. * Comments are allowed (and encouraged), both to explain a setting and to suggest a full configuration. * `enabled` setting is not shown at all, modules are enabled by using `metricbeat modules enable <module name>`. Use comments to suggest settings that are disabled by default.
Since we split module configurations into modules.d folder, we can keep
configurations more verbose, so users have a quick reference when
opening them for editing.
This change unifies configuration files using the followin rules:
module
,metricsets
,period
,hosts
.or disable just one. Inline if there is only one metricset, one line
per metricset if there is more than one.
defaults.
to suggest a full configuration.
enabled
setting is not shown at all, modules are enabled by usingmetricbeat modules enable <module name>
. Use comments to suggestsettings that are disabled by default.