Skip to content
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

Merged
merged 8 commits into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions metricbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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-)
Copy link
Contributor

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.


include ${ES_BEATS}/libbeat/scripts/Makefile

Expand Down Expand Up @@ -41,8 +42,8 @@ configs: python-env
@cat ${ES_BEATS}/metricbeat/_meta/setup.yml >> _meta/beat.yml
@cat ${ES_BEATS}/metricbeat/_meta/common.reference.yml > _meta/beat.reference.yml
@${PYTHON_ENV}/bin/python ${ES_BEATS}/script/config_collector.py --beat ${BEAT_NAME} --full $(PWD) >> _meta/beat.reference.yml
@rm -rf modules.d && mkdir -p modules.d
@for MODULE in `find module -maxdepth 1 -mindepth 1 -type d -exec basename {} \;`; do cp -a $(PWD)/module/$$MODULE/_meta/config.yml modules.d/$$MODULE.yml.disabled; done
@rm -rf modules.d
${PYTHON_ENV}/bin/python ${ES_BEATS}/metricbeat/scripts/modules_collector.py --docs_branch=$(DOCS_BRANCH)
@chmod go-w modules.d/*
@# Enable system by default:
@if [ -f modules.d/system.yml.disabled ]; then mv modules.d/system.yml.disabled modules.d/system.yml; fi
Expand Down
4 changes: 3 additions & 1 deletion metricbeat/docs/modules/golang.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: golang
metricsets: ["expvar","heap"]
#metricsets:
# - expvar
# - heap
period: 10s
hosts: ["localhost:6060"]
heap.path: "/debug/vars"
Expand Down
16 changes: 9 additions & 7 deletions metricbeat/docs/modules/http.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: http
metricsets: ["json"]
#metricsets:
# - json
period: 10s
hosts: ["localhost:80"]
namespace: "json_namespace"
Expand All @@ -39,15 +40,16 @@ metricbeat.modules:
#dedot.enabled: false

- module: http
metricsets: ["server"]
#metricsets:
# - server
host: "localhost"
port: "8080"
enabled: false
# paths:
# - path: "/foo"
# namespace: "foo"
# fields: # added to the the response in root. overwrites existing fields
# key: "value"
#paths:
# - path: "/foo"
# namespace: "foo"
# fields: # added to the the response in root. overwrites existing fields
# key: "value"
----

This module supports TLS connection when using `ssl` config field, as described in <<configuration-ssl>>.
Expand Down
38 changes: 21 additions & 17 deletions metricbeat/docs/modules/jolokia.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,32 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: jolokia
metricsets: ["jmx"]
#metricsets: ["jmx"]
period: 10s
hosts: ["localhost"]
namespace: "metrics"
#path: "/jolokia/?ignoreErrors=true&canonicalNaming=false"
jmx.mappings:
- mbean: 'java.lang:type=Runtime'
attributes:
- attr: Uptime
field: uptime
- mbean: 'java.lang:type=Memory'
attributes:
- attr: HeapMemoryUsage
field: memory.heap_usage
- attr: NonHeapMemoryUsage
field: memory.non_heap_usage
#- mbean: 'java.lang:type=Runtime'
# attributes:
# - attr: Uptime
# field: uptime
#- mbean: 'java.lang:type=Memory'
# attributes:
# - attr: HeapMemoryUsage
# field: memory.heap_usage
# - attr: NonHeapMemoryUsage
# field: memory.non_heap_usage
# GC Metrics - this depends on what is available on your JVM
# - mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
# attributes:
# - attr: CollectionTime
# field: gc.cms_collection_time
# - attr: CollectionCount
# field: gc.cms_collection_count
#- mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
# attributes:
# - attr: CollectionTime
# field: gc.cms_collection_time
# - attr: CollectionCount
# field: gc.cms_collection_count

jmx.application:
jmx.instance:
----

This module supports TLS connection when using `ssl` config field, as described in <<configuration-ssl>>.
Expand Down
58 changes: 33 additions & 25 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ metricbeat.modules:

#------------------------------- Golang Module -------------------------------
- module: golang
metricsets: ["expvar","heap"]
#metricsets:
# - expvar
# - heap
period: 10s
hosts: ["localhost:6060"]
heap.path: "/debug/vars"
Expand Down Expand Up @@ -251,7 +253,8 @@ metricbeat.modules:

#-------------------------------- HTTP Module --------------------------------
- module: http
metricsets: ["json"]
#metricsets:
Copy link
Contributor

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?

# - json
period: 10s
hosts: ["localhost:80"]
namespace: "json_namespace"
Expand All @@ -264,40 +267,45 @@ metricbeat.modules:
#dedot.enabled: false

- module: http
metricsets: ["server"]
#metricsets:
# - server
host: "localhost"
port: "8080"
enabled: false
# paths:
# - path: "/foo"
# namespace: "foo"
# fields: # added to the the response in root. overwrites existing fields
# key: "value"
#paths:
# - path: "/foo"
# namespace: "foo"
# fields: # added to the the response in root. overwrites existing fields
# key: "value"

#------------------------------- Jolokia Module ------------------------------
- module: jolokia
metricsets: ["jmx"]
#metricsets: ["jmx"]
period: 10s
hosts: ["localhost"]
namespace: "metrics"
#path: "/jolokia/?ignoreErrors=true&canonicalNaming=false"
jmx.mappings:
- mbean: 'java.lang:type=Runtime'
attributes:
- attr: Uptime
field: uptime
- mbean: 'java.lang:type=Memory'
attributes:
- attr: HeapMemoryUsage
field: memory.heap_usage
- attr: NonHeapMemoryUsage
field: memory.non_heap_usage
#- mbean: 'java.lang:type=Runtime'
# attributes:
# - attr: Uptime
# field: uptime
#- mbean: 'java.lang:type=Memory'
# attributes:
# - attr: HeapMemoryUsage
# field: memory.heap_usage
# - attr: NonHeapMemoryUsage
# field: memory.non_heap_usage
# GC Metrics - this depends on what is available on your JVM
# - mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
# attributes:
# - attr: CollectionTime
# field: gc.cms_collection_time
# - attr: CollectionCount
# field: gc.cms_collection_count
#- mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
# attributes:
# - attr: CollectionTime
# field: gc.cms_collection_time
# - attr: CollectionCount
# field: gc.cms_collection_count

jmx.application:
jmx.instance:

#-------------------------------- Kafka Module -------------------------------
- module: kafka
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/module/aerospike/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
- module: aerospike
# metricsets: ["namespace"]
Copy link
Contributor

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.

period: 10s
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

hosts: ["localhost:3000"]
3 changes: 3 additions & 0 deletions metricbeat/module/apache/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
- module: apache
#metricsets:
# - status
period: 10s
hosts: ["http://127.0.0.1"]
13 changes: 11 additions & 2 deletions metricbeat/module/ceph/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
- module: ceph
metricsets: ["cluster_health", "cluster_status", "monitor_health"]
#metricsets:
# - cluster_health
# - cluster_status
# - monitor_health
period: 10s
hosts: ["localhost:5000"]
Copy link
Contributor

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 :-(


- module: ceph
metricsets: ["cluster_disk", "osd_tree", "pool_disk"]
#metricsets:
# - cluster_disk
# - osd_tree
# - osd_df
# - pool_disk
period: 1m
Copy link
Contributor

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.

hosts: ["localhost:5000"]
5 changes: 5 additions & 0 deletions metricbeat/module/couchbase/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
- module: couchbase
#metricsets:
# - bucket
# - cluster
# - node
period: 10s
hosts: ["localhost:8091"]
15 changes: 15 additions & 0 deletions metricbeat/module/docker/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
- module: docker
#metricsets:
# - container
# - cpu
# - diskio
# - healthcheck
# - info
# - memory
# - network
period: 10s
hosts: ["unix:///var/run/docker.sock"]

# Replace dots in labels with `_`. Set to false to keep dots
labels.dedot: true

# To connect to Docker over TLS you must specify a client and CA certificate.
#ssl:
#certificate_authority: "/etc/pki/root/ca.pem"
#certificate: "/etc/pki/client/cert.pem"
#key: "/etc/pki/client/cert.key"
3 changes: 3 additions & 0 deletions metricbeat/module/dropwizard/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
- module: dropwizard
#metricsets:
# - collector
period: 10s
hosts: ["localhost:8080"]
metrics_path: /metrics/metrics
namespace: example
4 changes: 4 additions & 0 deletions metricbeat/module/elasticsearch/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
- module: elasticsearch
#metricsets:
# - node
# - node_stats
period: 10s
hosts: ["localhost:9200"]
5 changes: 5 additions & 0 deletions metricbeat/module/etcd/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
- module: etcd
#metricsets:
# - leader
# - self
# - store
period: 10s
hosts: ["localhost:2379"]
4 changes: 3 additions & 1 deletion metricbeat/module/golang/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
- module: golang
metricsets: ["expvar","heap"]
#metricsets:
# - expvar
# - heap
period: 10s
hosts: ["localhost:6060"]
heap.path: "/debug/vars"
Expand Down
8 changes: 8 additions & 0 deletions metricbeat/module/graphite/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
- module: graphite
#metricsets:
# - server
#protocol: "udp"
#templates:
# - filter: "test.*.bash.*" # This would match metrics like test.localhost.bash.stats
# namespace: "test"
# template: ".host.shell.metric*" # test.localhost.bash.stats would become metric=stats and tags host=localhost,shell=bash
# delimiter: "_"
4 changes: 4 additions & 0 deletions metricbeat/module/haproxy/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
- module: haproxy
#metricsets:
# - info
# - stat
period: 10s
hosts: ["tcp://127.0.0.1:14567"]
16 changes: 9 additions & 7 deletions metricbeat/module/http/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- module: http
metricsets: ["json"]
#metricsets:
# - json
period: 10s
hosts: ["localhost:80"]
namespace: "json_namespace"
Expand All @@ -12,12 +13,13 @@
#dedot.enabled: false

- module: http
metricsets: ["server"]
#metricsets:
# - server
host: "localhost"
port: "8080"
enabled: false
# paths:
# - path: "/foo"
# namespace: "foo"
# fields: # added to the the response in root. overwrites existing fields
# key: "value"
#paths:
# - path: "/foo"
# namespace: "foo"
# fields: # added to the the response in root. overwrites existing fields
# key: "value"
38 changes: 21 additions & 17 deletions metricbeat/module/jolokia/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
- module: jolokia
metricsets: ["jmx"]
#metricsets: ["jmx"]
period: 10s
hosts: ["localhost"]
namespace: "metrics"
#path: "/jolokia/?ignoreErrors=true&canonicalNaming=false"
jmx.mappings:
- mbean: 'java.lang:type=Runtime'
attributes:
- attr: Uptime
field: uptime
- mbean: 'java.lang:type=Memory'
attributes:
- attr: HeapMemoryUsage
field: memory.heap_usage
- attr: NonHeapMemoryUsage
field: memory.non_heap_usage
#- mbean: 'java.lang:type=Runtime'
# attributes:
# - attr: Uptime
# field: uptime
#- mbean: 'java.lang:type=Memory'
# attributes:
# - attr: HeapMemoryUsage
# field: memory.heap_usage
# - attr: NonHeapMemoryUsage
# field: memory.non_heap_usage
# GC Metrics - this depends on what is available on your JVM
# - mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
# attributes:
# - attr: CollectionTime
# field: gc.cms_collection_time
# - attr: CollectionCount
# field: gc.cms_collection_count
#- mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
# attributes:
# - attr: CollectionTime
# field: gc.cms_collection_time
# - attr: CollectionCount
# field: gc.cms_collection_count

jmx.application:
jmx.instance:
Loading