From 7284be334675cd552641e50e265ff26a7bdce1af Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 07:05:05 -0500 Subject: [PATCH 01/21] Split up parts into different metricsets. --- x-pack/metricbeat/include/list.go | 2 + .../module/cloudfoundry/cloudfoundry.go | 133 ++++++++++++++++++ .../cloudfoundry/counter/_meta/data.json | 21 +++ .../cloudfoundry/counter/_meta/docs.asciidocs | 2 + .../cloudfoundry/counter/_meta/fields.yml | 18 +++ .../module/cloudfoundry/counter/counter.go | 45 ++++++ .../metricbeat/module/cloudfoundry/module.yml | 5 + 7 files changed, 226 insertions(+) create mode 100644 x-pack/metricbeat/module/cloudfoundry/cloudfoundry.go create mode 100644 x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json create mode 100644 x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidocs create mode 100644 x-pack/metricbeat/module/cloudfoundry/counter/_meta/fields.yml create mode 100644 x-pack/metricbeat/module/cloudfoundry/counter/counter.go create mode 100644 x-pack/metricbeat/module/cloudfoundry/module.yml diff --git a/x-pack/metricbeat/include/list.go b/x-pack/metricbeat/include/list.go index 590accfd8627..e03e72f8d2fe 100644 --- a/x-pack/metricbeat/include/list.go +++ b/x-pack/metricbeat/include/list.go @@ -23,6 +23,8 @@ import ( _ "github.com/elastic/beats/x-pack/metricbeat/module/azure/compute_vm_scaleset" _ "github.com/elastic/beats/x-pack/metricbeat/module/azure/monitor" _ "github.com/elastic/beats/x-pack/metricbeat/module/azure/storage" + _ "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry" + _ "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry/counter" _ "github.com/elastic/beats/x-pack/metricbeat/module/cockroachdb" _ "github.com/elastic/beats/x-pack/metricbeat/module/coredns" _ "github.com/elastic/beats/x-pack/metricbeat/module/coredns/stats" diff --git a/x-pack/metricbeat/module/cloudfoundry/cloudfoundry.go b/x-pack/metricbeat/module/cloudfoundry/cloudfoundry.go new file mode 100644 index 000000000000..0cfe1bcff049 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/cloudfoundry.go @@ -0,0 +1,133 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package cloudfoundry + +import ( + "context" + "sync" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/mb" + cfcommon "github.com/elastic/beats/x-pack/libbeat/common/cloudfoundry" +) + +// ModuleName is the name of this module. +const ModuleName = "cloudfoundry" + +type Module struct { + mb.BaseModule + + hub *cfcommon.Hub + listener *cfcommon.RlpListener + listenerOn bool + listenerLock sync.Mutex + + counterReporter mb.PushReporterV2 + valueReporter mb.PushReporterV2 + containerReporter mb.PushReporterV2 +} + +func init() { + if err := mb.Registry.AddModule(ModuleName, newModule); err != nil { + panic(err) + } +} + +func newModule(base mb.BaseModule) (mb.Module, error) { + var cfg cfcommon.Config + if err := base.UnpackConfig(&cfg); err != nil { + return nil, err + } + hub := cfcommon.NewHub(&cfg, "metricbeat", logp.NewLogger("cloudfoundry")) + listener, err := hub.RlpListener(cfcommon.RlpListenerCallbacks{}) + if err != nil { + return nil, err + } + return &Module{ + BaseModule: base, + hub: hub, + listener: listener, + }, nil +} + +func (m *Module) RunCounterReporter(reporter mb.PushReporterV2) { + m.listenerLock.Lock() + m.runReporters(reporter, m.valueReporter, m.containerReporter) + m.listenerLock.Unlock() + + <-reporter.Done() + + m.listenerLock.Lock() + m.runReporters(nil, m.valueReporter, m.containerReporter) + m.listenerLock.Unlock() +} + +func (m *Module) RunValueReporter(reporter mb.PushReporterV2) { + m.listenerLock.Lock() + m.runReporters(m.counterReporter, reporter, m.containerReporter) + m.listenerLock.Unlock() + + <-reporter.Done() + + m.listenerLock.Lock() + m.runReporters(m.counterReporter, nil, m.containerReporter) + m.listenerLock.Unlock() +} + +func (m *Module) RunContainerReporter(reporter mb.PushReporterV2) { + m.listenerLock.Lock() + m.runReporters(m.counterReporter, m.valueReporter, reporter) + m.listenerLock.Unlock() + + <-reporter.Done() + + m.listenerLock.Lock() + m.runReporters(m.counterReporter, m.valueReporter, nil) + m.listenerLock.Unlock() +} + +func (m *Module) runReporters(counterReporter, valueReporter, containerReporter mb.PushReporterV2) { + if m.listenerOn { + m.listener.Stop() + m.listenerOn = false + } + m.counterReporter = counterReporter + m.valueReporter = valueReporter + m.containerReporter = containerReporter + + start := false + callbacks := cfcommon.RlpListenerCallbacks{} + if m.counterReporter != nil { + start = true + callbacks.Counter = func(evt *cfcommon.EventCounter) { + m.counterReporter.Event(mb.Event{ + Timestamp: evt.Timestamp(), + RootFields: evt.ToFields(), + }) + } + } + if m.valueReporter != nil { + start = true + callbacks.ValueMetric = func(evt *cfcommon.EventValueMetric) { + m.valueReporter.Event(mb.Event{ + Timestamp: evt.Timestamp(), + RootFields: evt.ToFields(), + }) + } + } + if m.containerReporter != nil { + start = true + callbacks.ContainerMetric = func(evt *cfcommon.EventContainerMetric) { + m.containerReporter.Event(mb.Event{ + Timestamp: evt.Timestamp(), + RootFields: evt.ToFields(), + }) + } + } + if start { + m.listener.Start(context.Background()) + m.listenerOn = true + } +} diff --git a/x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json new file mode 100644 index 000000000000..4f515c7bfa93 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json @@ -0,0 +1,21 @@ +{ + "@timestamp": "2020-02-26T08:05:34.853Z", + "cloudfoundry": { + "counter": { + "name": "", + "delta": 0, + "total": 0 + } + }, + "event": { + "dataset": "cloudfoundry.counter", + "duration": 115000, + "module": "cloudfoundry" + }, + "metricset": { + "name": "counter" + }, + "service": { + "type": "cloudfoundry" + } +} diff --git a/x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidocs b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidocs new file mode 100644 index 000000000000..e3bcdcb52536 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidocs @@ -0,0 +1,2 @@ +The counter metricset of Cloud Foundry module allows you to collect counter metrics that the +loggregator sends to metricbeat. diff --git a/x-pack/metricbeat/module/cloudfoundry/counter/_meta/fields.yml b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/fields.yml new file mode 100644 index 000000000000..1a6b5566d412 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/fields.yml @@ -0,0 +1,18 @@ +- name: counter + type: group + description: > + `counter` contains counter metrics from Cloud Foundry. + release: experimental + fields: + - name: name + type: keyword + description: > + The name of the counter. + - name: delta + type: long + description: > + The difference between the last time the counter event occurred. + - name: total + type: long + description: > + The total value for the counter. diff --git a/x-pack/metricbeat/module/cloudfoundry/counter/counter.go b/x-pack/metricbeat/module/cloudfoundry/counter/counter.go new file mode 100644 index 000000000000..470e128f3f1b --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/counter/counter.go @@ -0,0 +1,45 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package counter + +import ( + "fmt" + + "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry" + + "github.com/elastic/beats/metricbeat/mb" +) + +// init registers the MetricSet with the central registry. +// The New method will be called after the setup of the module and before starting to fetch data +func init() { + mb.Registry.MustAddMetricSet("cloudfoundry", "counter", New, mb.DefaultMetricSet()) +} + +// MetricSet type defines all fields of the MetricSet +// As a minimum it must inherit the mb.BaseMetricSet fields, but can be extended with +// additional entries. These variables can be used to persist data or configuration between +// multiple fetch calls. +type MetricSet struct { + mb.BaseMetricSet + + mod *cloudfoundry.Module +} + +// New create a new instance of the MetricSet +// Part of new is also setting up the configuration by processing additional +// configuration entries if needed. +func New(base mb.BaseMetricSet) (mb.MetricSet, error) { + mod, ok := base.Module().(*cloudfoundry.Module) + if !ok { + return nil, fmt.Errorf("must be child of cloudfoundry module") + } + return &MetricSet{base, mod}, nil +} + +// Run method provides the module with a reporter with which events can be reported. +func (m *MetricSet) Run(reporter mb.PushReporterV2) { + m.mod.RunCounterReporter(reporter) +} diff --git a/x-pack/metricbeat/module/cloudfoundry/module.yml b/x-pack/metricbeat/module/cloudfoundry/module.yml new file mode 100644 index 000000000000..cf62d2c84c0f --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/module.yml @@ -0,0 +1,5 @@ +name: cloudfoundry +metricsets: + - counter + - value + - container From 3d2db6650eb3d13d78e39609ada3a8060588a934 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 07:58:08 -0500 Subject: [PATCH 02/21] Add value and container metricsets. --- x-pack/metricbeat/include/list.go | 2 + x-pack/metricbeat/metricbeat.yml | 183 ++---------------- .../module/cloudfoundry/cloudfoundry.go | 28 ++- .../cloudfoundry/container/container.go | 45 +++++ .../module/cloudfoundry/value/value.go | 45 +++++ 5 files changed, 130 insertions(+), 173 deletions(-) create mode 100644 x-pack/metricbeat/module/cloudfoundry/container/container.go create mode 100644 x-pack/metricbeat/module/cloudfoundry/value/value.go diff --git a/x-pack/metricbeat/include/list.go b/x-pack/metricbeat/include/list.go index e03e72f8d2fe..d94850356797 100644 --- a/x-pack/metricbeat/include/list.go +++ b/x-pack/metricbeat/include/list.go @@ -24,7 +24,9 @@ import ( _ "github.com/elastic/beats/x-pack/metricbeat/module/azure/monitor" _ "github.com/elastic/beats/x-pack/metricbeat/module/azure/storage" _ "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry" + _ "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry/container" _ "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry/counter" + _ "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry/value" _ "github.com/elastic/beats/x-pack/metricbeat/module/cockroachdb" _ "github.com/elastic/beats/x-pack/metricbeat/module/coredns" _ "github.com/elastic/beats/x-pack/metricbeat/module/coredns/stats" diff --git a/x-pack/metricbeat/metricbeat.yml b/x-pack/metricbeat/metricbeat.yml index 5bd19f3030c2..cec3f83a4bf0 100644 --- a/x-pack/metricbeat/metricbeat.yml +++ b/x-pack/metricbeat/metricbeat.yml @@ -1,165 +1,18 @@ -###################### Metricbeat Configuration Example ####################### - -# This file is an example configuration file highlighting only the most common -# options. The metricbeat.reference.yml file from the same directory contains all the -# supported options with more comments. You can use it as a reference. -# -# You can find the full configuration reference here: -# https://www.elastic.co/guide/en/beats/metricbeat/index.html - -#========================== Modules configuration ============================ - -metricbeat.config.modules: - # Glob pattern for configuration loading - path: ${path.config}/modules.d/*.yml - - # Set to true to enable config reloading - reload.enabled: false - - # Period on which files under path should be checked for changes - #reload.period: 10s - -#==================== Elasticsearch template setting ========================== - -setup.template.settings: - index.number_of_shards: 1 - index.codec: best_compression - #_source.enabled: false - -#================================ General ===================================== - -# The name of the shipper that publishes the network data. It can be used to group -# all the transactions sent by a single shipper in the web interface. -#name: - -# The tags of the shipper are included in their own field with each -# transaction published. -#tags: ["service-X", "web-tier"] - -# Optional fields that you can specify to add additional information to the -# output. -#fields: -# env: staging - - -#============================== Dashboards ===================================== -# These settings control loading the sample dashboards to the Kibana index. Loading -# the dashboards is disabled by default and can be enabled either by setting the -# options here or by using the `setup` command. -#setup.dashboards.enabled: false - -# The URL from where to download the dashboards archive. By default this URL -# has a value which is computed based on the Beat name and version. For released -# versions, this URL points to the dashboard archive on the artifacts.elastic.co -# website. -#setup.dashboards.url: - -#============================== Kibana ===================================== - -# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API. -# This requires a Kibana endpoint configuration. -setup.kibana: - - # Kibana Host - # Scheme and port can be left out and will be set to the default (http and 5601) - # In case you specify and additional path, the scheme is required: http://localhost:5601/path - # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601 - #host: "localhost:5601" - - # Kibana Space ID - # ID of the Kibana Space into which the dashboards should be loaded. By default, - # the Default Space will be used. - #space.id: - -#============================= Elastic Cloud ================================== - -# These settings simplify using Metricbeat with the Elastic Cloud (https://cloud.elastic.co/). - -# The cloud.id setting overwrites the `output.elasticsearch.hosts` and -# `setup.kibana.host` options. -# You can find the `cloud.id` in the Elastic Cloud web UI. -#cloud.id: - -# The cloud.auth setting overwrites the `output.elasticsearch.username` and -# `output.elasticsearch.password` settings. The format is `:`. -#cloud.auth: - -#================================ Outputs ===================================== - -# Configure what output to use when sending the data collected by the beat. - -#-------------------------- Elasticsearch output ------------------------------ -output.elasticsearch: - # Array of hosts to connect to. - hosts: ["localhost:9200"] - - # Protocol - either `http` (default) or `https`. - #protocol: "https" - - # Authentication credentials - either API key or username/password. - #api_key: "id:api_key" - #username: "elastic" - #password: "changeme" - -#----------------------------- Logstash output -------------------------------- -#output.logstash: - # The Logstash hosts - #hosts: ["localhost:5044"] - - # Optional SSL. By default is off. - # List of root certificates for HTTPS server verifications - #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] - - # Certificate for SSL client authentication - #ssl.certificate: "/etc/pki/client/cert.pem" - - # Client Certificate Key - #ssl.key: "/etc/pki/client/cert.key" - -#================================ Processors ===================================== - -# Configure processors to enhance or manipulate events generated by the beat. - -processors: - - add_host_metadata: ~ - - add_cloud_metadata: ~ - - add_docker_metadata: ~ - - add_kubernetes_metadata: ~ - -#================================ Logging ===================================== - -# Sets log level. The default log level is info. -# Available log levels are: error, warning, info, debug -#logging.level: debug - -# At debug level, you can selectively enable logging only for some components. -# To enable all selectors use ["*"]. Examples of other selectors are "beat", -# "publish", "service". -#logging.selectors: ["*"] - -#============================== X-Pack Monitoring =============================== -# metricbeat can export internal metrics to a central Elasticsearch monitoring -# cluster. This requires xpack monitoring to be enabled in Elasticsearch. The -# reporting is disabled by default. - -# Set to true to enable the monitoring reporter. -#monitoring.enabled: false - -# Sets the UUID of the Elasticsearch cluster under which monitoring data for this -# Metricbeat instance will appear in the Stack Monitoring UI. If output.elasticsearch -# is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch. -#monitoring.cluster_uuid: - -# Uncomment to send the metrics to Elasticsearch. Most settings from the -# Elasticsearch output are accepted here as well. -# Note that the settings should point to your Elasticsearch *monitoring* cluster. -# Any setting that is not set is automatically inherited from the Elasticsearch -# output configuration, so if you have the Elasticsearch output configured such -# that it is pointing to your Elasticsearch monitoring cluster, you can simply -# uncomment the following line. -#monitoring.elasticsearch: - -#================================= Migration ================================== - -# This allows to enable 6.7 migration aliases -#migration.6_to_7.enabled: true +metricbeat.modules: + - &cloudfoundry + module: cloudfoundry + api_address: https://api.dev.cfdev.sh + skip_verify: true + client_id: firehose-to-filebeat + client_secret: verysecret + ssl: + verification_mode: none + metricsets: + - counter + +#processors: +# - add_cloudfoundry_metadata: +# <<: *cloudfoundry + +output.console: + pretty: true diff --git a/x-pack/metricbeat/module/cloudfoundry/cloudfoundry.go b/x-pack/metricbeat/module/cloudfoundry/cloudfoundry.go index 0cfe1bcff049..bc4fecde76d9 100644 --- a/x-pack/metricbeat/module/cloudfoundry/cloudfoundry.go +++ b/x-pack/metricbeat/module/cloudfoundry/cloudfoundry.go @@ -19,9 +19,10 @@ const ModuleName = "cloudfoundry" type Module struct { mb.BaseModule + log *logp.Logger + hub *cfcommon.Hub listener *cfcommon.RlpListener - listenerOn bool listenerLock sync.Mutex counterReporter mb.PushReporterV2 @@ -40,15 +41,21 @@ func newModule(base mb.BaseModule) (mb.Module, error) { if err := base.UnpackConfig(&cfg); err != nil { return nil, err } - hub := cfcommon.NewHub(&cfg, "metricbeat", logp.NewLogger("cloudfoundry")) - listener, err := hub.RlpListener(cfcommon.RlpListenerCallbacks{}) + + log := logp.NewLogger("cloudfoundry") + hub := cfcommon.NewHub(&cfg, "metricbeat", log) + + // early check that listener can be created + _, err := hub.RlpListener(cfcommon.RlpListenerCallbacks{}) if err != nil { return nil, err + } + return &Module{ BaseModule: base, + log: log, hub: hub, - listener: listener, }, nil } @@ -89,9 +96,9 @@ func (m *Module) RunContainerReporter(reporter mb.PushReporterV2) { } func (m *Module) runReporters(counterReporter, valueReporter, containerReporter mb.PushReporterV2) { - if m.listenerOn { + if m.listener != nil { m.listener.Stop() - m.listenerOn = false + m.listener = nil } m.counterReporter = counterReporter m.valueReporter = valueReporter @@ -127,7 +134,12 @@ func (m *Module) runReporters(counterReporter, valueReporter, containerReporter } } if start { - m.listener.Start(context.Background()) - m.listenerOn = true + l, err := m.hub.RlpListener(callbacks) + if err != nil { + m.log.Errorf("failed to create RlpListener: %v", err) + return + } + l.Start(context.Background()) + m.listener = l } } diff --git a/x-pack/metricbeat/module/cloudfoundry/container/container.go b/x-pack/metricbeat/module/cloudfoundry/container/container.go new file mode 100644 index 000000000000..1d92e9340cfd --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/container/container.go @@ -0,0 +1,45 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package container + +import ( + "fmt" + + "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry" + + "github.com/elastic/beats/metricbeat/mb" +) + +// init registers the MetricSet with the central registry. +// The New method will be called after the setup of the module and before starting to fetch data +func init() { + mb.Registry.MustAddMetricSet("cloudfoundry", "container", New, mb.DefaultMetricSet()) +} + +// MetricSet type defines all fields of the MetricSet +// As a minimum it must inherit the mb.BaseMetricSet fields, but can be extended with +// additional entries. These variables can be used to persist data or configuration between +// multiple fetch calls. +type MetricSet struct { + mb.BaseMetricSet + + mod *cloudfoundry.Module +} + +// New create a new instance of the MetricSet +// Part of new is also setting up the configuration by processing additional +// configuration entries if needed. +func New(base mb.BaseMetricSet) (mb.MetricSet, error) { + mod, ok := base.Module().(*cloudfoundry.Module) + if !ok { + return nil, fmt.Errorf("must be child of cloudfoundry module") + } + return &MetricSet{base, mod}, nil +} + +// Run method provides the module with a reporter with which events can be reported. +func (m *MetricSet) Run(reporter mb.PushReporterV2) { + m.mod.RunContainerReporter(reporter) +} diff --git a/x-pack/metricbeat/module/cloudfoundry/value/value.go b/x-pack/metricbeat/module/cloudfoundry/value/value.go new file mode 100644 index 000000000000..4df1e3bc304f --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/value/value.go @@ -0,0 +1,45 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package value + +import ( + "fmt" + + "github.com/elastic/beats/x-pack/metricbeat/module/cloudfoundry" + + "github.com/elastic/beats/metricbeat/mb" +) + +// init registers the MetricSet with the central registry. +// The New method will be called after the setup of the module and before starting to fetch data +func init() { + mb.Registry.MustAddMetricSet("cloudfoundry", "value", New, mb.DefaultMetricSet()) +} + +// MetricSet type defines all fields of the MetricSet +// As a minimum it must inherit the mb.BaseMetricSet fields, but can be extended with +// additional entries. These variables can be used to persist data or configuration between +// multiple fetch calls. +type MetricSet struct { + mb.BaseMetricSet + + mod *cloudfoundry.Module +} + +// New create a new instance of the MetricSet +// Part of new is also setting up the configuration by processing additional +// configuration entries if needed. +func New(base mb.BaseMetricSet) (mb.MetricSet, error) { + mod, ok := base.Module().(*cloudfoundry.Module) + if !ok { + return nil, fmt.Errorf("must be child of cloudfoundry module") + } + return &MetricSet{base, mod}, nil +} + +// Run method provides the module with a reporter with which events can be reported. +func (m *MetricSet) Run(reporter mb.PushReporterV2) { + m.mod.RunValueReporter(reporter) +} From ce7e84de9ca5b257458cfa6ef0345dea396b29c9 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 13:56:09 -0500 Subject: [PATCH 03/21] Add documentation. --- x-pack/metricbeat/metricbeat.yml | 3 +- .../metricbeat/module/azure/_meta/config.yml | 76 +++++--------- .../cloudfoundry/_meta/config.reference.yml | 33 +++++++ .../module/cloudfoundry/_meta/config.yml | 0 .../module/cloudfoundry/_meta/docs.asciidoc | 99 +++++++++++++++++++ .../module/cloudfoundry/_meta/fields.yml | 19 ++++ .../cloudfoundry/container/_meta/data.json | 35 +++++++ .../container/_meta/docs.asciidocs | 2 + .../cloudfoundry/container/_meta/fields.yml | 30 ++++++ .../cloudfoundry/counter/_meta/data.json | 16 ++- .../module/cloudfoundry/value/_meta/data.json | 29 ++++++ .../cloudfoundry/value/_meta/docs.asciidocs | 2 + .../cloudfoundry/value/_meta/fields.yml | 18 ++++ 13 files changed, 305 insertions(+), 57 deletions(-) create mode 100644 x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml create mode 100644 x-pack/metricbeat/module/cloudfoundry/_meta/config.yml create mode 100644 x-pack/metricbeat/module/cloudfoundry/_meta/docs.asciidoc create mode 100644 x-pack/metricbeat/module/cloudfoundry/_meta/fields.yml create mode 100644 x-pack/metricbeat/module/cloudfoundry/container/_meta/data.json create mode 100644 x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidocs create mode 100644 x-pack/metricbeat/module/cloudfoundry/container/_meta/fields.yml create mode 100644 x-pack/metricbeat/module/cloudfoundry/value/_meta/data.json create mode 100644 x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidocs create mode 100644 x-pack/metricbeat/module/cloudfoundry/value/_meta/fields.yml diff --git a/x-pack/metricbeat/metricbeat.yml b/x-pack/metricbeat/metricbeat.yml index cec3f83a4bf0..abe45145b765 100644 --- a/x-pack/metricbeat/metricbeat.yml +++ b/x-pack/metricbeat/metricbeat.yml @@ -2,13 +2,12 @@ metricbeat.modules: - &cloudfoundry module: cloudfoundry api_address: https://api.dev.cfdev.sh - skip_verify: true client_id: firehose-to-filebeat client_secret: verysecret ssl: verification_mode: none metricsets: - - counter + - value #processors: # - add_cloudfoundry_metadata: diff --git a/x-pack/metricbeat/module/azure/_meta/config.yml b/x-pack/metricbeat/module/azure/_meta/config.yml index 525e421369fd..0d96722e576d 100644 --- a/x-pack/metricbeat/module/azure/_meta/config.yml +++ b/x-pack/metricbeat/module/azure/_meta/config.yml @@ -1,59 +1,33 @@ -- module: azure +- module: cloudfoundry metricsets: - - monitor + - container + - counter + - value enabled: true - period: 300s - client_id: '${AZURE_CLIENT_ID:""}' - client_secret: '${AZURE_CLIENT_SECRET:""}' - tenant_id: '${AZURE_TENANT_ID:""}' - subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' - refresh_list_interval: 600s - resources: -# - resource_query: "resourceType eq 'Microsoft.DocumentDb/databaseAccounts'" -# metrics: -# - name: ["DataUsage", "DocumentCount", "DocumentQuota"] -# namespace: "Microsoft.DocumentDb/databaseAccounts" - -#- module: azure + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry # metricsets: -# - compute_vm +# - counter # enabled: true -# period: 300s -# client_id: '${AZURE_CLIENT_ID:""}' -# client_secret: '${AZURE_CLIENT_SECRET:""}' -# tenant_id: '${AZURE_TENANT_ID:""}' -# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' -# refresh_list_interval: 600s - -#- module: azure +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry # metricsets: -# - compute_vm_scaleset +# - counter # enabled: true -# period: 300s -# client_id: '${AZURE_CLIENT_ID:""}' -# client_secret: '${AZURE_CLIENT_SECRET:""}' -# tenant_id: '${AZURE_TENANT_ID:""}' -# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' -# refresh_list_interval: 600s - -#- module: azure +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry # metricsets: -# - storage +# - value # enabled: true -# period: 300s -# client_id: '${AZURE_CLIENT_ID:""}' -# client_secret: '${AZURE_CLIENT_SECRET:""}' -# tenant_id: '${AZURE_TENANT_ID:""}' -# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' -# refresh_list_interval: 600s - -#- module: azure -# metricsets: -# - database_account -# enabled: true -# period: 300s -# client_id: '${AZURE_CLIENT_ID:""}' -# client_secret: '${AZURE_CLIENT_SECRET:""}' -# tenant_id: '${AZURE_TENANT_ID:""}' -# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' -# refresh_list_interval: 600s +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml b/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml new file mode 100644 index 000000000000..0f2bfd2acaa6 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml @@ -0,0 +1,33 @@ +- module: cloudfoundry + metricsets: + - container + - counter + - value + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - counter + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - counter + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - value + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml b/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/docs.asciidoc b/x-pack/metricbeat/module/cloudfoundry/_meta/docs.asciidoc new file mode 100644 index 000000000000..30864d1da64c --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/_meta/docs.asciidoc @@ -0,0 +1,99 @@ +This is the cloudfoundry module. + +The Cloud Foundry module connects to Cloud Foundry loggregator to gather container, counter, and value metrics into a common data platform where it can be used for analysis, visualization, and alerting. + + +The cloudfoundry module metrics are numerical values that describe some aspect of a system at a particular point in time. They are collected when pushed from the loggregator and are identified with a timestamp, a name, a value, and one or more defining labels. + +The cloudfoundry module mericsets are `container`, `counter` and `value`. + +[float] +=== Module-specific configuration notes + +All metrics come from the Cloud Foundry loggregator API. The loggregator API authenticates through the Cloud Foundry UAA API. +This requires that a new client be added to UAA with the correct permissions. This can be done using the `uaac` client. + +[source,bash] +---- +$ export CLOUDFOUNDRY_CLIENT_ID=metricbeat +$ export CLOUDFOUNDRY_CLIENT_SECRET=yoursecret +$ uaac client add $CLOUDFOUNDRY_CLIENT_ID --name $CLOUDFOUNDRY_CLIENT_ID --secret $CLOUDFOUNDRY_CLIENT_SECRET --authorized_grant_types client_credentials,refresh_token --authorities doppler.firehose,cloud_controller.admin_read_only +---- + +Then configuration of the module needs to contain the created `client_id` and `client_secret`. + +[source,yaml] +---- +- module: cloudfoundry + api_address: https://api.dev.cfdev.sh + client_id: "${CLOUDFOUNDRY_CLIENT_ID}" + client_secret: "${CLOUDFOUNDRY_CLIENT_SECRET}" + ssl: + verification_mode: none +---- + + +[float] +== Metricsets + +[float] +=== `container` +The container metricset of Cloud Foundry module allows you to collect container metrics that the +loggregator sends to metricbeat. + +[float] +=== `counter` +The counter metricset of Cloud Foundry module allows you to collect counter metrics that the +loggregator sends to metricbeat. + +[float] +=== `value` +The value metricset of Cloud Foundry module allows you to collect value metrics that the +loggregator sends to metricbeat. + + +==== Configuration options + +The `cloudfoundry` input supports the following configuration options plus the +<<{beatname_lc}-input-{type}-common-options>> described later. + +[float] +==== `api_address` + +The URL of the Cloud Foundry API. Optional. Default: "http://api.bosh-lite.com". + +[float] +==== `doppler_address` + +The URL of the Cloud Foundry Doppler Websocket. Optional. Default: "(value from ${api_address}/v2/info)". + +[float] +==== `uaa_address` + +The URL of the Cloud Foundry UAA API. Optional. Default: "(value from ${api_address}/v2/info)". + +[float] +==== `rlp_address` + +The URL of the Cloud Foundry RLP Gateway. Optional. Default: "(value from ${api_address}/v2/info)". + +[float] +==== `client_id` + +Client ID to authenticate with Cloud Foundry. Default: "". + +[float] +==== `client_secret` + +Client Secret to authenticate with Cloud Foundry. Default: "". + +[float] +==== `shard_id` + +Shard ID for connection to the RLP Gateway. Use the same ID across multiple {beatname_lc} to shard the load of events +from the RLP Gateway. Default: "(generated UUID)". + +[float] +==== `ssl` + +This specifies SSL/TLS common config. Default: not used. diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/fields.yml b/x-pack/metricbeat/module/cloudfoundry/_meta/fields.yml new file mode 100644 index 000000000000..0190cac342e9 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/_meta/fields.yml @@ -0,0 +1,19 @@ +- key: cloudfoundry + title: "cloudfoundry" + description: > + Cloud Foundry module + release: experimental + fields: + - name: cloudfoundry + type: group + description: > + fields: + - name: app + type: group + description: > + The application the metric is associated with. + fields: + - name: id + type: keyword + description: > + The ID of the application. diff --git a/x-pack/metricbeat/module/cloudfoundry/container/_meta/data.json b/x-pack/metricbeat/module/cloudfoundry/container/_meta/data.json new file mode 100644 index 000000000000..3d1f51694e40 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/container/_meta/data.json @@ -0,0 +1,35 @@ +{ + "@timestamp": "2020-02-27T18:09:35.583Z", + "cloudfoundry": { + "container": { + "instance_index": 0, + "cpu.pct": 0.18815706013687805, + "memory.bytes": 23320985, + "memory.quota.bytes": 134217728, + "disk.bytes": 186187776, + "timestamp": "2020-02-27T18:09:35.583Z", + "type": "container", + "disk.quota.bytes": 2122136037 + }, + "envelope": { + "origin": "rep", + "deployment": "cf", + "ip": "10.144.0.13", + "job": "diego-cell", + "index": "3a0034ac-59ef-43e2-8b06-b14b32fe62f0" + }, + "app": { + "id": "8cfc6857-3576-45a9-b1cd-890b28aa9c4a" + } + }, + "event": { + "dataset": "cloudfoundry.container", + "module": "cloudfoundry" + }, + "metricset": { + "name": "container" + }, + "service": { + "type": "cloudfoundry" + } +} diff --git a/x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidocs b/x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidocs new file mode 100644 index 000000000000..defeb16cae61 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidocs @@ -0,0 +1,2 @@ +The container metricset of Cloud Foundry module allows you to collect container metrics that the +loggregator sends to metricbeat. diff --git a/x-pack/metricbeat/module/cloudfoundry/container/_meta/fields.yml b/x-pack/metricbeat/module/cloudfoundry/container/_meta/fields.yml new file mode 100644 index 000000000000..7711469f160b --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/container/_meta/fields.yml @@ -0,0 +1,30 @@ +- name: container + type: group + description: > + `container` contains container metrics from Cloud Foundry. + release: experimental + fields: + - name: instance_index + type: long + description: > + Index of the instance the metric belongs to. + - name: cpu.pct + type: float + description: > + CPU usage percentage. + - name: memory.bytes + type: long + description: > + Bytes of used memory. + - name: memory.quota.bytes + type: long + description: > + Bytes of available memory. + - name: disk.bytes + type: long + description: > + Bytes of used storage. + - name: disk.quota.bytes + type: long + description: > + Bytes of available storage. diff --git a/x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json index 4f515c7bfa93..d6f155213af8 100644 --- a/x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json +++ b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json @@ -1,15 +1,23 @@ { - "@timestamp": "2020-02-26T08:05:34.853Z", + "@timestamp": "2020-02-24T18:49:02.674Z", "cloudfoundry": { "counter": { - "name": "", + "total": 0, + "name": "promhttp_metric_handler_errors_total", "delta": 0, - "total": 0 + "timestamp": "2020-02-24T18:49:02.674Z", + "type": "counter" + }, + "envelope": { + "origin": "loggregator_forwarder_agent", + "deployment": "cf", + "ip": "10.144.0.13", + "job": "diego-cell", + "index": "1e58e943-a498-4339-9d5f-2885bf223db9" } }, "event": { "dataset": "cloudfoundry.counter", - "duration": 115000, "module": "cloudfoundry" }, "metricset": { diff --git a/x-pack/metricbeat/module/cloudfoundry/value/_meta/data.json b/x-pack/metricbeat/module/cloudfoundry/value/_meta/data.json new file mode 100644 index 000000000000..bf70762fd387 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/value/_meta/data.json @@ -0,0 +1,29 @@ +{ + "@timestamp": "2020-02-27T18:20:48.379Z", + "cloudfoundry": { + "value": { + "unit": "", + "value": 5.125735912782789e-05, + "timestamp": "2020-02-27T18:20:48.379Z", + "type": "value", + "name": "go_memstats_gc_cpu_fraction" + }, + "envelope": { + "origin": "loggregator_forwarder_agent", + "deployment": "cf", + "ip": "10.144.0.11", + "job": "scheduler", + "index": "d6b7bb59-ac57-4ed5-a0a7-0b23e19d9f8f" + } + }, + "event": { + "dataset": "cloudfoundry.value", + "module": "cloudfoundry" + }, + "metricset": { + "name": "value" + }, + "service": { + "type": "cloudfoundry" + } +} diff --git a/x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidocs b/x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidocs new file mode 100644 index 000000000000..0332945c2c07 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidocs @@ -0,0 +1,2 @@ +The value metricset of Cloud Foundry module allows you to collect value metrics that the +loggregator sends to metricbeat. diff --git a/x-pack/metricbeat/module/cloudfoundry/value/_meta/fields.yml b/x-pack/metricbeat/module/cloudfoundry/value/_meta/fields.yml new file mode 100644 index 000000000000..0ba9f29890a3 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/value/_meta/fields.yml @@ -0,0 +1,18 @@ +- name: value + type: group + description: > + `value` contains counter metrics from Cloud Foundry. + release: experimental + fields: + - name: name + type: keyword + description: > + The name of the value. + - name: unit + type: keyword + description: > + The unit of the value. + - name: value + type: float + description: > + The value of the value. From 66ac24ed408a21db36293829ec5d1bb8284ecd8b Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 14:07:42 -0500 Subject: [PATCH 04/21] Revert metricbeat.yml. --- x-pack/metricbeat/metricbeat.yml | 182 ++++++++++++++++++++++++++++--- 1 file changed, 165 insertions(+), 17 deletions(-) diff --git a/x-pack/metricbeat/metricbeat.yml b/x-pack/metricbeat/metricbeat.yml index abe45145b765..5bd19f3030c2 100644 --- a/x-pack/metricbeat/metricbeat.yml +++ b/x-pack/metricbeat/metricbeat.yml @@ -1,17 +1,165 @@ -metricbeat.modules: - - &cloudfoundry - module: cloudfoundry - api_address: https://api.dev.cfdev.sh - client_id: firehose-to-filebeat - client_secret: verysecret - ssl: - verification_mode: none - metricsets: - - value - -#processors: -# - add_cloudfoundry_metadata: -# <<: *cloudfoundry - -output.console: - pretty: true +###################### Metricbeat Configuration Example ####################### + +# This file is an example configuration file highlighting only the most common +# options. The metricbeat.reference.yml file from the same directory contains all the +# supported options with more comments. You can use it as a reference. +# +# You can find the full configuration reference here: +# https://www.elastic.co/guide/en/beats/metricbeat/index.html + +#========================== Modules configuration ============================ + +metricbeat.config.modules: + # Glob pattern for configuration loading + path: ${path.config}/modules.d/*.yml + + # Set to true to enable config reloading + reload.enabled: false + + # Period on which files under path should be checked for changes + #reload.period: 10s + +#==================== Elasticsearch template setting ========================== + +setup.template.settings: + index.number_of_shards: 1 + index.codec: best_compression + #_source.enabled: false + +#================================ General ===================================== + +# The name of the shipper that publishes the network data. It can be used to group +# all the transactions sent by a single shipper in the web interface. +#name: + +# The tags of the shipper are included in their own field with each +# transaction published. +#tags: ["service-X", "web-tier"] + +# Optional fields that you can specify to add additional information to the +# output. +#fields: +# env: staging + + +#============================== Dashboards ===================================== +# These settings control loading the sample dashboards to the Kibana index. Loading +# the dashboards is disabled by default and can be enabled either by setting the +# options here or by using the `setup` command. +#setup.dashboards.enabled: false + +# The URL from where to download the dashboards archive. By default this URL +# has a value which is computed based on the Beat name and version. For released +# versions, this URL points to the dashboard archive on the artifacts.elastic.co +# website. +#setup.dashboards.url: + +#============================== Kibana ===================================== + +# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API. +# This requires a Kibana endpoint configuration. +setup.kibana: + + # Kibana Host + # Scheme and port can be left out and will be set to the default (http and 5601) + # In case you specify and additional path, the scheme is required: http://localhost:5601/path + # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601 + #host: "localhost:5601" + + # Kibana Space ID + # ID of the Kibana Space into which the dashboards should be loaded. By default, + # the Default Space will be used. + #space.id: + +#============================= Elastic Cloud ================================== + +# These settings simplify using Metricbeat with the Elastic Cloud (https://cloud.elastic.co/). + +# The cloud.id setting overwrites the `output.elasticsearch.hosts` and +# `setup.kibana.host` options. +# You can find the `cloud.id` in the Elastic Cloud web UI. +#cloud.id: + +# The cloud.auth setting overwrites the `output.elasticsearch.username` and +# `output.elasticsearch.password` settings. The format is `:`. +#cloud.auth: + +#================================ Outputs ===================================== + +# Configure what output to use when sending the data collected by the beat. + +#-------------------------- Elasticsearch output ------------------------------ +output.elasticsearch: + # Array of hosts to connect to. + hosts: ["localhost:9200"] + + # Protocol - either `http` (default) or `https`. + #protocol: "https" + + # Authentication credentials - either API key or username/password. + #api_key: "id:api_key" + #username: "elastic" + #password: "changeme" + +#----------------------------- Logstash output -------------------------------- +#output.logstash: + # The Logstash hosts + #hosts: ["localhost:5044"] + + # Optional SSL. By default is off. + # List of root certificates for HTTPS server verifications + #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] + + # Certificate for SSL client authentication + #ssl.certificate: "/etc/pki/client/cert.pem" + + # Client Certificate Key + #ssl.key: "/etc/pki/client/cert.key" + +#================================ Processors ===================================== + +# Configure processors to enhance or manipulate events generated by the beat. + +processors: + - add_host_metadata: ~ + - add_cloud_metadata: ~ + - add_docker_metadata: ~ + - add_kubernetes_metadata: ~ + +#================================ Logging ===================================== + +# Sets log level. The default log level is info. +# Available log levels are: error, warning, info, debug +#logging.level: debug + +# At debug level, you can selectively enable logging only for some components. +# To enable all selectors use ["*"]. Examples of other selectors are "beat", +# "publish", "service". +#logging.selectors: ["*"] + +#============================== X-Pack Monitoring =============================== +# metricbeat can export internal metrics to a central Elasticsearch monitoring +# cluster. This requires xpack monitoring to be enabled in Elasticsearch. The +# reporting is disabled by default. + +# Set to true to enable the monitoring reporter. +#monitoring.enabled: false + +# Sets the UUID of the Elasticsearch cluster under which monitoring data for this +# Metricbeat instance will appear in the Stack Monitoring UI. If output.elasticsearch +# is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch. +#monitoring.cluster_uuid: + +# Uncomment to send the metrics to Elasticsearch. Most settings from the +# Elasticsearch output are accepted here as well. +# Note that the settings should point to your Elasticsearch *monitoring* cluster. +# Any setting that is not set is automatically inherited from the Elasticsearch +# output configuration, so if you have the Elasticsearch output configured such +# that it is pointing to your Elasticsearch monitoring cluster, you can simply +# uncomment the following line. +#monitoring.elasticsearch: + +#================================= Migration ================================== + +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: true From 8e0fdf0a39ff7a3ef7f414bc271c3ec90cd7a246 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 15:22:16 -0500 Subject: [PATCH 05/21] Run make update. --- metricbeat/docs/modules_list.asciidoc | 486 +++++++++++++------------- 1 file changed, 244 insertions(+), 242 deletions(-) diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 5587b923345e..a4276444c297 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -4,248 +4,249 @@ This file is generated! See scripts/mage/docs_collector.go [options="header"] |=== -|Modules |Dashboards |Metricsets -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.13+| .13+| |<> beta[] -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] -|<> -|<> beta[] -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.13+| .13+| |<> -|<> -|<> -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.9+| .9+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.11+| .11+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.4+| .4+| |<> -|<> beta[] -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.5+| .5+| |<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> beta[] -|<> beta[] -|<> -|<> -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.21+| .21+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> experimental[] -|<> -|<> -|<> -|<> experimental[] -|<> -|<> experimental[] -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.17+| .17+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> -|<> +|Modules |Dashboards |Metricsets +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.13+| .13+| |<> beta[] +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] +|<> +|<> beta[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.13+| .13+| |<> +|<> +|<> +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> +|<> +|<> +|<> +|<> experimental[] |image:./images/icon-no.png[No prebuilt dashboards] | +.0+| .0+| |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.9+| .9+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.11+| .11+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.4+| .4+| |<> +|<> beta[] +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.5+| .5+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> beta[] +|<> beta[] +|<> +|<> +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.21+| .21+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> experimental[] +|<> +|<> +|<> +|<> experimental[] +|<> +|<> experimental[] +|<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.17+| .17+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> +|<> |=== -- @@ -258,6 +259,7 @@ include::modules/aws.asciidoc[] include::modules/azure.asciidoc[] include::modules/beat.asciidoc[] include::modules/ceph.asciidoc[] +include::modules/cloudfoundry.asciidoc[] include::modules/cockroachdb.asciidoc[] include::modules/consul.asciidoc[] include::modules/coredns.asciidoc[] From b3be6f75d9aeb36dfd87701c8b1904882334b937 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 16:45:39 -0500 Subject: [PATCH 06/21] Fix documentation add changelog. --- CHANGELOG.next.asciidoc | 1 + metricbeat/docs/fields.asciidoc | 172 ++++++ metricbeat/docs/modules/cloudfoundry.asciidoc | 172 ++++++ .../modules/cloudfoundry/container.asciidoc | 24 + .../modules/cloudfoundry/counter.asciidoc | 24 + .../docs/modules/cloudfoundry/value.asciidoc | 24 + metricbeat/docs/modules_list.asciidoc | 489 +++++++++--------- .../module/cloudfoundry/_meta/docs.asciidoc | 22 +- .../_meta/{docs.asciidocs => docs.asciidoc} | 0 .../_meta/{docs.asciidocs => docs.asciidoc} | 0 x-pack/metricbeat/module/cloudfoundry/doc.go | 8 + .../_meta/{docs.asciidocs => docs.asciidoc} | 0 12 files changed, 682 insertions(+), 254 deletions(-) create mode 100644 metricbeat/docs/modules/cloudfoundry.asciidoc create mode 100644 metricbeat/docs/modules/cloudfoundry/container.asciidoc create mode 100644 metricbeat/docs/modules/cloudfoundry/counter.asciidoc create mode 100644 metricbeat/docs/modules/cloudfoundry/value.asciidoc rename x-pack/metricbeat/module/cloudfoundry/container/_meta/{docs.asciidocs => docs.asciidoc} (100%) rename x-pack/metricbeat/module/cloudfoundry/counter/_meta/{docs.asciidocs => docs.asciidoc} (100%) create mode 100644 x-pack/metricbeat/module/cloudfoundry/doc.go rename x-pack/metricbeat/module/cloudfoundry/value/_meta/{docs.asciidocs => docs.asciidoc} (100%) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index d0fb43689a40..d402ef18b2f0 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -193,6 +193,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add filtering option for prometheus collector. {pull}16420[16420] - Add metricsets based on Ceph Manager Daemon to the `ceph` module. {issue}7723[7723] {pull}16254[16254] - Release `statsd` module as GA. {pull}16447[16447] {issue}14280[14280] +- Add `cloudfoundry` module to send events from Cloud Foundry. {pull}16671[16671] *Packetbeat* diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index cec790b06bff..c2e3dccf8b35 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -22,6 +22,7 @@ grouped in the following categories: * <> * <> * <> +* <> * <> * <> * <> @@ -4590,6 +4591,177 @@ alias to: cloud.region -- +[[exported-fields-cloudfoundry]] +== cloudfoundry fields + +Cloud Foundry module + + + +[float] +=== cloudfoundry + + + + +[float] +=== app + +The application the metric is associated with. + + + +*`cloudfoundry.app.id`*:: ++ +-- +The ID of the application. + + +type: keyword + +-- + +[float] +=== container + +`container` contains container metrics from Cloud Foundry. + + + +*`cloudfoundry.container.instance_index`*:: ++ +-- +Index of the instance the metric belongs to. + + +type: long + +-- + +*`cloudfoundry.container.cpu.pct`*:: ++ +-- +CPU usage percentage. + + +type: float + +-- + +*`cloudfoundry.container.memory.bytes`*:: ++ +-- +Bytes of used memory. + + +type: long + +-- + +*`cloudfoundry.container.memory.quota.bytes`*:: ++ +-- +Bytes of available memory. + + +type: long + +-- + +*`cloudfoundry.container.disk.bytes`*:: ++ +-- +Bytes of used storage. + + +type: long + +-- + +*`cloudfoundry.container.disk.quota.bytes`*:: ++ +-- +Bytes of available storage. + + +type: long + +-- + +[float] +=== counter + +`counter` contains counter metrics from Cloud Foundry. + + + +*`cloudfoundry.counter.name`*:: ++ +-- +The name of the counter. + + +type: keyword + +-- + +*`cloudfoundry.counter.delta`*:: ++ +-- +The difference between the last time the counter event occurred. + + +type: long + +-- + +*`cloudfoundry.counter.total`*:: ++ +-- +The total value for the counter. + + +type: long + +-- + +[float] +=== value + +`value` contains counter metrics from Cloud Foundry. + + + +*`cloudfoundry.value.name`*:: ++ +-- +The name of the value. + + +type: keyword + +-- + +*`cloudfoundry.value.unit`*:: ++ +-- +The unit of the value. + + +type: keyword + +-- + +*`cloudfoundry.value.value`*:: ++ +-- +The value of the value. + + +type: float + +-- + [[exported-fields-cockroachdb]] == CockroachDB fields diff --git a/metricbeat/docs/modules/cloudfoundry.asciidoc b/metricbeat/docs/modules/cloudfoundry.asciidoc new file mode 100644 index 000000000000..512eab6e98ab --- /dev/null +++ b/metricbeat/docs/modules/cloudfoundry.asciidoc @@ -0,0 +1,172 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-module-cloudfoundry]] +[role="xpack"] +== cloudfoundry module + +experimental[] + +This is the cloudfoundry module. + +The Cloud Foundry module connects to Cloud Foundry loggregator to gather container, counter, and value metrics into a common data platform where it can be used for analysis, visualization, and alerting. + + +The cloudfoundry module metrics are numerical values that describe some aspect of a system at a particular point in time. They are collected when pushed from the loggregator and are identified with a timestamp, a name, a value, and one or more defining labels. + +The cloudfoundry module mericsets are `container`, `counter` and `value`. + +[float] +=== Module-specific configuration notes + +All metrics come from the Cloud Foundry loggregator API. The loggregator API authenticates through the Cloud Foundry UAA API. +This requires that a new client be added to UAA with the correct permissions. This can be done using the `uaac` client. + +[source,bash] +---- +$ export CLOUDFOUNDRY_CLIENT_ID=metricbeat +$ export CLOUDFOUNDRY_CLIENT_SECRET=yoursecret +$ uaac client add $CLOUDFOUNDRY_CLIENT_ID --name $CLOUDFOUNDRY_CLIENT_ID --secret $CLOUDFOUNDRY_CLIENT_SECRET --authorized_grant_types client_credentials,refresh_token --authorities doppler.firehose,cloud_controller.admin_read_only +---- + +Then configuration of the module needs to contain the created `client_id` and `client_secret`. + +[source,yaml] +---- +- module: cloudfoundry + api_address: https://api.dev.cfdev.sh + client_id: "${CLOUDFOUNDRY_CLIENT_ID}" + client_secret: "${CLOUDFOUNDRY_CLIENT_SECRET}" + ssl: + verification_mode: none +---- + + +[float] +== Metricsets + +[float] +=== `container` +The container metricset of Cloud Foundry module allows you to collect container metrics that the +loggregator sends to metricbeat. + +[float] +=== `counter` +The counter metricset of Cloud Foundry module allows you to collect counter metrics that the +loggregator sends to metricbeat. + +[float] +=== `value` +The value metricset of Cloud Foundry module allows you to collect value metrics that the +loggregator sends to metricbeat. + + +[float] +== Configuration options + +The `cloudfoundry` input supports the following configuration options. + +[float] +=== `api_address` + +The URL of the Cloud Foundry API. Optional. Default: "http://api.bosh-lite.com". + +[float] +=== `doppler_address` + +The URL of the Cloud Foundry Doppler Websocket. Optional. Default: "(value from ${api_address}/v2/info)". + +[float] +=== `uaa_address` + +The URL of the Cloud Foundry UAA API. Optional. Default: "(value from ${api_address}/v2/info)". + +[float] +=== `rlp_address` + +The URL of the Cloud Foundry RLP Gateway. Optional. Default: "(value from ${api_address}/v2/info)". + +[float] +=== `client_id` + +Client ID to authenticate with Cloud Foundry. Default: "". + +[float] +=== `client_secret` + +Client Secret to authenticate with Cloud Foundry. Default: "". + +[float] +=== `shard_id` + +Shard ID for connection to the RLP Gateway. Use the same ID across multiple {beatname_lc} to shard the load of events +from the RLP Gateway. Default: "(generated UUID)". + +[float] +=== `ssl` + +This specifies SSL/TLS common config. Default: not used. + + +[float] +=== Example configuration + +The cloudfoundry module supports the standard configuration options that are described +in <>. Here is an example configuration: + +[source,yaml] +---- +metricbeat.modules: +- module: cloudfoundry + metricsets: + - container + - counter + - value + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - counter + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - counter + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - value + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +---- + +[float] +=== Metricsets + +The following metricsets are available: + +* <> + +* <> + +* <> + +include::cloudfoundry/container.asciidoc[] + +include::cloudfoundry/counter.asciidoc[] + +include::cloudfoundry/value.asciidoc[] + diff --git a/metricbeat/docs/modules/cloudfoundry/container.asciidoc b/metricbeat/docs/modules/cloudfoundry/container.asciidoc new file mode 100644 index 000000000000..99e55464986d --- /dev/null +++ b/metricbeat/docs/modules/cloudfoundry/container.asciidoc @@ -0,0 +1,24 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-cloudfoundry-container]] +=== cloudfoundry container metricset + +experimental[] + +include::../../../../x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidoc[] + +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../../x-pack/metricbeat/module/cloudfoundry/container/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules/cloudfoundry/counter.asciidoc b/metricbeat/docs/modules/cloudfoundry/counter.asciidoc new file mode 100644 index 000000000000..254fbb4c9504 --- /dev/null +++ b/metricbeat/docs/modules/cloudfoundry/counter.asciidoc @@ -0,0 +1,24 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-cloudfoundry-counter]] +=== cloudfoundry counter metricset + +experimental[] + +include::../../../../x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidoc[] + +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../../x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules/cloudfoundry/value.asciidoc b/metricbeat/docs/modules/cloudfoundry/value.asciidoc new file mode 100644 index 000000000000..4c25ef3df340 --- /dev/null +++ b/metricbeat/docs/modules/cloudfoundry/value.asciidoc @@ -0,0 +1,24 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-cloudfoundry-value]] +=== cloudfoundry value metricset + +experimental[] + +include::../../../../x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidoc[] + +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../../x-pack/metricbeat/module/cloudfoundry/value/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index a4276444c297..31970139d137 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -4,249 +4,252 @@ This file is generated! See scripts/mage/docs_collector.go [options="header"] |=== -|Modules |Dashboards |Metricsets -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.13+| .13+| |<> beta[] -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] -|<> -|<> beta[] -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.13+| .13+| |<> -|<> -|<> -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> -|<> -|<> -|<> -|<> experimental[] |image:./images/icon-no.png[No prebuilt dashboards] | -.0+| .0+| |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.9+| .9+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.11+| .11+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.4+| .4+| |<> -|<> beta[] -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.5+| .5+| |<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> beta[] -|<> beta[] -|<> -|<> -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.21+| .21+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> experimental[] -|<> -|<> -|<> -|<> experimental[] -|<> -|<> experimental[] -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.17+| .17+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> -|<> +|Modules |Dashboards |Metricsets +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.13+| .13+| |<> beta[] +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] +|<> +|<> beta[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.13+| .13+| |<> +|<> +|<> +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> +|<> +|<> +|<> +|<> experimental[] |image:./images/icon-no.png[No prebuilt dashboards] | +.3+| .3+| |<> experimental[] +|<> experimental[] +|<> experimental[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.9+| .9+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.11+| .11+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.4+| .4+| |<> +|<> beta[] +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.5+| .5+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> beta[] +|<> beta[] +|<> +|<> +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.21+| .21+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> experimental[] +|<> +|<> +|<> +|<> experimental[] +|<> +|<> experimental[] +|<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.17+| .17+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> +|<> |=== -- diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/docs.asciidoc b/x-pack/metricbeat/module/cloudfoundry/_meta/docs.asciidoc index 30864d1da64c..762d3e4f34f4 100644 --- a/x-pack/metricbeat/module/cloudfoundry/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/cloudfoundry/_meta/docs.asciidoc @@ -52,48 +52,48 @@ The value metricset of Cloud Foundry module allows you to collect value metrics loggregator sends to metricbeat. -==== Configuration options +[float] +== Configuration options -The `cloudfoundry` input supports the following configuration options plus the -<<{beatname_lc}-input-{type}-common-options>> described later. +The `cloudfoundry` input supports the following configuration options. [float] -==== `api_address` +=== `api_address` The URL of the Cloud Foundry API. Optional. Default: "http://api.bosh-lite.com". [float] -==== `doppler_address` +=== `doppler_address` The URL of the Cloud Foundry Doppler Websocket. Optional. Default: "(value from ${api_address}/v2/info)". [float] -==== `uaa_address` +=== `uaa_address` The URL of the Cloud Foundry UAA API. Optional. Default: "(value from ${api_address}/v2/info)". [float] -==== `rlp_address` +=== `rlp_address` The URL of the Cloud Foundry RLP Gateway. Optional. Default: "(value from ${api_address}/v2/info)". [float] -==== `client_id` +=== `client_id` Client ID to authenticate with Cloud Foundry. Default: "". [float] -==== `client_secret` +=== `client_secret` Client Secret to authenticate with Cloud Foundry. Default: "". [float] -==== `shard_id` +=== `shard_id` Shard ID for connection to the RLP Gateway. Use the same ID across multiple {beatname_lc} to shard the load of events from the RLP Gateway. Default: "(generated UUID)". [float] -==== `ssl` +=== `ssl` This specifies SSL/TLS common config. Default: not used. diff --git a/x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidocs b/x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidoc similarity index 100% rename from x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidocs rename to x-pack/metricbeat/module/cloudfoundry/container/_meta/docs.asciidoc diff --git a/x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidocs b/x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidoc similarity index 100% rename from x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidocs rename to x-pack/metricbeat/module/cloudfoundry/counter/_meta/docs.asciidoc diff --git a/x-pack/metricbeat/module/cloudfoundry/doc.go b/x-pack/metricbeat/module/cloudfoundry/doc.go new file mode 100644 index 000000000000..a91b647f36a4 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/doc.go @@ -0,0 +1,8 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +/* +Package cloudfoundry is a Metricbeat module that contains MetricSets. +*/ +package cloudfoundry diff --git a/x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidocs b/x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidoc similarity index 100% rename from x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidocs rename to x-pack/metricbeat/module/cloudfoundry/value/_meta/docs.asciidoc From cbc4c67dc2c983c07966de602c7e6f06df02b42d Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 16:47:36 -0500 Subject: [PATCH 07/21] Fix bad change in azure module. --- .../metricbeat/module/azure/_meta/config.yml | 76 +++++++++++++------ .../module/cloudfoundry/_meta/config.yml | 33 ++++++++ 2 files changed, 84 insertions(+), 25 deletions(-) diff --git a/x-pack/metricbeat/module/azure/_meta/config.yml b/x-pack/metricbeat/module/azure/_meta/config.yml index 0d96722e576d..525e421369fd 100644 --- a/x-pack/metricbeat/module/azure/_meta/config.yml +++ b/x-pack/metricbeat/module/azure/_meta/config.yml @@ -1,33 +1,59 @@ -- module: cloudfoundry +- module: azure metricsets: - - container - - counter - - value + - monitor enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry + period: 300s + client_id: '${AZURE_CLIENT_ID:""}' + client_secret: '${AZURE_CLIENT_SECRET:""}' + tenant_id: '${AZURE_TENANT_ID:""}' + subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' + refresh_list_interval: 600s + resources: +# - resource_query: "resourceType eq 'Microsoft.DocumentDb/databaseAccounts'" +# metrics: +# - name: ["DataUsage", "DocumentCount", "DocumentQuota"] +# namespace: "Microsoft.DocumentDb/databaseAccounts" + +#- module: azure # metricsets: -# - counter +# - compute_vm # enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry +# period: 300s +# client_id: '${AZURE_CLIENT_ID:""}' +# client_secret: '${AZURE_CLIENT_SECRET:""}' +# tenant_id: '${AZURE_TENANT_ID:""}' +# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' +# refresh_list_interval: 600s + +#- module: azure # metricsets: -# - counter +# - compute_vm_scaleset # enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry +# period: 300s +# client_id: '${AZURE_CLIENT_ID:""}' +# client_secret: '${AZURE_CLIENT_SECRET:""}' +# tenant_id: '${AZURE_TENANT_ID:""}' +# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' +# refresh_list_interval: 600s + +#- module: azure # metricsets: -# - value +# - storage # enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# period: 300s +# client_id: '${AZURE_CLIENT_ID:""}' +# client_secret: '${AZURE_CLIENT_SECRET:""}' +# tenant_id: '${AZURE_TENANT_ID:""}' +# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' +# refresh_list_interval: 600s + +#- module: azure +# metricsets: +# - database_account +# enabled: true +# period: 300s +# client_id: '${AZURE_CLIENT_ID:""}' +# client_secret: '${AZURE_CLIENT_SECRET:""}' +# tenant_id: '${AZURE_TENANT_ID:""}' +# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}' +# refresh_list_interval: 600s diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml b/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml index e69de29bb2d1..0d96722e576d 100644 --- a/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml +++ b/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml @@ -0,0 +1,33 @@ +- module: cloudfoundry + metricsets: + - container + - counter + - value + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry +# metricsets: +# - counter +# enabled: true +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry +# metricsets: +# - counter +# enabled: true +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry +# metricsets: +# - value +# enabled: true +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' From f9a3f21f3850c3c0859fafe9f2a91cb20f058e11 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 20:11:53 -0500 Subject: [PATCH 08/21] Run make update. --- x-pack/metricbeat/metricbeat.reference.yml | 35 ++++++++++++++++++ .../metricbeat/module/cloudfoundry/fields.go | 23 ++++++++++++ .../modules.d/cloudfoundry.yml.disabled | 36 +++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 x-pack/metricbeat/module/cloudfoundry/fields.go create mode 100644 x-pack/metricbeat/modules.d/cloudfoundry.yml.disabled diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index ed863b7d970c..58ff75ad49cb 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -296,6 +296,41 @@ metricbeat.modules: hosts: ["localhost:5000"] enabled: true +#----------------------------- Cloudfoundry Module ----------------------------- +- module: cloudfoundry + metricsets: + - container + - counter + - value + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - counter + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - counter + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + +- module: cloudfoundry + metricsets: + - value + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' + #----------------------------- CockroachDB Module ----------------------------- - module: cockroachdb metricsets: ['status'] diff --git a/x-pack/metricbeat/module/cloudfoundry/fields.go b/x-pack/metricbeat/module/cloudfoundry/fields.go new file mode 100644 index 000000000000..a40c34451725 --- /dev/null +++ b/x-pack/metricbeat/module/cloudfoundry/fields.go @@ -0,0 +1,23 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// Code generated by beats/dev-tools/cmd/asset/asset.go - DO NOT EDIT. + +package cloudfoundry + +import ( + "github.com/elastic/beats/libbeat/asset" +) + +func init() { + if err := asset.SetFields("metricbeat", "cloudfoundry", asset.ModuleFieldsPri, AssetCloudfoundry); err != nil { + panic(err) + } +} + +// AssetCloudfoundry returns asset data. +// This is the base64 encoded gzipped contents of module/cloudfoundry. +func AssetCloudfoundry() string { + return "eJzclbFy2zAQRHt+xY178wNYpIgzmXGXwqljCFhKGIEAAxwk8+8zoESbpCDFCWUVVqHiAL5d7uGIe9qiq0gaF1XtolW+K4hYs0FFd+PyXUGkEKTXLWtnK/pSEBE9pC30/bCHGqeiQUHkYSACKsJLC68bWBamIKo1jApV/+g9WdHgRDz9uGtR0dq72B4rGekpbUwUbftay8HOAg+/pw0Swmgp0jLxBtSAvZakA4kQnNSCoWiveVOOHp37GXvSalIebG3R7Z2fr10wNxh8/Eau7q2NrJYnUUhnWWgLvySQ51fK8wAMb+RjNoFq75rpgRiHc+5IvCs8G1hYiV/aKrxkgzTOrv8pxceEGjIcBMa9XiExA7Ers6ZkG8tWctZNbZyYr/ylqQ8/flIMYg1q4WVKZ428cIPG+a5cdYxwnSzoa2KlMGKAGgQuif+OjsXHWBA7oY1YGVz0oXTYfmAEgZ0/24Be+yYJnNh4m+toefFU94zJTPeVG0x0+r/uBzERh3E+vseZ7sGwuFLLkrDSdQ2P9PVYgffA4cYwIjCxbjB2RNjBMjkpo/dQeYPspjkuNdjzaCdMBNXO5xMaxPtti45VT/iEh6p/r3zHotX5e+C/hRPxHcLzbtGSG+hp0JoJ/wkAAP//aoqyCQ==" +} diff --git a/x-pack/metricbeat/modules.d/cloudfoundry.yml.disabled b/x-pack/metricbeat/modules.d/cloudfoundry.yml.disabled new file mode 100644 index 000000000000..513d201d0a47 --- /dev/null +++ b/x-pack/metricbeat/modules.d/cloudfoundry.yml.disabled @@ -0,0 +1,36 @@ +# Module: cloudfoundry +# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-cloudfoundry.html + +- module: cloudfoundry + metricsets: + - container + - counter + - value + enabled: true + api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' + client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry +# metricsets: +# - counter +# enabled: true +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry +# metricsets: +# - counter +# enabled: true +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' +# +#- module: cloudfoundry +# metricsets: +# - value +# enabled: true +# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' +# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' +# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' From 99be099c80aeb79d2d740da96f38c654aa500e86 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 27 Feb 2020 20:15:02 -0500 Subject: [PATCH 09/21] Improve reference config. --- metricbeat/docs/modules/cloudfoundry.asciidoc | 24 ------------------- x-pack/metricbeat/metricbeat.reference.yml | 24 ------------------- .../cloudfoundry/_meta/config.reference.yml | 24 ------------------- .../module/cloudfoundry/_meta/config.yml | 24 ------------------- .../modules.d/cloudfoundry.yml.disabled | 24 ------------------- 5 files changed, 120 deletions(-) diff --git a/metricbeat/docs/modules/cloudfoundry.asciidoc b/metricbeat/docs/modules/cloudfoundry.asciidoc index 512eab6e98ab..ac1efe5d0646 100644 --- a/metricbeat/docs/modules/cloudfoundry.asciidoc +++ b/metricbeat/docs/modules/cloudfoundry.asciidoc @@ -127,30 +127,6 @@ metricbeat.modules: api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - -- module: cloudfoundry - metricsets: - - counter - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - -- module: cloudfoundry - metricsets: - - counter - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - -- module: cloudfoundry - metricsets: - - value - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' ---- [float] diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index 58ff75ad49cb..b88f7fb4464c 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -307,30 +307,6 @@ metricbeat.modules: client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -- module: cloudfoundry - metricsets: - - counter - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - -- module: cloudfoundry - metricsets: - - counter - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - -- module: cloudfoundry - metricsets: - - value - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - #----------------------------- CockroachDB Module ----------------------------- - module: cockroachdb metricsets: ['status'] diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml b/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml index 0f2bfd2acaa6..a2803b06d406 100644 --- a/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml +++ b/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml @@ -7,27 +7,3 @@ api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - -- module: cloudfoundry - metricsets: - - counter - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - -- module: cloudfoundry - metricsets: - - counter - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' - -- module: cloudfoundry - metricsets: - - value - enabled: true - api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' - client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' - client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml b/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml index 0d96722e576d..a2803b06d406 100644 --- a/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml +++ b/x-pack/metricbeat/module/cloudfoundry/_meta/config.yml @@ -7,27 +7,3 @@ api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry -# metricsets: -# - counter -# enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry -# metricsets: -# - counter -# enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry -# metricsets: -# - value -# enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' diff --git a/x-pack/metricbeat/modules.d/cloudfoundry.yml.disabled b/x-pack/metricbeat/modules.d/cloudfoundry.yml.disabled index 513d201d0a47..ae540f20cfce 100644 --- a/x-pack/metricbeat/modules.d/cloudfoundry.yml.disabled +++ b/x-pack/metricbeat/modules.d/cloudfoundry.yml.disabled @@ -10,27 +10,3 @@ api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry -# metricsets: -# - counter -# enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry -# metricsets: -# - counter -# enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' -# -#- module: cloudfoundry -# metricsets: -# - value -# enabled: true -# api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' -# client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' -# client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' From 5da73b2392271f62b9f28f0b8cbde41b5cbb0dda Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Thu, 27 Feb 2020 09:05:46 -0800 Subject: [PATCH 10/21] Document Kibana Space ID setting (#16622) * Document Kibana Space ID setting * Update reference YML files * Update libbeat/docs/shared-kibana-config.asciidoc Co-Authored-By: DeDe Morton * Updating reference YML files * Adding link to doc Co-authored-by: DeDe Morton --- auditbeat/auditbeat.reference.yml | 3 +++ filebeat/filebeat.reference.yml | 3 +++ heartbeat/heartbeat.reference.yml | 3 +++ journalbeat/journalbeat.reference.yml | 3 +++ libbeat/_meta/config.reference.yml.tmpl | 3 +++ libbeat/docs/shared-kibana-config.asciidoc | 9 ++++++++- metricbeat/metricbeat.reference.yml | 3 +++ packetbeat/packetbeat.reference.yml | 3 +++ winlogbeat/winlogbeat.reference.yml | 3 +++ x-pack/auditbeat/auditbeat.reference.yml | 3 +++ x-pack/filebeat/filebeat.reference.yml | 3 +++ x-pack/functionbeat/functionbeat.reference.yml | 3 +++ x-pack/metricbeat/metricbeat.reference.yml | 3 +++ x-pack/winlogbeat/winlogbeat.reference.yml | 3 +++ 14 files changed, 47 insertions(+), 1 deletion(-) diff --git a/auditbeat/auditbeat.reference.yml b/auditbeat/auditbeat.reference.yml index 28b770123325..5084a956b61b 100644 --- a/auditbeat/auditbeat.reference.yml +++ b/auditbeat/auditbeat.reference.yml @@ -1133,6 +1133,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/filebeat/filebeat.reference.yml b/filebeat/filebeat.reference.yml index e505a6903a39..d5467771aebf 100644 --- a/filebeat/filebeat.reference.yml +++ b/filebeat/filebeat.reference.yml @@ -1838,6 +1838,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/heartbeat/heartbeat.reference.yml b/heartbeat/heartbeat.reference.yml index e74ffe1b5340..535a8e1f35e0 100644 --- a/heartbeat/heartbeat.reference.yml +++ b/heartbeat/heartbeat.reference.yml @@ -1277,6 +1277,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/journalbeat/journalbeat.reference.yml b/journalbeat/journalbeat.reference.yml index 8dee4f3ca117..039f7ac78bf7 100644 --- a/journalbeat/journalbeat.reference.yml +++ b/journalbeat/journalbeat.reference.yml @@ -1071,6 +1071,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/libbeat/_meta/config.reference.yml.tmpl b/libbeat/_meta/config.reference.yml.tmpl index 9b3d23fdd9c5..016471946e78 100644 --- a/libbeat/_meta/config.reference.yml.tmpl +++ b/libbeat/_meta/config.reference.yml.tmpl @@ -1014,6 +1014,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/libbeat/docs/shared-kibana-config.asciidoc b/libbeat/docs/shared-kibana-config.asciidoc index 0e1e8e743711..aed3ae352147 100644 --- a/libbeat/docs/shared-kibana-config.asciidoc +++ b/libbeat/docs/shared-kibana-config.asciidoc @@ -85,6 +85,14 @@ An HTTP path prefix that is prepended to the HTTP API calls. This is useful for the cases where Kibana listens behind an HTTP reverse proxy that exports the API under a custom prefix. +[float] +[[kibana-space-id-option]] +==== `setup.kibana.space.id` + +The {kibana-ref}/xpack-spaces.html[Kibana space] ID to use. If specified, +{beatname_uc} loads Kibana assets into this Kibana space. Omit this option to +use the default space. + [float] ==== `setup.kibana.ssl.enabled` @@ -104,4 +112,3 @@ setup.kibana.ssl.key: "/etc/pki/client/cert.key ---- See <> for more information. - diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 3bb9ce6b7878..f0bd0f391f94 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -1825,6 +1825,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/packetbeat/packetbeat.reference.yml b/packetbeat/packetbeat.reference.yml index b1f3557dd527..aeb541e1a3a4 100644 --- a/packetbeat/packetbeat.reference.yml +++ b/packetbeat/packetbeat.reference.yml @@ -1560,6 +1560,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/winlogbeat/winlogbeat.reference.yml b/winlogbeat/winlogbeat.reference.yml index 58e93d9f945c..9aa258e823d4 100644 --- a/winlogbeat/winlogbeat.reference.yml +++ b/winlogbeat/winlogbeat.reference.yml @@ -1056,6 +1056,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/x-pack/auditbeat/auditbeat.reference.yml b/x-pack/auditbeat/auditbeat.reference.yml index 1ccca945d404..daeb4b4333da 100644 --- a/x-pack/auditbeat/auditbeat.reference.yml +++ b/x-pack/auditbeat/auditbeat.reference.yml @@ -1189,6 +1189,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/x-pack/filebeat/filebeat.reference.yml b/x-pack/filebeat/filebeat.reference.yml index 7a7888640404..a6b3290da33b 100644 --- a/x-pack/filebeat/filebeat.reference.yml +++ b/x-pack/filebeat/filebeat.reference.yml @@ -2384,6 +2384,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/x-pack/functionbeat/functionbeat.reference.yml b/x-pack/functionbeat/functionbeat.reference.yml index 8137e4f70d58..1424fa868aa7 100644 --- a/x-pack/functionbeat/functionbeat.reference.yml +++ b/x-pack/functionbeat/functionbeat.reference.yml @@ -1080,6 +1080,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index b88f7fb4464c..c6a7a1f74c98 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -2080,6 +2080,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true diff --git a/x-pack/winlogbeat/winlogbeat.reference.yml b/x-pack/winlogbeat/winlogbeat.reference.yml index 9c5f8d416e0c..de014de3fad8 100644 --- a/x-pack/winlogbeat/winlogbeat.reference.yml +++ b/x-pack/winlogbeat/winlogbeat.reference.yml @@ -1059,6 +1059,9 @@ setup.kibana: # Optional HTTP path #path: "" + # Optional Kibana space ID. + #space.id: "" + # Use SSL settings for HTTPS. Default is true. #ssl.enabled: true From 23d7c06cbb582d2381e819ef3e51efdc20c36f8d Mon Sep 17 00:00:00 2001 From: Pier-Hugues Pellerin Date: Thu, 27 Feb 2020 14:04:43 -0500 Subject: [PATCH 11/21] Remove the special pins type for `ca_sha256` (#16615) We have changed the type from a special custom type to a slice of string. This reduce the number of exposed types and make it easier in general to work with in the tests. --- CHANGELOG-developer.asciidoc | 6 +++++ .../common/transport/tlscommon/ca_pinning.go | 24 +++++++++---------- libbeat/common/transport/tlscommon/config.go | 2 +- .../common/transport/tlscommon/tls_config.go | 2 +- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/CHANGELOG-developer.asciidoc b/CHANGELOG-developer.asciidoc index 15efed8ed5df..33a957a6d6a2 100644 --- a/CHANGELOG-developer.asciidoc +++ b/CHANGELOG-developer.asciidoc @@ -12,6 +12,12 @@ other Beats should be migrated. Note: This changelog was only started after the 6.3 release. +=== Beats version 8.0.0 +https://github.com/elastic/beats/compare/v7.x..master[Check the HEAD diff] + +==== Breaking changes + - Replace custom Pins type for a slice of string for defining the `ca_sha256` values. + === Beats version 7.5.1 https://github.com/elastic/beats/compare/v7.5.0..v7.5.1[Check the HEAD diff] diff --git a/libbeat/common/transport/tlscommon/ca_pinning.go b/libbeat/common/transport/tlscommon/ca_pinning.go index d83bf533d130..e489ca6d6f43 100644 --- a/libbeat/common/transport/tlscommon/ca_pinning.go +++ b/libbeat/common/transport/tlscommon/ca_pinning.go @@ -28,17 +28,6 @@ import ( // ErrCAPinMissmatch is returned when no pin is matched in the verified chain. var ErrCAPinMissmatch = errors.New("provided CA certificate pins doesn't match any of the certificate authorities used to validate the certificate") -type pins []string - -func (p pins) Matches(candidate string) bool { - for _, pin := range p { - if pin == candidate { - return true - } - } - return false -} - // verifyPeerCertFunc is a callback defined on the tls.Config struct that will called when a // TLS connection is used. type verifyPeerCertFunc func([][]byte, [][]*x509.Certificate) error @@ -48,7 +37,7 @@ type verifyPeerCertFunc func([][]byte, [][]*x509.Certificate) error // NOTE: Defining a PIN to check certificates is not a replacement for the normal TLS validations it's // an additional validation. In fact if you set `InsecureSkipVerify` to true and a PIN, the // verifiedChains variable will be empty and the added validation will fail. -func MakeCAPinCallback(hashes pins) func([][]byte, [][]*x509.Certificate) error { +func MakeCAPinCallback(hashes []string) func([][]byte, [][]*x509.Certificate) error { return func(_ [][]byte, verifiedChains [][]*x509.Certificate) error { // The chain of trust has been already established before the call to the VerifyPeerCertificate // function, after we go through the chain to make sure we have at least a certificate certificate @@ -56,7 +45,7 @@ func MakeCAPinCallback(hashes pins) func([][]byte, [][]*x509.Certificate) error for _, chain := range verifiedChains { for _, certificate := range chain { h := Fingerprint(certificate) - if hashes.Matches(h) { + if matches(hashes, h) { return nil } } @@ -71,3 +60,12 @@ func Fingerprint(certificate *x509.Certificate) string { hash := sha256.Sum256(certificate.RawSubjectPublicKeyInfo) return base64.StdEncoding.EncodeToString(hash[:]) } + +func matches(pins []string, candidate string) bool { + for _, pin := range pins { + if pin == candidate { + return true + } + } + return false +} diff --git a/libbeat/common/transport/tlscommon/config.go b/libbeat/common/transport/tlscommon/config.go index 3fdaeced560b..8d7650eb5bfd 100644 --- a/libbeat/common/transport/tlscommon/config.go +++ b/libbeat/common/transport/tlscommon/config.go @@ -33,7 +33,7 @@ type Config struct { Certificate CertificateConfig `config:",inline" yaml:",inline"` CurveTypes []tlsCurveType `config:"curve_types" yaml:"curve_types,omitempty"` Renegotiation tlsRenegotiationSupport `config:"renegotiation" yaml:"renegotiation"` - CASha256 pins `config:"ca_sha256" yaml:"ca_sha256,omitempty"` + CASha256 []string `config:"ca_sha256" yaml:"ca_sha256,omitempty"` } // LoadTLSConfig will load a certificate from config with all TLS based keys diff --git a/libbeat/common/transport/tlscommon/tls_config.go b/libbeat/common/transport/tlscommon/tls_config.go index 41c574bc078a..5d8ce9360292 100644 --- a/libbeat/common/transport/tlscommon/tls_config.go +++ b/libbeat/common/transport/tlscommon/tls_config.go @@ -67,7 +67,7 @@ type TLSConfig struct { // CASha256 is the CA certificate pin, this is used to validate the CA that will be used to trust // the server certificate. - CASha256 pins + CASha256 []string } // ToConfig generates a tls.Config object. Note, you must use BuildModuleConfig to generate a config with From e79af863e10710eec205da34b6bedaf6ae041976 Mon Sep 17 00:00:00 2001 From: Steffen Siering Date: Thu, 27 Feb 2020 20:50:28 +0100 Subject: [PATCH 12/21] Remove feature.Describer and enhance Details (#16658) --- libbeat/feature/bundle.go | 2 +- libbeat/feature/bundle_test.go | 20 +++--- libbeat/feature/details.go | 63 +++++-------------- libbeat/feature/feature.go | 8 +-- libbeat/feature/registry_test.go | 2 +- libbeat/management/management.go | 2 +- libbeat/publisher/queue/memqueue/broker.go | 2 +- libbeat/publisher/queue/queue_reg.go | 4 +- libbeat/publisher/queue/spool/module.go | 2 +- .../functionbeat/function/provider/feature.go | 16 ++--- .../function/provider/feature_test.go | 6 +- .../function/provider/registry_test.go | 10 +-- x-pack/functionbeat/manager/aws/aws.go | 2 +- x-pack/functionbeat/manager/gcp/gcp.go | 2 +- .../provider/aws/aws/api_gateway_proxy.go | 4 +- .../provider/aws/aws/cloudwatch_kinesis.go | 4 +- .../provider/aws/aws/cloudwatch_logs.go | 4 +- .../functionbeat/provider/aws/aws/kinesis.go | 4 +- x-pack/functionbeat/provider/aws/aws/sqs.go | 4 +- .../provider/aws/include/feature.go | 2 +- .../functionbeat/provider/gcp/gcp/pubsub.go | 4 +- .../functionbeat/provider/gcp/gcp/storage.go | 4 +- .../provider/gcp/include/feature.go | 2 +- .../provider/local/local/local.go | 4 +- 24 files changed, 71 insertions(+), 106 deletions(-) diff --git a/libbeat/feature/bundle.go b/libbeat/feature/bundle.go index 28e5753e182e..2014dc63e5b2 100644 --- a/libbeat/feature/bundle.go +++ b/libbeat/feature/bundle.go @@ -70,7 +70,7 @@ func MustBundle(bundle ...bundleable) *Bundle { func HasStabilityPred(stabilities ...Stability) FilterFunc { return func(f Featurable) bool { for _, s := range stabilities { - if s == f.Description().Stability() { + if s == f.Description().Stability { return true } } diff --git a/libbeat/feature/bundle_test.go b/libbeat/feature/bundle_test.go index 2e65363ea147..48555524707b 100644 --- a/libbeat/feature/bundle_test.go +++ b/libbeat/feature/bundle_test.go @@ -26,9 +26,9 @@ import ( func TestBundle(t *testing.T) { factory := func() {} features := []Featurable{ - New("libbeat.outputs", "elasticsearch", factory, &Details{stability: Stable}), - New("libbeat.outputs", "edge", factory, &Details{stability: Experimental}), - New("libbeat.input", "tcp", factory, &Details{stability: Beta}), + New("libbeat.outputs", "elasticsearch", factory, Details{Stability: Stable}), + New("libbeat.outputs", "edge", factory, Details{Stability: Experimental}), + New("libbeat.input", "tcp", factory, Details{Stability: Beta}), } t.Run("Creates a new Bundle", func(t *testing.T) { @@ -36,29 +36,29 @@ func TestBundle(t *testing.T) { assert.Equal(t, 3, len(b.Features())) }) - t.Run("Filters feature based on stability", func(t *testing.T) { + t.Run("Filters feature based on Stability", func(t *testing.T) { b := NewBundle(features...) new := b.Filter(Experimental) assert.Equal(t, 1, len(new.Features())) }) - t.Run("Filters feature based on multiple different stability", func(t *testing.T) { + t.Run("Filters feature based on multiple different Stability", func(t *testing.T) { b := NewBundle(features...) new := b.Filter(Experimental, Stable) assert.Equal(t, 2, len(new.Features())) }) t.Run("Creates a new Bundle from specified feature", func(t *testing.T) { - f1 := New("libbeat.outputs", "elasticsearch", factory, &Details{stability: Stable}) + f1 := New("libbeat.outputs", "elasticsearch", factory, Details{Stability: Stable}) b := MustBundle(f1) assert.Equal(t, 1, len(b.Features())) }) t.Run("Creates a new Bundle with grouped features", func(t *testing.T) { - f1 := New("libbeat.outputs", "elasticsearch", factory, &Details{stability: Stable}) - f2 := New("libbeat.outputs", "edge", factory, &Details{stability: Experimental}) - f3 := New("libbeat.input", "tcp", factory, &Details{stability: Beta}) - f4 := New("libbeat.input", "udp", factory, &Details{stability: Beta}) + f1 := New("libbeat.outputs", "elasticsearch", factory, Details{Stability: Stable}) + f2 := New("libbeat.outputs", "edge", factory, Details{Stability: Experimental}) + f3 := New("libbeat.input", "tcp", factory, Details{Stability: Beta}) + f4 := New("libbeat.input", "udp", factory, Details{Stability: Beta}) b := MustBundle( MustBundle(f1), diff --git a/libbeat/feature/details.go b/libbeat/feature/details.go index 2454158b4455..cb9d76c79430 100644 --- a/libbeat/feature/details.go +++ b/libbeat/feature/details.go @@ -19,59 +19,24 @@ package feature import "fmt" -// Describer contains general information for a specific feature, the fields will be used to report -// useful information by the factories or any future CLI. -type Describer interface { - // Stability is the stability of the Feature, this allow the user to filter embedded functionality - // by their maturity at runtime. - // Example: Beta, Experimental, Stable or Undefined. - Stability() Stability - - // Doc is a one liner describing the current feature. - // Example: Dissect allows to define patterns to extract useful information from a string. - Doc() string - - // FullName is the human readable name of the feature. - // Example: Jolokia Discovery - FullName() string -} - // Details minimal information that you must provide when creating a feature. type Details struct { - stability Stability - doc string - fullName string -} - -// Stability is the stability of the Feature, this allow the user to filter embedded functionality -// by their maturity at runtime. -// Example: Beta, Experimental, Stable or Undefined. -func (d *Details) Stability() Stability { - return d.stability -} - -// Doc is a one liner describing the current feature. -// Example: Dissect allows to define patterns to extract useful information from a string. -func (d *Details) Doc() string { - return d.doc -} - -// FullName is the human readable name of the feature. -// Example: Jolokia Discovery -func (d *Details) FullName() string { - return d.fullName + Name string + Stability Stability + Deprecated bool + Info string // short info string + Doc string // long doc string } -func (d *Details) String() string { - return fmt.Sprintf( - "name: %s, description: %s (stability: %s)", - d.fullName, - d.doc, - d.stability, - ) +func (d Details) String() string { + fmtStr := "name: %s, description: %s (%s)" + if d.Deprecated { + fmtStr = "name: %s, description: %s (deprecated, %s)" + } + return fmt.Sprintf(fmtStr, d.Name, d.Info, d.Stability) } -// NewDetails return the minimal information a new feature must provide. -func NewDetails(fullName string, doc string, stability Stability) *Details { - return &Details{fullName: fullName, doc: doc, stability: stability} +// MakeDetails return the minimal information a new feature must provide. +func MakeDetails(fullName string, doc string, stability Stability) Details { + return Details{Name: fullName, Info: doc, Stability: stability} } diff --git a/libbeat/feature/feature.go b/libbeat/feature/feature.go index b051f07c8ca1..ec82fa2122c1 100644 --- a/libbeat/feature/feature.go +++ b/libbeat/feature/feature.go @@ -43,7 +43,7 @@ type Featurable interface { Factory() interface{} // Description return the avaiable information for a specific feature. - Description() Describer + Description() Details String() string } @@ -53,7 +53,7 @@ type Feature struct { namespace string name string factory interface{} - description Describer + description Details } // Namespace return the namespace of the feature. @@ -72,7 +72,7 @@ func (f *Feature) Factory() interface{} { } // Description return the avaiable information for a specific feature. -func (f *Feature) Description() Describer { +func (f *Feature) Description() Details { return f.description } @@ -87,7 +87,7 @@ func (f *Feature) String() string { } // New returns a new Feature. -func New(namespace, name string, factory interface{}, description Describer) *Feature { +func New(namespace, name string, factory interface{}, description Details) *Feature { return &Feature{ namespace: namespace, name: name, diff --git a/libbeat/feature/registry_test.go b/libbeat/feature/registry_test.go index 03da4c471d6d..7882e44cc4f8 100644 --- a/libbeat/feature/registry_test.go +++ b/libbeat/feature/registry_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" ) -var defaultDetails = &Details{stability: Stable} +var defaultDetails = Details{Stability: Stable} func TestRegister(t *testing.T) { f := func() {} diff --git a/libbeat/management/management.go b/libbeat/management/management.go index 5725eea77157..8299365bfe3e 100644 --- a/libbeat/management/management.go +++ b/libbeat/management/management.go @@ -52,7 +52,7 @@ type FactoryFunc func(*common.Config, *reload.Registry, uuid.UUID) (ConfigManage // Register a config manager func Register(name string, fn FactoryFunc, stability feature.Stability) { - f := feature.New(Namespace, name, fn, feature.NewDetails(name, "", stability)) + f := feature.New(Namespace, name, fn, feature.MakeDetails(name, "", stability)) feature.MustRegister(f) } diff --git a/libbeat/publisher/queue/memqueue/broker.go b/libbeat/publisher/queue/memqueue/broker.go index 34cefd6ef2a3..de0b54caba23 100644 --- a/libbeat/publisher/queue/memqueue/broker.go +++ b/libbeat/publisher/queue/memqueue/broker.go @@ -30,7 +30,7 @@ import ( // Feature exposes a memory queue. var Feature = queue.Feature("mem", create, - feature.NewDetails( + feature.MakeDetails( "Memory queue", "Buffer events in memory before sending to the output.", feature.Stable), diff --git a/libbeat/publisher/queue/queue_reg.go b/libbeat/publisher/queue/queue_reg.go index 2703bcd75878..d7690c006f3b 100644 --- a/libbeat/publisher/queue/queue_reg.go +++ b/libbeat/publisher/queue/queue_reg.go @@ -26,7 +26,7 @@ var Namespace = "libbeat.queue" // RegisterType registers a new queue type. func RegisterType(name string, fn Factory) { - f := Feature(name, fn, feature.NewDetails(name, "", feature.Undefined)) + f := Feature(name, fn, feature.MakeDetails(name, "", feature.Undefined)) feature.MustRegister(f) } @@ -45,6 +45,6 @@ func FindFactory(name string) Factory { } // Feature creates a new type of queue. -func Feature(name string, factory Factory, description feature.Describer) *feature.Feature { +func Feature(name string, factory Factory, description feature.Details) *feature.Feature { return feature.New(Namespace, name, factory, description) } diff --git a/libbeat/publisher/queue/spool/module.go b/libbeat/publisher/queue/spool/module.go index 71a43c421ecb..6e76d8033065 100644 --- a/libbeat/publisher/queue/spool/module.go +++ b/libbeat/publisher/queue/spool/module.go @@ -29,7 +29,7 @@ import ( // Feature exposes a spooling to disk queue. var Feature = queue.Feature("spool", create, - feature.NewDetails( + feature.MakeDetails( "Memory queue", "Buffer events in memory before sending to the output.", feature.Beta), diff --git a/x-pack/functionbeat/function/provider/feature.go b/x-pack/functionbeat/function/provider/feature.go index b5e56389fd2d..25e29e3788d2 100644 --- a/x-pack/functionbeat/function/provider/feature.go +++ b/x-pack/functionbeat/function/provider/feature.go @@ -17,8 +17,8 @@ func getNamespace(provider string) string { // Feature creates a new Provider feature to be added to the global registry. // The namespace will be 'functionbeat.provider' in the registry. -func Feature(name string, factory Factory, description feature.Describer) *feature.Feature { - return feature.New(namespace, name, factory, description) +func Feature(name string, factory Factory, details feature.Details) *feature.Feature { + return feature.New(namespace, name, factory, details) } // FunctionFeature Feature creates a new function feature to be added to the global registry @@ -26,9 +26,9 @@ func Feature(name string, factory Factory, description feature.Describer) *featu func FunctionFeature( provider, name string, factory FunctionFactory, - description feature.Describer, + details feature.Details, ) *feature.Feature { - return feature.New(getNamespace(provider), name, factory, description) + return feature.New(getNamespace(provider), name, factory, details) } // Builder is used to have a fluent interface to build a set of function for a specific provider, it @@ -41,8 +41,8 @@ type Builder struct { // MustCreate creates a new provider builder, it is used to define a provider and the function // it supports. -func MustCreate(name string, factory Factory, description feature.Describer) *Builder { - return &Builder{name: name, bundle: feature.NewBundle(Feature(name, factory, description))} +func MustCreate(name string, factory Factory, details feature.Details) *Builder { + return &Builder{name: name, bundle: feature.NewBundle(Feature(name, factory, details))} } // Bundle transforms the provider and the functions into a bundle feature. @@ -54,8 +54,8 @@ func (b *Builder) Bundle() *feature.Bundle { func (b *Builder) MustAddFunction( name string, factory FunctionFactory, - description feature.Describer, + details feature.Details, ) *Builder { - b.bundle = feature.MustBundle(b.bundle, FunctionFeature(b.name, name, factory, description)) + b.bundle = feature.MustBundle(b.bundle, FunctionFeature(b.name, name, factory, details)) return b } diff --git a/x-pack/functionbeat/function/provider/feature_test.go b/x-pack/functionbeat/function/provider/feature_test.go index 7873604c2edc..4a5c3056cf6f 100644 --- a/x-pack/functionbeat/function/provider/feature_test.go +++ b/x-pack/functionbeat/function/provider/feature_test.go @@ -26,12 +26,12 @@ func TestBuilder(t *testing.T) { b := MustCreate( provider, providerFactory, - feature.NewDetails("myprovider", "myprovider", feature.Experimental), + feature.MakeDetails("myprovider", "myprovider", feature.Experimental), ).MustAddFunction( "f1", fnFactory1, - feature.NewDetails("fn1 description", "fn1", feature.Experimental), - ).MustAddFunction("f2", fnFactory2, feature.NewDetails( + feature.MakeDetails("fn1 description", "fn1", feature.Experimental), + ).MustAddFunction("f2", fnFactory2, feature.MakeDetails( "fn1 description", "fn1", feature.Experimental, diff --git a/x-pack/functionbeat/function/provider/registry_test.go b/x-pack/functionbeat/function/provider/registry_test.go index 84ac481a88bd..a20925911c32 100644 --- a/x-pack/functionbeat/function/provider/registry_test.go +++ b/x-pack/functionbeat/function/provider/registry_test.go @@ -63,7 +63,7 @@ func testProviderLookup(t *testing.T) { f := Feature( name, providerFn, - feature.NewDetails(name, "provider for testing", feature.Experimental), + feature.MakeDetails(name, "provider for testing", feature.Experimental), ) t.Run("adding and retrieving a provider", withRegistry(func( @@ -115,7 +115,7 @@ func testFunctionLookup(t *testing.T) { f := Feature( name, providerFn, - feature.NewDetails(name, "provider for testing", feature.Experimental), + feature.MakeDetails(name, "provider for testing", feature.Experimental), ) fnName := "myfunc" @@ -124,7 +124,7 @@ func testFunctionLookup(t *testing.T) { return myfunction, nil } - fnFeature := FunctionFeature(name, fnName, functionFn, feature.NewDetails( + fnFeature := FunctionFeature(name, fnName, functionFn, feature.MakeDetails( name, "provider for testing", feature.Experimental, @@ -252,14 +252,14 @@ func TestFindFunctionByName(t *testing.T) { providerFn := func(log *logp.Logger, registry *Registry, config *common.Config) (Provider, error) { return myprovider, nil } - f := Feature(name, providerFn, feature.NewDetails(name, "provider for testing", feature.Experimental)) + f := Feature(name, providerFn, feature.MakeDetails(name, "provider for testing", feature.Experimental)) myfunction := &mockFunction{name} functionFn := func(provider Provider, config *common.Config) (Function, error) { return myfunction, nil } - fnFeature := FunctionFeature(name, fnName, functionFn, feature.NewDetails( + fnFeature := FunctionFeature(name, fnName, functionFn, feature.MakeDetails( name, "provider for testing", feature.Experimental, diff --git a/x-pack/functionbeat/manager/aws/aws.go b/x-pack/functionbeat/manager/aws/aws.go index 4d8f34c726b5..8e470afda76c 100644 --- a/x-pack/functionbeat/manager/aws/aws.go +++ b/x-pack/functionbeat/manager/aws/aws.go @@ -14,7 +14,7 @@ import ( var Bundle = provider.MustCreate( "aws", provider.NewDefaultProvider("aws", NewCLI, NewTemplateBuilder), - feature.NewDetails("AWS Lambda", "listen to events on AWS lambda", feature.Stable), + feature.MakeDetails("AWS Lambda", "listen to events on AWS lambda", feature.Stable), ).MustAddFunction("cloudwatch_logs", aws.NewCloudwatchLogs, aws.CloudwatchLogsDetails(), diff --git a/x-pack/functionbeat/manager/gcp/gcp.go b/x-pack/functionbeat/manager/gcp/gcp.go index f9ced9ef5d38..38d1f39b1bbe 100644 --- a/x-pack/functionbeat/manager/gcp/gcp.go +++ b/x-pack/functionbeat/manager/gcp/gcp.go @@ -14,7 +14,7 @@ import ( var Bundle = provider.MustCreate( "gcp", provider.NewDefaultProvider("gcp", NewCLI, NewTemplateBuilder), - feature.NewDetails("Google Cloud Functions", "listen to events on Google Cloud", feature.Stable), + feature.MakeDetails("Google Cloud Functions", "listen to events on Google Cloud", feature.Stable), ).MustAddFunction("pubsub", gcp.NewPubSub, gcp.PubSubDetails(), diff --git a/x-pack/functionbeat/provider/aws/aws/api_gateway_proxy.go b/x-pack/functionbeat/provider/aws/aws/api_gateway_proxy.go index 7f2aff3ee31d..8a77a3835d32 100644 --- a/x-pack/functionbeat/provider/aws/aws/api_gateway_proxy.go +++ b/x-pack/functionbeat/provider/aws/aws/api_gateway_proxy.go @@ -40,8 +40,8 @@ func NewAPIGatewayProxy(provider provider.Provider, config *common.Config) (prov } // APIGatewayProxyDetails returns the details of the feature. -func APIGatewayProxyDetails() *feature.Details { - return feature.NewDetails("API Gateway proxy trigger", "receive events from the api gateway proxy", feature.Experimental) +func APIGatewayProxyDetails() feature.Details { + return feature.MakeDetails("API Gateway proxy trigger", "receive events from the api gateway proxy", feature.Experimental) } // Run starts the lambda function and wait for web triggers. diff --git a/x-pack/functionbeat/provider/aws/aws/cloudwatch_kinesis.go b/x-pack/functionbeat/provider/aws/aws/cloudwatch_kinesis.go index 67f124e7dc70..c2e4ced04411 100644 --- a/x-pack/functionbeat/provider/aws/aws/cloudwatch_kinesis.go +++ b/x-pack/functionbeat/provider/aws/aws/cloudwatch_kinesis.go @@ -65,8 +65,8 @@ func defaultCloudwatchKinesisConfig() *CloudwatchKinesisConfig { } // CloudwatchKinesisDetails returns the details of the feature. -func CloudwatchKinesisDetails() *feature.Details { - return feature.NewDetails("Cloudwatch logs via Kinesis trigger", "receive Cloudwatch logs from a Kinesis stream", feature.Experimental) +func CloudwatchKinesisDetails() feature.Details { + return feature.MakeDetails("Cloudwatch logs via Kinesis trigger", "receive Cloudwatch logs from a Kinesis stream", feature.Experimental) } // Run starts the lambda function and wait for web triggers. diff --git a/x-pack/functionbeat/provider/aws/aws/cloudwatch_logs.go b/x-pack/functionbeat/provider/aws/aws/cloudwatch_logs.go index 6dd48802a229..d885899bd610 100644 --- a/x-pack/functionbeat/provider/aws/aws/cloudwatch_logs.go +++ b/x-pack/functionbeat/provider/aws/aws/cloudwatch_logs.go @@ -101,8 +101,8 @@ func NewCloudwatchLogs(provider provider.Provider, cfg *common.Config) (provider } // CloudwatchLogsDetails returns the details of the feature. -func CloudwatchLogsDetails() *feature.Details { - return feature.NewDetails("Cloudwatch Logs trigger", "receive events from cloudwatch logs.", feature.Stable) +func CloudwatchLogsDetails() feature.Details { + return feature.MakeDetails("Cloudwatch Logs trigger", "receive events from cloudwatch logs.", feature.Stable) } // Run start the AWS lambda handles and will transform any events received to the pipeline. diff --git a/x-pack/functionbeat/provider/aws/aws/kinesis.go b/x-pack/functionbeat/provider/aws/aws/kinesis.go index f91cbe3a0c2e..8732703106d8 100644 --- a/x-pack/functionbeat/provider/aws/aws/kinesis.go +++ b/x-pack/functionbeat/provider/aws/aws/kinesis.go @@ -128,8 +128,8 @@ func NewKinesis(provider provider.Provider, cfg *common.Config) (provider.Functi } // KinesisDetails returns the details of the feature. -func KinesisDetails() *feature.Details { - return feature.NewDetails("Kinesis trigger", "receive events from a Kinesis stream", feature.Stable) +func KinesisDetails() feature.Details { + return feature.MakeDetails("Kinesis trigger", "receive events from a Kinesis stream", feature.Stable) } // Run starts the lambda function and wait for web triggers. diff --git a/x-pack/functionbeat/provider/aws/aws/sqs.go b/x-pack/functionbeat/provider/aws/aws/sqs.go index da20e66b6443..47209fae01ad 100644 --- a/x-pack/functionbeat/provider/aws/aws/sqs.go +++ b/x-pack/functionbeat/provider/aws/aws/sqs.go @@ -63,8 +63,8 @@ func NewSQS(provider provider.Provider, cfg *common.Config) (provider.Function, } // SQSDetails returns the details of the feature. -func SQSDetails() *feature.Details { - return feature.NewDetails("SQS trigger", "receive events from a SQS queue", feature.Stable) +func SQSDetails() feature.Details { + return feature.MakeDetails("SQS trigger", "receive events from a SQS queue", feature.Stable) } // Run starts the lambda function and wait for web triggers. diff --git a/x-pack/functionbeat/provider/aws/include/feature.go b/x-pack/functionbeat/provider/aws/include/feature.go index b1c797b1afe6..0b9fd8e35d23 100644 --- a/x-pack/functionbeat/provider/aws/include/feature.go +++ b/x-pack/functionbeat/provider/aws/include/feature.go @@ -14,7 +14,7 @@ import ( var bundle = provider.MustCreate( "aws", provider.NewDefaultProvider("aws", provider.NewNullCli, provider.NewNullTemplateBuilder), - feature.NewDetails("AWS Lambda", "listen to events on AWS lambda", feature.Stable), + feature.MakeDetails("AWS Lambda", "listen to events on AWS lambda", feature.Stable), ).MustAddFunction("cloudwatch_logs", aws.NewCloudwatchLogs, aws.CloudwatchLogsDetails(), diff --git a/x-pack/functionbeat/provider/gcp/gcp/pubsub.go b/x-pack/functionbeat/provider/gcp/gcp/pubsub.go index 42bcbe2a2fe9..ab5959e8cf3b 100644 --- a/x-pack/functionbeat/provider/gcp/gcp/pubsub.go +++ b/x-pack/functionbeat/provider/gcp/gcp/pubsub.go @@ -98,8 +98,8 @@ func (p *PubSub) getEventDataFromContext(ctx context.Context) (PubSubEvent, erro } // PubSubDetails returns the details of the feature. -func PubSubDetails() *feature.Details { - return feature.NewDetails("Google Pub/Sub trigger", "receive messages from Google Pub/Sub.", feature.Stable) +func PubSubDetails() feature.Details { + return feature.MakeDetails("Google Pub/Sub trigger", "receive messages from Google Pub/Sub.", feature.Stable) } // Name returns the name of the function. diff --git a/x-pack/functionbeat/provider/gcp/gcp/storage.go b/x-pack/functionbeat/provider/gcp/gcp/storage.go index d58a45a9b4d1..08d497aa1db0 100644 --- a/x-pack/functionbeat/provider/gcp/gcp/storage.go +++ b/x-pack/functionbeat/provider/gcp/gcp/storage.go @@ -98,8 +98,8 @@ func (s *Storage) getEventDataFromContext(ctx context.Context) (StorageEventWith } // StorageDetails returns the details of the feature. -func StorageDetails() *feature.Details { - return feature.NewDetails("Google Cloud Storage trigger", "receive events from Google Cloud Storage.", feature.Stable) +func StorageDetails() feature.Details { + return feature.MakeDetails("Google Cloud Storage trigger", "receive events from Google Cloud Storage.", feature.Stable) } // Name returns the name of the function. diff --git a/x-pack/functionbeat/provider/gcp/include/feature.go b/x-pack/functionbeat/provider/gcp/include/feature.go index bb4e0b82ccba..5f14dd24c0b8 100644 --- a/x-pack/functionbeat/provider/gcp/include/feature.go +++ b/x-pack/functionbeat/provider/gcp/include/feature.go @@ -14,7 +14,7 @@ import ( var bundle = provider.MustCreate( "gcp", provider.NewDefaultProvider("gcp", provider.NewNullCli, provider.NewNullTemplateBuilder), - feature.NewDetails("Google Cloud Platform", "listen to events from Google Cloud Platform", feature.Stable), + feature.MakeDetails("Google Cloud Platform", "listen to events from Google Cloud Platform", feature.Stable), ).MustAddFunction("pubsub", gcp.NewPubSub, gcp.PubSubDetails(), diff --git a/x-pack/functionbeat/provider/local/local/local.go b/x-pack/functionbeat/provider/local/local/local.go index 0e456af87701..2efb8df02ef6 100644 --- a/x-pack/functionbeat/provider/local/local/local.go +++ b/x-pack/functionbeat/provider/local/local/local.go @@ -24,11 +24,11 @@ const stdinName = "stdin" var Bundle = provider.MustCreate( "local", provider.NewDefaultProvider("local", provider.NewNullCli, provider.NewNullTemplateBuilder), - feature.NewDetails("local events", "allows to trigger events locally.", feature.Experimental), + feature.MakeDetails("local events", "allows to trigger events locally.", feature.Experimental), ).MustAddFunction( stdinName, NewStdinFunction, - feature.NewDetails(stdinName, "read events from stdin", feature.Experimental), + feature.MakeDetails(stdinName, "read events from stdin", feature.Experimental), ).Bundle() // StdinFunction reads events from STIN and terminates when stdin is completed. From e4e683b2fda4a555d16f8f96a9c666e752c2876a Mon Sep 17 00:00:00 2001 From: Fae Charlton Date: Thu, 27 Feb 2020 15:39:37 -0500 Subject: [PATCH 13/21] Make memqueue.Broker internal (now memqueue.broker) (#16667) --- CHANGELOG-developer.next.asciidoc | 1 + .../report/elasticsearch/elasticsearch.go | 2 +- libbeat/publisher/queue/memqueue/ackloop.go | 4 ++-- libbeat/publisher/queue/memqueue/broker.go | 20 +++++++++---------- libbeat/publisher/queue/memqueue/consume.go | 4 ++-- libbeat/publisher/queue/memqueue/eventloop.go | 8 ++++---- libbeat/publisher/queue/memqueue/produce.go | 6 +++--- .../publisher/queue/memqueue/queue_test.go | 2 +- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/CHANGELOG-developer.next.asciidoc b/CHANGELOG-developer.next.asciidoc index e7df48150008..e91d48dd73ef 100644 --- a/CHANGELOG-developer.next.asciidoc +++ b/CHANGELOG-developer.next.asciidoc @@ -29,6 +29,7 @@ The list below covers the major changes between 7.0.0-rc2 and master only. - Move light modules to OSS. {pull}14369[14369] - Deprecate test flags, `generate` and `update_expected`, in favor of `data`. {pull}15292[15292] - Python 3 is required now to run python tests and tools. {pull}14798[14798] +- The type `memqueue.Broker` is no longer exported; instead of `memqueue.NewBroker`, call `memqueue.NewQueue` (which provides the same public interface). {pull}16667[16667] ==== Bugfixes diff --git a/libbeat/monitoring/report/elasticsearch/elasticsearch.go b/libbeat/monitoring/report/elasticsearch/elasticsearch.go index ebb14bf28ead..965c13da6577 100644 --- a/libbeat/monitoring/report/elasticsearch/elasticsearch.go +++ b/libbeat/monitoring/report/elasticsearch/elasticsearch.go @@ -172,7 +172,7 @@ func makeReporter(beat beat.Info, settings report.Settings, cfg *common.Config) } queueFactory := func(e queue.Eventer) (queue.Queue, error) { - return memqueue.NewBroker(log, + return memqueue.NewQueue(log, memqueue.Settings{ Eventer: e, Events: 20, diff --git a/libbeat/publisher/queue/memqueue/ackloop.go b/libbeat/publisher/queue/memqueue/ackloop.go index 5c79dab38db6..e8126733de4d 100644 --- a/libbeat/publisher/queue/memqueue/ackloop.go +++ b/libbeat/publisher/queue/memqueue/ackloop.go @@ -23,7 +23,7 @@ package memqueue // broker event loop. // Producer ACKs are run in the ackLoop go-routine. type ackLoop struct { - broker *Broker + broker *broker sig chan batchAckMsg lst chanList @@ -36,7 +36,7 @@ type ackLoop struct { processACK func(chanList, int) } -func newACKLoop(b *Broker, processACK func(chanList, int)) *ackLoop { +func newACKLoop(b *broker, processACK func(chanList, int)) *ackLoop { l := &ackLoop{broker: b} l.processACK = processACK return l diff --git a/libbeat/publisher/queue/memqueue/broker.go b/libbeat/publisher/queue/memqueue/broker.go index de0b54caba23..443ff3542f42 100644 --- a/libbeat/publisher/queue/memqueue/broker.go +++ b/libbeat/publisher/queue/memqueue/broker.go @@ -36,7 +36,7 @@ var Feature = queue.Feature("mem", feature.Stable), ) -type Broker struct { +type broker struct { done chan struct{} logger logger @@ -97,7 +97,7 @@ func create(eventer queue.Eventer, logger *logp.Logger, cfg *common.Config) (que logger = logp.L() } - return NewBroker(logger, Settings{ + return NewQueue(logger, Settings{ Eventer: eventer, Events: config.Events, FlushMinEvents: config.FlushMinEvents, @@ -105,13 +105,13 @@ func create(eventer queue.Eventer, logger *logp.Logger, cfg *common.Config) (que }), nil } -// NewBroker creates a new broker based in-memory queue holding up to sz number of events. +// NewQueue creates a new broker based in-memory queue holding up to sz number of events. // If waitOnClose is set to true, the broker will block on Close, until all internal // workers handling incoming messages and ACKs have been shut down. -func NewBroker( +func NewQueue( logger logger, settings Settings, -) *Broker { +) queue.Queue { // define internal channel size for producer/client requests // to the broker chanSize := 20 @@ -137,7 +137,7 @@ func NewBroker( logger = logp.NewLogger("memqueue") } - b := &Broker{ + b := &broker{ done: make(chan struct{}), logger: logger, @@ -182,7 +182,7 @@ func NewBroker( return b } -func (b *Broker) Close() error { +func (b *broker) Close() error { close(b.done) if b.waitOnClose { b.wg.Wait() @@ -190,17 +190,17 @@ func (b *Broker) Close() error { return nil } -func (b *Broker) BufferConfig() queue.BufferConfig { +func (b *broker) BufferConfig() queue.BufferConfig { return queue.BufferConfig{ Events: b.bufSize, } } -func (b *Broker) Producer(cfg queue.ProducerConfig) queue.Producer { +func (b *broker) Producer(cfg queue.ProducerConfig) queue.Producer { return newProducer(b, cfg.ACK, cfg.OnDrop, cfg.DropOnCancel) } -func (b *Broker) Consumer() queue.Consumer { +func (b *broker) Consumer() queue.Consumer { return newConsumer(b) } diff --git a/libbeat/publisher/queue/memqueue/consume.go b/libbeat/publisher/queue/memqueue/consume.go index 013642eadc8f..f225fc130066 100644 --- a/libbeat/publisher/queue/memqueue/consume.go +++ b/libbeat/publisher/queue/memqueue/consume.go @@ -27,7 +27,7 @@ import ( ) type consumer struct { - broker *Broker + broker *broker resp chan getResponse done chan struct{} @@ -49,7 +49,7 @@ const ( batchACK ) -func newConsumer(b *Broker) *consumer { +func newConsumer(b *broker) *consumer { return &consumer{ broker: b, resp: make(chan getResponse), diff --git a/libbeat/publisher/queue/memqueue/eventloop.go b/libbeat/publisher/queue/memqueue/eventloop.go index 79769da504dd..83ab4fb7b5b1 100644 --- a/libbeat/publisher/queue/memqueue/eventloop.go +++ b/libbeat/publisher/queue/memqueue/eventloop.go @@ -26,7 +26,7 @@ import ( // directEventLoop implements the broker main event loop. It buffers events, // but tries to forward events as early as possible. type directEventLoop struct { - broker *Broker + broker *broker buf ringBuffer @@ -45,7 +45,7 @@ type directEventLoop struct { // bufferingEventLoop implements the broker main event loop. // Events in the buffer are forwarded to consumers only if the buffer is full or on flush timeout. type bufferingEventLoop struct { - broker *Broker + broker *broker buf *batchBuffer flushList flushList @@ -77,7 +77,7 @@ type flushList struct { count int } -func newDirectEventLoop(b *Broker, size int) *directEventLoop { +func newDirectEventLoop(b *broker, size int) *directEventLoop { l := &directEventLoop{ broker: b, events: b.events, @@ -285,7 +285,7 @@ func (l *directEventLoop) processACK(lst chanList, N int) { } } -func newBufferingEventLoop(b *Broker, size int, minEvents int, flushTimeout time.Duration) *bufferingEventLoop { +func newBufferingEventLoop(b *broker, size int, minEvents int, flushTimeout time.Duration) *bufferingEventLoop { l := &bufferingEventLoop{ broker: b, maxEvents: size, diff --git a/libbeat/publisher/queue/memqueue/produce.go b/libbeat/publisher/queue/memqueue/produce.go index 1409ea9941f5..67c0c49f62ab 100644 --- a/libbeat/publisher/queue/memqueue/produce.go +++ b/libbeat/publisher/queue/memqueue/produce.go @@ -25,12 +25,12 @@ import ( ) type forgetfulProducer struct { - broker *Broker + broker *broker openState openState } type ackProducer struct { - broker *Broker + broker *broker cancel bool seq uint32 state produceState @@ -53,7 +53,7 @@ type produceState struct { type ackHandler func(count int) -func newProducer(b *Broker, cb ackHandler, dropCB func(beat.Event), dropOnCancel bool) queue.Producer { +func newProducer(b *broker, cb ackHandler, dropCB func(beat.Event), dropOnCancel bool) queue.Producer { openState := openState{ log: b.logger, isOpen: atomic.MakeBool(true), diff --git a/libbeat/publisher/queue/memqueue/queue_test.go b/libbeat/publisher/queue/memqueue/queue_test.go index b65ad96ea26a..eca1f1918caf 100644 --- a/libbeat/publisher/queue/memqueue/queue_test.go +++ b/libbeat/publisher/queue/memqueue/queue_test.go @@ -74,7 +74,7 @@ func TestProducerCancelRemovesEvents(t *testing.T) { func makeTestQueue(sz, minEvents int, flushTimeout time.Duration) queuetest.QueueFactory { return func(_ *testing.T) queue.Queue { - return NewBroker(nil, Settings{ + return NewQueue(nil, Settings{ Events: sz, FlushMinEvents: minEvents, FlushTimeout: flushTimeout, From 421fd91af7531624d74c42c3c892c89399d12b65 Mon Sep 17 00:00:00 2001 From: DeDe Morton Date: Thu, 27 Feb 2020 13:27:18 -0800 Subject: [PATCH 14/21] [docs] Add skeleton files for 7.7 release highlights and breaking changes (#16584) --- .../breaking/breaking-7.7.asciidoc | 20 ++++++++++++++ .../release-notes/breaking/breaking.asciidoc | 4 +++ .../highlights/highlights-7.7.0.asciidoc | 26 +++++++++++++++++++ .../highlights/highlights.asciidoc | 4 +++ 4 files changed, 54 insertions(+) create mode 100644 libbeat/docs/release-notes/breaking/breaking-7.7.asciidoc create mode 100644 libbeat/docs/release-notes/highlights/highlights-7.7.0.asciidoc diff --git a/libbeat/docs/release-notes/breaking/breaking-7.7.asciidoc b/libbeat/docs/release-notes/breaking/breaking-7.7.asciidoc new file mode 100644 index 000000000000..201af453dea1 --- /dev/null +++ b/libbeat/docs/release-notes/breaking/breaking-7.7.asciidoc @@ -0,0 +1,20 @@ +[[breaking-changes-7.7]] + +=== Breaking changes in 7.7 +++++ +7.7 +++++ + +{see-relnotes} + +//NOTE: The notable-breaking-changes tagged regions are re-used in the +//Installation and Upgrade Guide + +//tag::notable-breaking-changes[] + +//[float] +//==== Breaking change + +//Description + +// end::notable-breaking-changes[] diff --git a/libbeat/docs/release-notes/breaking/breaking.asciidoc b/libbeat/docs/release-notes/breaking/breaking.asciidoc index cb6aec8d0cec..51e58e6ba9d6 100644 --- a/libbeat/docs/release-notes/breaking/breaking.asciidoc +++ b/libbeat/docs/release-notes/breaking/breaking.asciidoc @@ -11,6 +11,8 @@ changes, but there are breaking changes between major versions (e.g. 6.x to See the following topics for a description of breaking changes: +* <> + * <> * <> @@ -25,6 +27,8 @@ See the following topics for a description of breaking changes: * <> +include::breaking-7.7.asciidoc[] + include::breaking-7.6.asciidoc[] include::breaking-7.5.asciidoc[] diff --git a/libbeat/docs/release-notes/highlights/highlights-7.7.0.asciidoc b/libbeat/docs/release-notes/highlights/highlights-7.7.0.asciidoc new file mode 100644 index 000000000000..51fe50c30a9d --- /dev/null +++ b/libbeat/docs/release-notes/highlights/highlights-7.7.0.asciidoc @@ -0,0 +1,26 @@ +[[release-highlights-7.7.0]] +=== 7.7 release highlights +++++ +7.7 +++++ + +Each release of {beats} brings new features and product improvements. +Following are the most notable features and enhancements in 7.7. + +For a complete list of related highlights, see the +https://www.elastic.co/blog/elastic-observability-7-6-0-released[Observability 7.7 release blog]. + +For a list of bug fixes and other changes, see the {beats} +<> and <>. + +//NOTE: The notable-highlights tagged regions are re-used in the +//Installation and Upgrade Guide + +// tag::notable-highlights[] + +//[float] +//==== highlight + +//Description + +// end::notable-highlights[] diff --git a/libbeat/docs/release-notes/highlights/highlights.asciidoc b/libbeat/docs/release-notes/highlights/highlights.asciidoc index 37b95396fc7d..1cd260abef63 100644 --- a/libbeat/docs/release-notes/highlights/highlights.asciidoc +++ b/libbeat/docs/release-notes/highlights/highlights.asciidoc @@ -4,6 +4,8 @@ This section summarizes the most important changes in each release. For the full list, see <> and <>. +* <> + * <> * <> @@ -18,6 +20,8 @@ full list, see <> and <>. * <> +include::highlights-7.7.0.asciidoc[] + include::highlights-7.6.0.asciidoc[] include::highlights-7.5.0.asciidoc[] From 6e79791a17588ac6c5f0629d3bceebd63681ed5d Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Thu, 27 Feb 2020 15:05:36 -0700 Subject: [PATCH 15/21] [Metricbeat] Add vpc metricset for aws module (#16111) * Add vpn into vpc metricset * Add NATGateway and TrasitGateway --- CHANGELOG.asciidoc | 1 + metricbeat/docs/fields.asciidoc | 6 + metricbeat/docs/modules/aws.asciidoc | 4 + metricbeat/docs/modules/aws/vpc.asciidoc | 24 ++++ metricbeat/docs/modules_list.asciidoc | 3 +- x-pack/metricbeat/module/aws/fields.go | 2 +- x-pack/metricbeat/module/aws/module.yml | 1 + .../metricbeat/module/aws/vpc/_meta/data.json | 74 +++++++++++++ .../module/aws/vpc/_meta/docs.asciidoc | 103 ++++++++++++++++++ .../module/aws/vpc/_meta/fields.yml | 6 + x-pack/metricbeat/module/aws/vpc/manifest.yml | 44 ++++++++ .../module/aws/vpc/vpc_integration_test.go | 46 ++++++++ x-pack/metricbeat/module/aws/vpc/vpc_test.go | 21 ++++ 13 files changed, 333 insertions(+), 2 deletions(-) create mode 100644 metricbeat/docs/modules/aws/vpc.asciidoc create mode 100644 x-pack/metricbeat/module/aws/vpc/_meta/data.json create mode 100644 x-pack/metricbeat/module/aws/vpc/_meta/docs.asciidoc create mode 100644 x-pack/metricbeat/module/aws/vpc/_meta/fields.yml create mode 100644 x-pack/metricbeat/module/aws/vpc/manifest.yml create mode 100644 x-pack/metricbeat/module/aws/vpc/vpc_integration_test.go create mode 100644 x-pack/metricbeat/module/aws/vpc/vpc_test.go diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b16d40b7bc14..b3fa34b8b9b9 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -179,6 +179,7 @@ processing events. (CVE-2019-17596) See https://www.elastic.co/community/securit - Release cloudwatch, s3_daily_storage, s3_request, sqs and rds metricset as GA. {pull}14114[14114] {issue}14059[14059] - Add `elasticsearch/enrich` metricset. {pull}14243[14243] {issue}14221[14221] - Add new dashboards for Azure vms, vm guest metrics, vm scale sets {pull}14000[14000] +- Add vpc metricset for aws module. {pull}16111[16111] {issue}14854[14854] *Functionbeat* diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index c2e3dccf8b35..a16eee66cdb4 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -3085,6 +3085,12 @@ type: keyword `usage` contains the metrics from Cloudwatch to track usage of some AWS resources. +[float] +=== vpc + +`vpc` contains the metrics from Cloudwatch to track usage of VPC related resources. + + [[exported-fields-azure]] == azure fields diff --git a/metricbeat/docs/modules/aws.asciidoc b/metricbeat/docs/modules/aws.asciidoc index 6f157672faf7..23ed3c601505 100644 --- a/metricbeat/docs/modules/aws.asciidoc +++ b/metricbeat/docs/modules/aws.asciidoc @@ -330,6 +330,8 @@ The following metricsets are available: * <> +* <> + include::aws/billing.asciidoc[] include::aws/cloudwatch.asciidoc[] @@ -356,3 +358,5 @@ include::aws/sqs.asciidoc[] include::aws/usage.asciidoc[] +include::aws/vpc.asciidoc[] + diff --git a/metricbeat/docs/modules/aws/vpc.asciidoc b/metricbeat/docs/modules/aws/vpc.asciidoc new file mode 100644 index 000000000000..ceb8f93f2cb7 --- /dev/null +++ b/metricbeat/docs/modules/aws/vpc.asciidoc @@ -0,0 +1,24 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-aws-vpc]] +=== aws vpc metricset + +beta[] + +include::../../../../x-pack/metricbeat/module/aws/vpc/_meta/docs.asciidoc[] + +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../../x-pack/metricbeat/module/aws/vpc/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 31970139d137..cc38d9895940 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -16,7 +16,7 @@ This file is generated! See scripts/mage/docs_collector.go |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .1+| .1+| |<> beta[] |<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.13+| .13+| |<> beta[] +.14+| .14+| |<> beta[] |<> |<> beta[] |<> @@ -29,6 +29,7 @@ This file is generated! See scripts/mage/docs_collector.go |<> beta[] |<> |<> beta[] +|<> beta[] |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | .5+| .5+| |<> beta[] |<> beta[] diff --git a/x-pack/metricbeat/module/aws/fields.go b/x-pack/metricbeat/module/aws/fields.go index 6b6e11857664..294bebcb31a9 100644 --- a/x-pack/metricbeat/module/aws/fields.go +++ b/x-pack/metricbeat/module/aws/fields.go @@ -19,5 +19,5 @@ func init() { // AssetAws returns asset data. // This is the base64 encoded gzipped contents of module/aws. func AssetAws() string { - return "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" + return "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" } diff --git a/x-pack/metricbeat/module/aws/module.yml b/x-pack/metricbeat/module/aws/module.yml index d750f2bedd5a..70c002a83d5c 100644 --- a/x-pack/metricbeat/module/aws/module.yml +++ b/x-pack/metricbeat/module/aws/module.yml @@ -7,3 +7,4 @@ metricsets: - sns - lambda - dynamodb + - vpc diff --git a/x-pack/metricbeat/module/aws/vpc/_meta/data.json b/x-pack/metricbeat/module/aws/vpc/_meta/data.json new file mode 100644 index 000000000000..c07599fbce16 --- /dev/null +++ b/x-pack/metricbeat/module/aws/vpc/_meta/data.json @@ -0,0 +1,74 @@ +{ + "@timestamp": "2017-10-12T08:05:34.853Z", + "aws": { + "cloudwatch": { + "namespace": "AWS/NATGateway" + }, + "dimensions": { + "NatGatewayId": "nat-0a5cb7b9807908cc0" + }, + "natgateway": { + "metrics": { + "ActiveConnectionCount": { + "max": 0 + }, + "BytesInFromDestination": { + "sum": 0 + }, + "BytesInFromSource": { + "sum": 0 + }, + "BytesOutToDestination": { + "sum": 0 + }, + "BytesOutToSource": { + "sum": 0 + }, + "ConnectionAttemptCount": { + "sum": 0 + }, + "ConnectionEstablishedCount": { + "sum": 0 + }, + "ErrorPortAllocation": { + "sum": 0 + }, + "PacketsDropCount": { + "sum": 0 + }, + "PacketsInFromDestination": { + "sum": 0 + }, + "PacketsInFromSource": { + "sum": 0 + }, + "PacketsOutToDestination": { + "sum": 0 + }, + "PacketsOutToSource": { + "sum": 0 + } + } + } + }, + "cloud": { + "account": { + "id": "627959692251", + "name": "elastic-test" + }, + "provider": "aws", + "region": "us-west-2" + }, + "event": { + "dataset": "aws.vpc", + "duration": 115000, + "module": "aws" + }, + "metricset": { + "name": "vpc", + "period": 10000 + }, + "service": { + "type": "aws" + } +} \ No newline at end of file diff --git a/x-pack/metricbeat/module/aws/vpc/_meta/docs.asciidoc b/x-pack/metricbeat/module/aws/vpc/_meta/docs.asciidoc new file mode 100644 index 000000000000..8ede70730b96 --- /dev/null +++ b/x-pack/metricbeat/module/aws/vpc/_meta/docs.asciidoc @@ -0,0 +1,103 @@ +The vpc metricset of aws module allows users to monitor VPC related services: NAT +gateway, transit gateway and VPN tunnels. +NAT gateway metric data can be used to monitor and troubleshoot NAT gateways and +the data is provided at 1-minute intervals to CloudWatch. +Transit gateway metrics are sent to CloudWatch by VPC only when requests are +flowing through the gateway. If there are requests flowing through the transit +gateway, Amazon VPC measures and sends its metrics in 1-minute intervals. +VPN metric data is automatically sent to CloudWatch as it becomes available. Users +can use these metrics to gain a better perspective on how the web application or +service is performing. + +[float] +=== AWS Permissions +Some specific AWS permissions are required for IAM user to collect usage metrics. +---- +ec2:DescribeRegions +cloudwatch:GetMetricData +cloudwatch:ListMetrics +tag:getResources +sts:GetCallerIdentity +iam:ListAccountAliases +---- + +[float] +=== Configuration example +[source,yaml] +---- +- module: aws + period: 1m + metricsets: + - vpc + # This module uses the aws cloudwatch metricset, all + # the options for this metricset are also available here. +---- + +[float] +=== Metrics and Dimensions for NAT gateway +Metrics: +|=== +|Metric Name|Statistic Method | Description +|ActiveConnectionCount | Max | The total number of concurrent active TCP connections through the NAT gateway. +|BytesInFromDestination | Sum | The number of bytes received by the NAT gateway from the destination. +|BytesInFromSource | Sum | The number of bytes received by the NAT gateway from clients in your VPC. +|BytesOutToDestination | Sum | The number of bytes sent out through the NAT gateway to the destination. +|BytesOutToSource | Sum | The number of bytes sent through the NAT gateway to the clients in your VPC. +|ConnectionAttemptCount | Sum | The number of connection attempts made through the NAT gateway. +|ConnectionEstablishedCount | Sum | The number of connections established through the NAT gateway. +|ErrorPortAllocation | Sum | The number of times the NAT gateway could not allocate a source port. +|IdleTimeoutCount | Sum | The number of connections that transitioned from the active state to the idle state. +|PacketsDropCount | Sum | The number of packets dropped by the NAT gateway. +|PacketsInFromDestination | Sum | The number of packets received by the NAT gateway from the destination. +|PacketsInFromSource | Sum | The number of packets received by the NAT gateway from clients in your VPC. +|PacketsOutToDestination | Sum | The number of packets sent out through the NAT gateway to the destination. +|PacketsOutToSource | Sum | The number of packets sent through the NAT gateway to the clients in your VPC. +|=== + +Dimensions: +|=== +|Dimension Name| Description +|NatGatewayId | Filter the metric data by the NAT gateway ID. +|=== + +Please see https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway-cloudwatch.html[NAT Gateway CloudWatch Metrics] for more details. + +[float] +=== Metrics and Dimensions for Transit gateway +Metrics: +|=== +|Metric Name|Statistic Method | Description +|BytesIn | Sum | The number of bytes received by the transit gateway. +|BytesOut | Sum | The number of bytes sent from the transit gateway. +|PacketsIn | Sum | The number of packets received by the transit gateway. +|PacketsOut | Sum | The number of packets sent by the transit gateway. +|PacketDropCountBlackhole | Sum | The number of packets dropped because they matched a blackhole route. +|PacketDropCountNoRoute | Sum | The number of packets dropped because they did not match a route. +|=== + +Dimensions: +|=== +|Dimension Name| Description +|TransitGateway | Filters the metric data by transit gateway. +|=== + +Please see https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-cloudwatch-metrics.html[Transit Gateway Metrics] for more details. + +[float] +=== Metrics and Dimensions for VPN +Metrics: +|=== +|Metric Name|Statistic Method | Description +|TunnelState | Max | The state of the tunnel. For static VPNs, 0 indicates DOWN and 1 indicates UP. For BGP VPNs, 1 indicates ESTABLISHED and 0 is used for all other states. +|TunnelDataIn| Sum | The bytes received through the VPN tunnel. +|TunnelDataOut| Sum | The bytes sent through the VPN tunnel. +|=== + +Dimensions: +|=== +|Dimension Name| Description +|VpnId | Filters the metric data by the Site-to-Site VPN connection ID. +|TunnelIpAddress | Filters the metric data by the IP address of the tunnel for the virtual private gateway. +|=== + +Please see https://docs.aws.amazon.com/vpn/latest/s2svpn/monitoring-cloudwatch-vpn.html[VPN Tunnel CloudWatch Metrics] for more details. diff --git a/x-pack/metricbeat/module/aws/vpc/_meta/fields.yml b/x-pack/metricbeat/module/aws/vpc/_meta/fields.yml new file mode 100644 index 000000000000..dadb3adc5f76 --- /dev/null +++ b/x-pack/metricbeat/module/aws/vpc/_meta/fields.yml @@ -0,0 +1,6 @@ +- name: vpc + type: group + description: > + `vpc` contains the metrics from Cloudwatch to track usage of VPC related resources. + release: beta + fields: diff --git a/x-pack/metricbeat/module/aws/vpc/manifest.yml b/x-pack/metricbeat/module/aws/vpc/manifest.yml new file mode 100644 index 000000000000..71f9c2e93618 --- /dev/null +++ b/x-pack/metricbeat/module/aws/vpc/manifest.yml @@ -0,0 +1,44 @@ +default: true +input: + module: aws + metricset: cloudwatch + defaults: + metrics: + - namespace: AWS/VPN + statistic: ["Average"] + name: + - TunnelState + - namespace: AWS/VPN + statistic: ["Sum"] + name: + - TunnelDataIn + - TunnelDataOut + - namespace: AWS/TransitGateway + statistic: ["Sum"] + name: + - BytesIn + - BytesOut + - PacketsIn + - PacketsOut + - PacketDropCountBlackhole + - PacketDropCountNoRoute + - namespace: AWS/NATGateway + statistic: ["Sum"] + name: + - BytesInFromDestination + - BytesInFromSource + - BytesOutToDestination + - BytesOutToSource + - ConnectionAttemptCount + - ConnectionEstablishedCount + - ErrorPortAllocation + - IdleTimeoutCount + - PacketsDropCount + - PacketsInFromDestination + - PacketsInFromSource + - PacketsOutToDestination + - PacketsOutToSource + - namespace: AWS/NATGateway + statistic: ["Maximum"] + name: + - ActiveConnectionCount diff --git a/x-pack/metricbeat/module/aws/vpc/vpc_integration_test.go b/x-pack/metricbeat/module/aws/vpc/vpc_integration_test.go new file mode 100644 index 000000000000..c3bc08bdeda4 --- /dev/null +++ b/x-pack/metricbeat/module/aws/vpc/vpc_integration_test.go @@ -0,0 +1,46 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build integration + +package vpc + +import ( + "fmt" + "testing" + + "github.com/elastic/beats/libbeat/common" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + "github.com/elastic/beats/x-pack/metricbeat/module/aws/mtest" +) + +func TestData(t *testing.T) { + namespaceIs := func(namespace string) func(e common.MapStr) bool { + return func(e common.MapStr) bool { + v, err := e.GetValue("aws.cloudwatch.namespace") + return err == nil && v == namespace + } + } + + dataFiles := []struct { + namespace string + path string + }{ + {"AWS/NATGateway", "./_meta/data.json"}, + {"AWS/VPN", "./_meta/data_vpn.json"}, + {"AWS/TransitGateway", "./_meta/data_transit_gateway.json"}, + } + + config, info := mtest.GetConfigForTest("vpc", "300s") + if info != "" { + t.Skip("Skipping TestData: " + info) + } + + for _, df := range dataFiles { + metricSet := mbtest.NewFetcher(t, config) + t.Run(fmt.Sprintf("namespace: %s", df.namespace), func(t *testing.T) { + metricSet.WriteEventsCond(t, df.path, namespaceIs(df.namespace)) + }) + } +} diff --git a/x-pack/metricbeat/module/aws/vpc/vpc_test.go b/x-pack/metricbeat/module/aws/vpc/vpc_test.go new file mode 100644 index 000000000000..634c4ce09cdd --- /dev/null +++ b/x-pack/metricbeat/module/aws/vpc/vpc_test.go @@ -0,0 +1,21 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package vpc + +import ( + "os" + + "github.com/elastic/beats/metricbeat/mb" + + // Register input module and metricset + _ "github.com/elastic/beats/x-pack/metricbeat/module/aws" + _ "github.com/elastic/beats/x-pack/metricbeat/module/aws/cloudwatch" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} From ba49a12ff29b3c02007f44f2c5bb5a63e1a89e87 Mon Sep 17 00:00:00 2001 From: DeDe Morton Date: Thu, 27 Feb 2020 19:04:29 -0800 Subject: [PATCH 16/21] Update cisco.asciidoc (#16434) * Update cisco.asciidoc Making Elasticsearch explicit in the instructions * Update docs source in the module dir Co-authored-by: Loek van Gool --- filebeat/docs/modules/cisco.asciidoc | 10 +++++----- x-pack/filebeat/module/cisco/_meta/docs.asciidoc | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/filebeat/docs/modules/cisco.asciidoc b/filebeat/docs/modules/cisco.asciidoc index b90f1ea8c5b1..14d571e61726 100644 --- a/filebeat/docs/modules/cisco.asciidoc +++ b/filebeat/docs/modules/cisco.asciidoc @@ -285,11 +285,11 @@ include::../include/timezone-support.asciidoc[] [[dynamic-script-compilations]] === Dynamic Script Compilations -The `asa` and `ftd` filesets are based on ingest pipelines and make extensive -use of script processors and painless conditions. This can cause the pipelines -to fail loading the first time the module is used, due to exceeding the maximum -script compilation limits. It is recommended to tune the following parameters -on your cluster: +The `asa` and `ftd` filesets are based on Elasticsearch ingest pipelines and +make extensive use of script processors and painless conditions. This can cause +the pipelines to fail loading the first time the module is used, due to exceeding +the maximum script compilation limits. It is recommended to tune the following +parameters on your Elasticsearch cluster: - {ref}/circuit-breaker.html#script-compilation-circuit-breaker[script.max_compilations_rate]: Increase to at least `100/5m`. diff --git a/x-pack/filebeat/module/cisco/_meta/docs.asciidoc b/x-pack/filebeat/module/cisco/_meta/docs.asciidoc index 96add391fa2f..f1a40037f6e2 100644 --- a/x-pack/filebeat/module/cisco/_meta/docs.asciidoc +++ b/x-pack/filebeat/module/cisco/_meta/docs.asciidoc @@ -280,11 +280,11 @@ include::../include/timezone-support.asciidoc[] [[dynamic-script-compilations]] === Dynamic Script Compilations -The `asa` and `ftd` filesets are based on ingest pipelines and make extensive -use of script processors and painless conditions. This can cause the pipelines -to fail loading the first time the module is used, due to exceeding the maximum -script compilation limits. It is recommended to tune the following parameters -on your cluster: +The `asa` and `ftd` filesets are based on Elasticsearch ingest pipelines and +make extensive use of script processors and painless conditions. This can cause +the pipelines to fail loading the first time the module is used, due to exceeding +the maximum script compilation limits. It is recommended to tune the following +parameters on your Elasticsearch cluster: - {ref}/circuit-breaker.html#script-compilation-circuit-breaker[script.max_compilations_rate]: Increase to at least `100/5m`. From 8d5367ad8256777e651427729fa65b885361ab8f Mon Sep 17 00:00:00 2001 From: DeDe Morton Date: Thu, 27 Feb 2020 19:05:09 -0800 Subject: [PATCH 17/21] Fix wording in dev guide (#16497) --- docs/devguide/modules-dev-guide.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devguide/modules-dev-guide.asciidoc b/docs/devguide/modules-dev-guide.asciidoc index d6807fd2b38b..d25161a079c8 100644 --- a/docs/devguide/modules-dev-guide.asciidoc +++ b/docs/devguide/modules-dev-guide.asciidoc @@ -457,7 +457,7 @@ make create-fields MODULE={module} FILESET={fileset} ---- Please, always check the generated file and make sure the fields are correct. -Documentation of fields must be added manually. +You must add field documentation manually. If the fields are correct, it is time to generate documentation, configuration and Kibana index patterns. From 60c3df052ba00f0eea09f73b0d26f46aa87a9673 Mon Sep 17 00:00:00 2001 From: Harold Schreckengost Date: Fri, 28 Feb 2020 04:21:54 -0600 Subject: [PATCH 18/21] Added NetBeat (#12612) --- libbeat/docs/communitybeats.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/libbeat/docs/communitybeats.asciidoc b/libbeat/docs/communitybeats.asciidoc index 63d23b9092fc..f54475c3af80 100644 --- a/libbeat/docs/communitybeats.asciidoc +++ b/libbeat/docs/communitybeats.asciidoc @@ -78,6 +78,7 @@ https://github.com/adibendahan/mysqlbeat[mysqlbeat]:: Run any query on MySQL and https://github.com/PhaedrusTheGreek/nagioscheckbeat[nagioscheckbeat]:: For Nagios checks and performance data. https://github.com/nfvsap/natsbeat[natsbeat]:: Collects data from NATS monitoring endpoints https://github.com/radoondas/netatmobeat[netatmobeat]:: Reads data from Netatmo weather station. +https://github.com/hmschreck/netbeat[netbeat]:: Reads configurable data from SNMP-enabled devices. https://github.com/mrkschan/nginxbeat[nginxbeat]:: Reads status from Nginx. https://github.com/2Fast2BCn/nginxupstreambeat[nginxupstreambeat]:: Reads upstream status from nginx upstream module. https://github.com/mschneider82/nsqbeat[nsqbeat]:: Reads data from a NSQ topic. From 37ab97d25f469856fab6aaed521eb35332bdffc1 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 28 Feb 2020 15:13:13 +0100 Subject: [PATCH 19/21] Close files earlier when generating fields files (#16681) Fields generator keeps all open files while generating the global fields.yml file. This is not needed and may lead to "too many open files" errors in some environments. --- libbeat/generator/fields/fields.go | 32 +++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/libbeat/generator/fields/fields.go b/libbeat/generator/fields/fields.go index c6210b28d2ed..d61e9f225378 100644 --- a/libbeat/generator/fields/fields.go +++ b/libbeat/generator/fields/fields.go @@ -123,24 +123,32 @@ func writeGeneratedFieldsYml(fieldFiles []*YmlFile, output io.Writer) error { func GenerateFieldsYml(fieldFiles []*YmlFile) ([]byte, error) { buf := bytes.NewBufferString("") for _, p := range fieldFiles { - file, err := os.Open(p.Path) + err := generateFieldsYmlForFile(buf, p) if err != nil { return nil, err } - defer file.Close() + } + return buf.Bytes(), nil +} - fs := bufio.NewScanner(file) - for fs.Scan() { - err = writeIndentedLine(buf, fs.Text()+"\n", p.Indent) - if err != nil { - return nil, err - } - } - if err := fs.Err(); err != nil { - return nil, err +func generateFieldsYmlForFile(buf *bytes.Buffer, p *YmlFile) error { + file, err := os.Open(p.Path) + if err != nil { + return err + } + defer file.Close() + + fs := bufio.NewScanner(file) + for fs.Scan() { + err = writeIndentedLine(buf, fs.Text()+"\n", p.Indent) + if err != nil { + return err } } - return buf.Bytes(), nil + if err := fs.Err(); err != nil { + return err + } + return nil } func writeIndentedLine(buf *bytes.Buffer, line string, indent int) error { From 06c758555635560fb835ae706b7d2dee7d778cab Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Fri, 28 Feb 2020 15:19:32 +0100 Subject: [PATCH 20/21] [Metricbeat] Add new module for Redis Enterprise (#16482) Add metricsets: node, proxy --- CHANGELOG.next.asciidoc | 1 + libbeat/tests/compose/compose.go | 7 + libbeat/tests/compose/project.go | 9 + libbeat/tests/compose/wrapper.go | 38 ++++ metricbeat/docs/fields.asciidoc | 15 ++ metricbeat/docs/modules/redis.asciidoc | 4 +- .../docs/modules/redisenterprise.asciidoc | 62 +++++++ .../modules/redisenterprise/node.asciidoc | 24 +++ .../modules/redisenterprise/proxy.asciidoc | 24 +++ metricbeat/docs/modules_list.asciidoc | 4 + metricbeat/mb/testing/data/data_test.go | 3 +- metricbeat/module/redis/_meta/docs.asciidoc | 4 +- metricbeat/module/redis/docker-compose.yml | 1 + metricbeat/module/redis/module.yml | 5 +- metricbeat/module/redis/test_redis.py | 2 + x-pack/metricbeat/include/list.go | 1 + x-pack/metricbeat/metricbeat.reference.yml | 10 ++ .../module/redisenterprise/_meta/Dockerfile | 6 + .../_meta/config.reference.yml | 8 + .../module/redisenterprise/_meta/config.yml | 8 + .../redisenterprise/_meta/docs.asciidoc | 18 ++ .../module/redisenterprise/_meta/fields.yml | 11 ++ .../redisenterprise/_meta/healthcheck.sh | 21 +++ .../_meta/supported-versions.yml | 2 + .../module/redisenterprise/docker-compose.yml | 13 ++ .../module/redisenterprise/fields.go | 23 +++ .../module/redisenterprise/module.yml | 4 + .../redisenterprise/node/_meta/data.json | 84 +++++++++ .../redisenterprise/node/_meta/docs.asciidoc | 1 + .../redisenterprise/node/_meta/fields.yml | 4 + .../node/_meta/testdata/config.yml | 4 + .../_meta/testdata/redis-node.5.4.10-22.plain | 144 +++++++++++++++ .../redis-node.5.4.10-22.plain-expected.json | 75 ++++++++ .../module/redisenterprise/node/manifest.yml | 9 + .../node/node_integration_test.go | 48 +++++ .../module/redisenterprise/node/node_test.go | 32 ++++ .../redisenterprise/proxy/_meta/data.json | 86 +++++++++ .../redisenterprise/proxy/_meta/docs.asciidoc | 1 + .../redisenterprise/proxy/_meta/fields.yml | 4 + .../proxy/_meta/testdata/config.yml | 4 + .../testdata/redis-proxy.5.4.10-22.plain | 168 ++++++++++++++++++ .../redis-proxy.5.4.10-22.plain-expected.json | 87 +++++++++ .../module/redisenterprise/proxy/manifest.yml | 9 + .../proxy/proxy_integration_test.go | 48 +++++ .../redisenterprise/proxy/proxy_test.go | 32 ++++ .../redisenterprise/test_redisenterprise.py | 50 ++++++ .../modules.d/redisenterprise.yml.disabled | 11 ++ 47 files changed, 1221 insertions(+), 8 deletions(-) create mode 100644 metricbeat/docs/modules/redisenterprise.asciidoc create mode 100644 metricbeat/docs/modules/redisenterprise/node.asciidoc create mode 100644 metricbeat/docs/modules/redisenterprise/proxy.asciidoc create mode 100644 x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile create mode 100644 x-pack/metricbeat/module/redisenterprise/_meta/config.reference.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/_meta/config.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc create mode 100644 x-pack/metricbeat/module/redisenterprise/_meta/fields.yml create mode 100755 x-pack/metricbeat/module/redisenterprise/_meta/healthcheck.sh create mode 100644 x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/docker-compose.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/fields.go create mode 100644 x-pack/metricbeat/module/redisenterprise/module.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/node/_meta/data.json create mode 100644 x-pack/metricbeat/module/redisenterprise/node/_meta/docs.asciidoc create mode 100644 x-pack/metricbeat/module/redisenterprise/node/_meta/fields.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/config.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain create mode 100644 x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json create mode 100644 x-pack/metricbeat/module/redisenterprise/node/manifest.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/node/node_integration_test.go create mode 100644 x-pack/metricbeat/module/redisenterprise/node/node_test.go create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/_meta/data.json create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/_meta/docs.asciidoc create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/_meta/fields.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/config.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/proxy_integration_test.go create mode 100644 x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go create mode 100644 x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py create mode 100644 x-pack/metricbeat/modules.d/redisenterprise.yml.disabled diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index d402ef18b2f0..bc03578fee1e 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -194,6 +194,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add metricsets based on Ceph Manager Daemon to the `ceph` module. {issue}7723[7723] {pull}16254[16254] - Release `statsd` module as GA. {pull}16447[16447] {issue}14280[14280] - Add `cloudfoundry` module to send events from Cloud Foundry. {pull}16671[16671] +- Add `redisenterprise` module. {pull}16482[16482] {issue}15269[15269] *Packetbeat* diff --git a/libbeat/tests/compose/compose.go b/libbeat/tests/compose/compose.go index 293e57e8784f..e9011ca9645b 100644 --- a/libbeat/tests/compose/compose.go +++ b/libbeat/tests/compose/compose.go @@ -81,6 +81,13 @@ func EnsureUp(t testing.TB, service string, options ...UpOption) HostInfo { // Wait for health err = compose.Wait(upOptions.Timeout, service) if err != nil { + inspected, inspectErr := compose.Inspect(service) + if inspectErr != nil { + t.Logf("inspection error: %v", err) + } else { + t.Logf("Container state (service: '%s'): %s", service, inspected) + } + t.Fatal(err) } diff --git a/libbeat/tests/compose/project.go b/libbeat/tests/compose/project.go index f4ebfb904e58..602b38b83ae0 100644 --- a/libbeat/tests/compose/project.go +++ b/libbeat/tests/compose/project.go @@ -92,6 +92,7 @@ type Driver interface { Kill(ctx context.Context, signal string, service string) error KillOld(ctx context.Context, except []string) error Ps(ctx context.Context, filter ...string) ([]ContainerStatus, error) + Inspect(ctx context.Context, serviceName string) (string, error) LockFile() string @@ -227,6 +228,14 @@ func (c *Project) KillOld(except []string) error { return c.Driver.KillOld(context.TODO(), except) } +// Inspect a container +func (c *Project) Inspect(service string) (string, error) { + c.Lock() + defer c.Unlock() + + return c.Driver.Inspect(context.Background(), service) +} + // Lock acquires the lock (300s) timeout // Normally it should only be seconds that the lock is used, but in some cases it can take longer. // Pid is written to the lock file, and it is used to check if process holding the process is still diff --git a/libbeat/tests/compose/wrapper.go b/libbeat/tests/compose/wrapper.go index 35e37098a38c..646900edab74 100644 --- a/libbeat/tests/compose/wrapper.go +++ b/libbeat/tests/compose/wrapper.go @@ -21,6 +21,7 @@ import ( "archive/tar" "bytes" "context" + "encoding/json" "fmt" "net" "os" @@ -371,6 +372,43 @@ func (d *wrapperDriver) serviceNames(ctx context.Context) ([]string, error) { return strings.Fields(stdout.String()), nil } +// Inspect a container. +func (d *wrapperDriver) Inspect(ctx context.Context, serviceName string) (string, error) { + list, err := d.client.ContainerList(ctx, types.ContainerListOptions{All: true}) + if err != nil { + return "", errors.Wrap(err, "listing containers to be inspected") + } + + var found bool + var c types.Container + for _, container := range list { + aServiceName, ok := container.Labels[labelComposeService] + if ok && serviceName == aServiceName { + c = container + found = true + break + } + } + + if !found { + return "", errors.Errorf("container not found for service '%s'", serviceName) + } + + inspect, err := d.client.ContainerInspect(ctx, c.ID) + if err != nil { + return "", errors.Wrap(err, "container failed inspection") + } else if inspect.State == nil { + return "empty container state", nil + } + + state, err := json.Marshal(inspect.State) + if err != nil { + return "", errors.Wrap(err, "container inspection failed") + } + + return string(state), nil +} + func makeFilter(project, service string, projectFilter Filter) filters.Args { f := filters.NewArgs() f.Add("label", fmt.Sprintf("%s=%s", labelComposeProject, project)) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index a16eee66cdb4..3763ddd775fc 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -66,6 +66,7 @@ grouped in the following categories: * <> * <> * <> +* <> * <> * <> * <> @@ -32670,6 +32671,20 @@ type: long -- +[[exported-fields-redisenterprise]] +== Redis Enterprise fields + +Redis metrics collected from Redis Enterprise Server. + + + +[float] +=== redisenterprise + +`redisenterprise` contains the information and statistics from Redis Enterprise Server. + + + [[exported-fields-sql]] == sql fields diff --git a/metricbeat/docs/modules/redis.asciidoc b/metricbeat/docs/modules/redis.asciidoc index b5c7f20364fa..84377c51d501 100644 --- a/metricbeat/docs/modules/redis.asciidoc +++ b/metricbeat/docs/modules/redis.asciidoc @@ -33,8 +33,8 @@ redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] [float] === Compatibility -The Redis metricsets were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected -to work with all versions >= 3.0. +The redis metricsets `info`, `key` and `keyspace` are compatible with all distributions of Redis (OSS and enterprise). +They were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. [float] diff --git a/metricbeat/docs/modules/redisenterprise.asciidoc b/metricbeat/docs/modules/redisenterprise.asciidoc new file mode 100644 index 000000000000..63cc4b39bc59 --- /dev/null +++ b/metricbeat/docs/modules/redisenterprise.asciidoc @@ -0,0 +1,62 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-module-redisenterprise]] +[role="xpack"] +== Redis Enterprise module + +beta[] + +This module periodically fetches metrics from https://redislabs.com/redis-enterprise/[Redis Enterprise Software]. + +The defaut metricsets are `node` and `proxy`. + +[float] +=== Module-specific configuration notes + +The Redis module has these additional config options: + +*`hosts`*:: URLs that are used to connect to Redis. +URL format: +https://HOST[:PORT] + +[float] +=== Compatibility + +The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES +5.4.10-22 and are expected to work with all versions >= 5.0.2. + + +[float] +=== Example configuration + +The Redis Enterprise module supports the standard configuration options that are described +in <>. Here is an example configuration: + +[source,yaml] +---- +metricbeat.modules: +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] +---- + +[float] +=== Metricsets + +The following metricsets are available: + +* <> + +* <> + +include::redisenterprise/node.asciidoc[] + +include::redisenterprise/proxy.asciidoc[] + diff --git a/metricbeat/docs/modules/redisenterprise/node.asciidoc b/metricbeat/docs/modules/redisenterprise/node.asciidoc new file mode 100644 index 000000000000..90103d119232 --- /dev/null +++ b/metricbeat/docs/modules/redisenterprise/node.asciidoc @@ -0,0 +1,24 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-redisenterprise-node]] +=== Redis Enterprise node metricset + +beta[] + +include::../../../../x-pack/metricbeat/module/redisenterprise/node/_meta/docs.asciidoc[] + +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../../x-pack/metricbeat/module/redisenterprise/node/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules/redisenterprise/proxy.asciidoc b/metricbeat/docs/modules/redisenterprise/proxy.asciidoc new file mode 100644 index 000000000000..cee1e06ebd4a --- /dev/null +++ b/metricbeat/docs/modules/redisenterprise/proxy.asciidoc @@ -0,0 +1,24 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-redisenterprise-proxy]] +=== Redis Enterprise proxy metricset + +beta[] + +include::../../../../x-pack/metricbeat/module/redisenterprise/proxy/_meta/docs.asciidoc[] + +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../../x-pack/metricbeat/module/redisenterprise/proxy/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index cc38d9895940..04a65e228a90 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -205,6 +205,9 @@ This file is generated! See scripts/mage/docs_collector.go .3+| .3+| |<> |<> |<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> beta[] +|<> beta[] |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .1+| .1+| |<> beta[] |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | @@ -300,6 +303,7 @@ include::modules/postgresql.asciidoc[] include::modules/prometheus.asciidoc[] include::modules/rabbitmq.asciidoc[] include::modules/redis.asciidoc[] +include::modules/redisenterprise.asciidoc[] include::modules/sql.asciidoc[] include::modules/stan.asciidoc[] include::modules/statsd.asciidoc[] diff --git a/metricbeat/mb/testing/data/data_test.go b/metricbeat/mb/testing/data/data_test.go index 3102780e66fa..a6d1f4681271 100644 --- a/metricbeat/mb/testing/data/data_test.go +++ b/metricbeat/mb/testing/data/data_test.go @@ -24,9 +24,8 @@ import ( "strings" "testing" - mbtest "github.com/elastic/beats/metricbeat/mb/testing" - _ "github.com/elastic/beats/metricbeat/include" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" ) func TestAll(t *testing.T) { diff --git a/metricbeat/module/redis/_meta/docs.asciidoc b/metricbeat/module/redis/_meta/docs.asciidoc index a15de3429fd3..8947ff6ec21f 100644 --- a/metricbeat/module/redis/_meta/docs.asciidoc +++ b/metricbeat/module/redis/_meta/docs.asciidoc @@ -26,5 +26,5 @@ redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] [float] === Compatibility -The Redis metricsets were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected -to work with all versions >= 3.0. +The redis metricsets `info`, `key` and `keyspace` are compatible with all distributions of Redis (OSS and enterprise). +They were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. diff --git a/metricbeat/module/redis/docker-compose.yml b/metricbeat/module/redis/docker-compose.yml index a2f9dcc4bdd8..3cb5c07c12ea 100644 --- a/metricbeat/module/redis/docker-compose.yml +++ b/metricbeat/module/redis/docker-compose.yml @@ -7,5 +7,6 @@ services: context: ./_meta args: REDIS_VERSION: ${REDIS_VERSION:-3.2.12} + privileged: true ports: - 6379 diff --git a/metricbeat/module/redis/module.yml b/metricbeat/module/redis/module.yml index 6a4e4504f9cc..f89e64a72b32 100644 --- a/metricbeat/module/redis/module.yml +++ b/metricbeat/module/redis/module.yml @@ -1,3 +1,4 @@ +name: redis dashboards: - - id: AV4YjZ5pux-M-tCAunxK - file: Metricbeat-redis-overview.json + - id: AV4YjZ5pux-M-tCAunxK + file: Metricbeat-redis-overview.json diff --git a/metricbeat/module/redis/test_redis.py b/metricbeat/module/redis/test_redis.py index 9d9967389f9d..98ffb982ca30 100644 --- a/metricbeat/module/redis/test_redis.py +++ b/metricbeat/module/redis/test_redis.py @@ -34,6 +34,7 @@ def test_info(self): """ Test redis info metricset """ + self.render_config_template(modules=[{ "name": "redis", "metricsets": ["info"], @@ -137,6 +138,7 @@ def test_module_processors(self): """ Test local processors for Redis info event. """ + fields = ["clients", "cpu"] eventFields = ['beat', 'metricset', 'service', 'event'] eventFields += ['redis.info.' + f for f in fields] diff --git a/x-pack/metricbeat/include/list.go b/x-pack/metricbeat/include/list.go index d94850356797..131c48580815 100644 --- a/x-pack/metricbeat/include/list.go +++ b/x-pack/metricbeat/include/list.go @@ -45,6 +45,7 @@ import ( _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle" _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle/performance" _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle/tablespace" + _ "github.com/elastic/beats/x-pack/metricbeat/module/redisenterprise" _ "github.com/elastic/beats/x-pack/metricbeat/module/sql" _ "github.com/elastic/beats/x-pack/metricbeat/module/sql/query" _ "github.com/elastic/beats/x-pack/metricbeat/module/stan" diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index c6a7a1f74c98..8f20806f2dd6 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -977,6 +977,16 @@ metricbeat.modules: # Redis AUTH password. Empty by default. #password: foobared +#--------------------------- Redis Enterprise Module --------------------------- +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] + #--------------------------------- Sql Module --------------------------------- - module: sql metricsets: diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile b/x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile new file mode 100644 index 000000000000..4081ad4ee31b --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile @@ -0,0 +1,6 @@ +ARG REDISENTERPRISE_VERSION +FROM redislabs/redis:${REDISENTERPRISE_VERSION} + +# Wait for the health endpoint to have monitors information +ADD healthcheck.sh / +HEALTHCHECK --interval=1s --retries=300 CMD /healthcheck.sh diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/config.reference.yml b/x-pack/metricbeat/module/redisenterprise/_meta/config.reference.yml new file mode 100644 index 000000000000..e1f77b457230 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/_meta/config.reference.yml @@ -0,0 +1,8 @@ +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/config.yml b/x-pack/metricbeat/module/redisenterprise/_meta/config.yml new file mode 100644 index 000000000000..e1f77b457230 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/_meta/config.yml @@ -0,0 +1,8 @@ +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc new file mode 100644 index 000000000000..4484f89df91a --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc @@ -0,0 +1,18 @@ +This module periodically fetches metrics from https://redislabs.com/redis-enterprise/[Redis Enterprise Software]. + +The defaut metricsets are `node` and `proxy`. + +[float] +=== Module-specific configuration notes + +The Redis module has these additional config options: + +*`hosts`*:: URLs that are used to connect to Redis. +URL format: +https://HOST[:PORT] + +[float] +=== Compatibility + +The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES +5.4.10-22 and are expected to work with all versions >= 5.0.2. diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/fields.yml b/x-pack/metricbeat/module/redisenterprise/_meta/fields.yml new file mode 100644 index 000000000000..7f697324521f --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/_meta/fields.yml @@ -0,0 +1,11 @@ +- key: redisenterprise + title: "Redis Enterprise" + description: > + Redis metrics collected from Redis Enterprise Server. + release: beta + fields: + - name: redisenterprise + type: group + description: > + `redisenterprise` contains the information and statistics from Redis Enterprise Server. + fields: diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/healthcheck.sh b/x-pack/metricbeat/module/redisenterprise/_meta/healthcheck.sh new file mode 100755 index 000000000000..12b298e60c6b --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/_meta/healthcheck.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +CHECK_CLUSTER_CREATED=/opt/redislabs/config/check_cluster_created +CHECK_DATABASE_CREATED=/opt/redislabs/config/check_database_created + +if [[ ! -f "${CHECK_CLUSTER_CREATED}" ]]; then + rladmin cluster create name cluster.local username cihan@redislabs.com password redislabs123 + touch ${CHECK_CLUSTER_CREATED} +fi + +if [[ ! -f "${CHECK_DATABASE_CREATED}" ]]; then + curl -s -k -u "cihan@redislabs.com:redislabs123" --request POST \ + --url "https://localhost:9443/v1/bdbs" \ + --header 'content-type: application/json' \ + --data '{"name":"db1","type":"redis","memory_size":102400,"port":12000}' + touch ${CHECK_DATABASE_CREATED} +fi + +curl -s --insecure https://127.0.0.1:8070 >/dev/null diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml b/x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml new file mode 100644 index 000000000000..b24c80b47a07 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml @@ -0,0 +1,2 @@ +variants: + - REDISENTERPRISE_VERSION: 5.4.10-22 diff --git a/x-pack/metricbeat/module/redisenterprise/docker-compose.yml b/x-pack/metricbeat/module/redisenterprise/docker-compose.yml new file mode 100644 index 000000000000..55ae81cc584a --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/docker-compose.yml @@ -0,0 +1,13 @@ +version: '2.3' + +services: + redisenterprise: + image: docker.elastic.co/integrations-ci/beats-redisenterprise:${REDISENTERPRISE_VERSION:-5.4.10-22}-3 + build: + context: ./_meta + args: + REDISENTERPRISE_VERSION: ${REDISENTERPRISE_VERSION:-5.4.10-22} + cap_add: + - SYS_RESOURCE + ports: + - 8070 diff --git a/x-pack/metricbeat/module/redisenterprise/fields.go b/x-pack/metricbeat/module/redisenterprise/fields.go new file mode 100644 index 000000000000..7695ff24329b --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/fields.go @@ -0,0 +1,23 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// Code generated by beats/dev-tools/cmd/asset/asset.go - DO NOT EDIT. + +package redisenterprise + +import ( + "github.com/elastic/beats/libbeat/asset" +) + +func init() { + if err := asset.SetFields("metricbeat", "redisenterprise", asset.ModuleFieldsPri, AssetRedisenterprise); err != nil { + panic(err) + } +} + +// AssetRedisenterprise returns asset data. +// This is the base64 encoded gzipped contents of module/redisenterprise. +func AssetRedisenterprise() string { + return "eJykjztOBDEQRHOforT5cgAHZFwALrDGroUWHtvqbhBze2Q+q9VoEAEv7E/p1REvXCOURYzNqUPFGAAXr4w43M8N7i6rQwAKLasMl94ibgMAfJ0tdJVsyL1WZmfBWfuCbQYeqG/UmwAoK5Mx4pGeAnAW1mLxM/OIlhbuyU18HYx40v46vic7WpPT5v+E3JsnaQZ/JqSduy5pfiG1AvPkYj5r/CU/uRa+lm698DLcs51s2//wW+jQ/r7+O/UjAAD//wOWl64=" +} diff --git a/x-pack/metricbeat/module/redisenterprise/module.yml b/x-pack/metricbeat/module/redisenterprise/module.yml new file mode 100644 index 000000000000..85a7bfbae068 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/module.yml @@ -0,0 +1,4 @@ +name: redisenterprise +metricsets: + - node + - proxy diff --git a/x-pack/metricbeat/module/redisenterprise/node/_meta/data.json b/x-pack/metricbeat/module/redisenterprise/node/_meta/data.json new file mode 100644 index 000000000000..2b77561b5f75 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/_meta/data.json @@ -0,0 +1,84 @@ +{ + "@timestamp": "2020-02-21T08:25:46.123Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "metricset": { + "period": 60000, + "name": "node" + }, + "service": { + "type": "redisenterprise", + "address": "127.0.0.1:8070" + }, + "ecs": { + "version": "1.4.0" + }, + "host": { + "hostname": "host", + "architecture": "x86_64", + "os": { + "family": "darwin", + "name": "Mac OS X", + "kernel": "18.7.0", + "build": "18G95", + "platform": "darwin", + "version": "10.14.6" + }, + "name": "host", + "id": "24F065F8-4274-521D-8DD5-5D27557E15B4", + "ip": [ + "fe80::aede:48ff:fe00:1122", + "fe80::1c05:593c:e271:97ed", + "192.168.0.14", + "fe80::488c:55ff:fe4e:3b46", + "fe80::def:1653:5676:ea4e", + "fe80::f191:956a:99ff:1b98", + "fe80::3128:a84c:7b38:e3a9" + ], + "mac": [ + "ac:de:48:00:11:22", + "a6:83:e7:ae:70:01", + "a4:83:e7:ae:70:01", + "06:83:e7:ae:70:01" + ] + }, + "agent": { + "ephemeral_id": "de3a043f-a71f-441e-b730-ca12a8f7fc49", + "hostname": "MacBook-Elastic.local", + "id": "993db589-f9d8-40f3-94cb-43b2b69fa9f4", + "version": "8.0.0", + "type": "metricbeat" + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "node": "1", + "instance": "127.0.0.1:8070", + "job": "redisenterprise" + }, + "metrics": { + "node_cpu_steal_median": 0, + "node_cpu_irqs_max": 0.001, + "node_cpu_user_min": 0.021, + "node_cpu_iowait_median": 0, + "node_cur_aof_rewrites": 0, + "node_ingress_bytes_min": 0, + "node_ingress_bytes_median": 0, + "node_cpu_idle_min": 0.929, + "node_cpu_iowait_max": 0, + "node_cpu_irqs": 0.0003333333333333333, + "node_available_memory": 6.262083584e+09, + "node_provisional_memory_no_overbooking": 4.757468584333e+09, + "node_cpu_idle": 0.9303333333333335, + "node_cpu_steal_max": 0 + } + }, + "event": { + "dataset": "redisenterprise.node", + "module": "redisenterprise", + "duration": 51870343 + } +} diff --git a/x-pack/metricbeat/module/redisenterprise/node/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterprise/node/_meta/docs.asciidoc new file mode 100644 index 000000000000..90e351883f40 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/_meta/docs.asciidoc @@ -0,0 +1 @@ +This is the `node` metricset of the redisenterprise module. The metricset is compatible with Redis Enterprise Software. diff --git a/x-pack/metricbeat/module/redisenterprise/node/_meta/fields.yml b/x-pack/metricbeat/module/redisenterprise/node/_meta/fields.yml new file mode 100644 index 000000000000..4d523079ac9a --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/_meta/fields.yml @@ -0,0 +1,4 @@ +- name: node + type: group + release: beta + fields: diff --git a/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/config.yml b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/config.yml new file mode 100644 index 000000000000..361e43c5ccda --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/config.yml @@ -0,0 +1,4 @@ +type: http +url: "/" +suffix: plain +remove_fields_from_comparison: ["prometheus.labels.instance"] diff --git a/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain new file mode 100644 index 000000000000..d1b94f28efda --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain @@ -0,0 +1,144 @@ +# HELP node_cpu_nice_min +# TYPE node_cpu_nice_min gauge +node_cpu_nice_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_idle_max +# TYPE node_cpu_idle_max gauge +node_cpu_idle_max{cluster="cluster.local",node="1"} 0.914 +# HELP node_egress_bytes +# TYPE node_egress_bytes gauge +node_egress_bytes{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_idle +# TYPE node_cpu_idle gauge +node_cpu_idle{cluster="cluster.local",node="1"} 0.914 +# HELP node_cpu_irqs +# TYPE node_cpu_irqs gauge +node_cpu_irqs{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_system_median +# TYPE node_cpu_system_median gauge +node_cpu_system_median{cluster="cluster.local",node="1"} 0.022 +# HELP node_cpu_user +# TYPE node_cpu_user gauge +node_cpu_user{cluster="cluster.local",node="1"} 0.033 +# HELP node_cpu_irqs_min +# TYPE node_cpu_irqs_min gauge +node_cpu_irqs_min{cluster="cluster.local",node="1"} 0.001 +# HELP node_ingress_bytes_min +# TYPE node_ingress_bytes_min gauge +node_ingress_bytes_min{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_system_min +# TYPE node_cpu_system_min gauge +node_cpu_system_min{cluster="cluster.local",node="1"} 0.022 +# HELP node_cpu_irqs_median +# TYPE node_cpu_irqs_median gauge +node_cpu_irqs_median{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_steal +# TYPE node_cpu_steal gauge +node_cpu_steal{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_user_min +# TYPE node_cpu_user_min gauge +node_cpu_user_min{cluster="cluster.local",node="1"} 0.033 +# HELP node_persistent_storage_free +# TYPE node_persistent_storage_free gauge +node_persistent_storage_free{cluster="cluster.local",node="1"} 55931361507.556 +# HELP node_ephemeral_storage_free +# TYPE node_ephemeral_storage_free gauge +node_ephemeral_storage_free{cluster="cluster.local",node="1"} 55931361507.556 +# HELP node_cpu_idle_median +# TYPE node_cpu_idle_median gauge +node_cpu_idle_median{cluster="cluster.local",node="1"} 0.914 +# HELP node_provisional_memory_no_overbooking +# TYPE node_provisional_memory_no_overbooking gauge +node_provisional_memory_no_overbooking{cluster="cluster.local",node="1"} 5099636117.889 +# HELP node_free_memory +# TYPE node_free_memory gauge +node_free_memory{cluster="cluster.local",node="1"} 6268220757.333 +# HELP node_ingress_bytes +# TYPE node_ingress_bytes gauge +node_ingress_bytes{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_steal_median +# TYPE node_cpu_steal_median gauge +node_cpu_steal_median{cluster="cluster.local",node="1"} 0.0 +# HELP node_conns +# TYPE node_conns gauge +node_conns{cluster="cluster.local",node="1"} 0.0 +# HELP node_ephemeral_storage_avail +# TYPE node_ephemeral_storage_avail gauge +node_ephemeral_storage_avail{cluster="cluster.local",node="1"} 52714645731.556 +# HELP node_cpu_nice +# TYPE node_cpu_nice gauge +node_cpu_nice{cluster="cluster.local",node="1"} 0.0 +# HELP node_ingress_bytes_median +# TYPE node_ingress_bytes_median gauge +node_ingress_bytes_median{cluster="cluster.local",node="1"} 1006.111 +# HELP node_ingress_bytes_max +# TYPE node_ingress_bytes_max gauge +node_ingress_bytes_max{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_iowait +# TYPE node_cpu_iowait gauge +node_cpu_iowait{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_user_median +# TYPE node_cpu_user_median gauge +node_cpu_user_median{cluster="cluster.local",node="1"} 0.033 +# HELP node_available_memory_no_overbooking +# TYPE node_available_memory_no_overbooking gauge +node_available_memory_no_overbooking{cluster="cluster.local",node="1"} 6270062136.889 +# HELP node_cpu_nice_median +# TYPE node_cpu_nice_median gauge +node_cpu_nice_median{cluster="cluster.local",node="1"} 0.0 +# HELP node_total_req +# TYPE node_total_req gauge +node_total_req{cluster="cluster.local",node="1"} 0.0 +# HELP node_cur_aof_rewrites +# TYPE node_cur_aof_rewrites gauge +node_cur_aof_rewrites{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_iowait_max +# TYPE node_cpu_iowait_max gauge +node_cpu_iowait_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_persistent_storage_avail +# TYPE node_persistent_storage_avail gauge +node_persistent_storage_avail{cluster="cluster.local",node="1"} 52714645731.556 +# HELP node_available_memory +# TYPE node_available_memory gauge +node_available_memory{cluster="cluster.local",node="1"} 6270261475.556 +# HELP node_egress_bytes_min +# TYPE node_egress_bytes_min gauge +node_egress_bytes_min{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_user_max +# TYPE node_cpu_user_max gauge +node_cpu_user_max{cluster="cluster.local",node="1"} 0.033 +# HELP node_cpu_steal_min +# TYPE node_cpu_steal_min gauge +node_cpu_steal_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_irqs_max +# TYPE node_cpu_irqs_max gauge +node_cpu_irqs_max{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_steal_max +# TYPE node_cpu_steal_max gauge +node_cpu_steal_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_iowait_min +# TYPE node_cpu_iowait_min gauge +node_cpu_iowait_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_idle_min +# TYPE node_cpu_idle_min gauge +node_cpu_idle_min{cluster="cluster.local",node="1"} 0.914 +# HELP node_cpu_system_max +# TYPE node_cpu_system_max gauge +node_cpu_system_max{cluster="cluster.local",node="1"} 0.022 +# HELP node_egress_bytes_max +# TYPE node_egress_bytes_max gauge +node_egress_bytes_max{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_nice_max +# TYPE node_cpu_nice_max gauge +node_cpu_nice_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_system +# TYPE node_cpu_system gauge +node_cpu_system{cluster="cluster.local",node="1"} 0.022 +# HELP node_provisional_memory +# TYPE node_provisional_memory gauge +node_provisional_memory{cluster="cluster.local",node="1"} 5099835456.556 +# HELP node_egress_bytes_median +# TYPE node_egress_bytes_median gauge +node_egress_bytes_median{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_iowait_median +# TYPE node_cpu_iowait_median gauge +node_cpu_iowait_median{cluster="cluster.local",node="1"} 0.0 diff --git a/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json new file mode 100644 index 000000000000..cd9d76d60bb3 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json @@ -0,0 +1,75 @@ +[ + { + "event": { + "dataset": "redisenterprise.node", + "duration": 115000, + "module": "redisenterprise" + }, + "metricset": { + "name": "node", + "period": 10000 + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "instance": "127.0.0.1:55467", + "job": "redisenterprise", + "node": "1" + }, + "metrics": { + "node_available_memory": 6270261475.556, + "node_available_memory_no_overbooking": 6270062136.889, + "node_conns": 0, + "node_cpu_idle": 0.914, + "node_cpu_idle_max": 0.914, + "node_cpu_idle_median": 0.914, + "node_cpu_idle_min": 0.914, + "node_cpu_iowait": 0, + "node_cpu_iowait_max": 0, + "node_cpu_iowait_median": 0, + "node_cpu_iowait_min": 0, + "node_cpu_irqs": 0.001, + "node_cpu_irqs_max": 0.001, + "node_cpu_irqs_median": 0.001, + "node_cpu_irqs_min": 0.001, + "node_cpu_nice": 0, + "node_cpu_nice_max": 0, + "node_cpu_nice_median": 0, + "node_cpu_nice_min": 0, + "node_cpu_steal": 0, + "node_cpu_steal_max": 0, + "node_cpu_steal_median": 0, + "node_cpu_steal_min": 0, + "node_cpu_system": 0.022, + "node_cpu_system_max": 0.022, + "node_cpu_system_median": 0.022, + "node_cpu_system_min": 0.022, + "node_cpu_user": 0.033, + "node_cpu_user_max": 0.033, + "node_cpu_user_median": 0.033, + "node_cpu_user_min": 0.033, + "node_cur_aof_rewrites": 0, + "node_egress_bytes": 14291.444, + "node_egress_bytes_max": 14291.444, + "node_egress_bytes_median": 14291.444, + "node_egress_bytes_min": 14291.444, + "node_ephemeral_storage_avail": 52714645731.556, + "node_ephemeral_storage_free": 55931361507.556, + "node_free_memory": 6268220757.333, + "node_ingress_bytes": 1006.111, + "node_ingress_bytes_max": 1006.111, + "node_ingress_bytes_median": 1006.111, + "node_ingress_bytes_min": 1006.111, + "node_persistent_storage_avail": 52714645731.556, + "node_persistent_storage_free": 55931361507.556, + "node_provisional_memory": 5099835456.556, + "node_provisional_memory_no_overbooking": 5099636117.889, + "node_total_req": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redisenterprise" + } + } +] diff --git a/x-pack/metricbeat/module/redisenterprise/node/manifest.yml b/x-pack/metricbeat/module/redisenterprise/node/manifest.yml new file mode 100644 index 000000000000..3cf6f512a441 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/manifest.yml @@ -0,0 +1,9 @@ +default: true +input: + module: prometheus + metricset: collector + defaults: + metrics_path: / + metrics_filters: + include: ["node_*"] + exclude: ["up"] diff --git a/x-pack/metricbeat/module/redisenterprise/node/node_integration_test.go b/x-pack/metricbeat/module/redisenterprise/node/node_integration_test.go new file mode 100644 index 000000000000..3eda84a1cf10 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/node_integration_test.go @@ -0,0 +1,48 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build integration + +package node + +import ( + "os" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/elastic/beats/libbeat/tests/compose" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "redisenterprise", compose.UpWithTimeout(5*time.Minute)) + + f := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := f.FetchEvents() + if len(errs) > 0 { + t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) + } + assert.NotEmpty(t, events) + t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "redisenterprise", + "metricsets": []string{"node"}, + "hosts": []string{host}, + "ssl.verification_mode": "none", + } +} diff --git a/x-pack/metricbeat/module/redisenterprise/node/node_test.go b/x-pack/metricbeat/module/redisenterprise/node/node_test.go new file mode 100644 index 000000000000..153a589d7a64 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/node/node_test.go @@ -0,0 +1,32 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build !integration + +package node + +import ( + "os" + "testing" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + + // Register input module and metricset + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestEventMapping(t *testing.T) { + logp.TestingSetup() + + mbtest.TestDataFiles(t, "redisenterprise", "node") +} diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/_meta/data.json b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/data.json new file mode 100644 index 000000000000..f58ad718622a --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/data.json @@ -0,0 +1,86 @@ +{ + "@timestamp": "2020-02-21T08:25:46.123Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "metricset": { + "period": 60000, + "name": "proxy" + }, + "service": { + "type": "redisenterprise", + "address": "127.0.0.1:8070" + }, + "ecs": { + "version": "1.4.0" + }, + "host": { + "hostname": "host", + "architecture": "x86_64", + "os": { + "family": "darwin", + "name": "Mac OS X", + "kernel": "18.7.0", + "build": "18G95", + "platform": "darwin", + "version": "10.14.6" + }, + "name": "host", + "id": "24F065F8-4274-521D-8DD5-5D27557E15B4", + "ip": [ + "fe80::aede:48ff:fe00:1122", + "fe80::1c05:593c:e271:97ed", + "192.168.0.14", + "fe80::488c:55ff:fe4e:3b46", + "fe80::def:1653:5676:ea4e", + "fe80::f191:956a:99ff:1b98", + "fe80::3128:a84c:7b38:e3a9" + ], + "mac": [ + "ac:de:48:00:11:22", + "a6:83:e7:ae:70:01", + "a4:83:e7:ae:70:01", + "06:83:e7:ae:70:01" + ] + }, + "agent": { + "ephemeral_id": "de3a043f-a71f-441e-b730-ca12a8f7fc49", + "hostname": "MacBook-Elastic.local", + "id": "993db589-f9d8-40f3-94cb-43b2b69fa9f4", + "version": "8.0.0", + "type": "metricbeat" + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "proxy": "1", + "instance": "127.0.0.1:8070", + "job": "redisenterprise" + }, + "metrics": { + "listener_acc_latency": 0, + "listener_acc_latency_max": 0, + "listener_acc_other_latency": 0, + "listener_acc_other_latency_max": 0, + "listener_acc_read_latency": 0, + "listener_acc_read_latency_max": 0, + "listener_acc_write_latency": 0, + "listener_acc_write_latency_max": 0, + "listener_auth_cmds": 0, + "listener_auth_cmds_max": 0, + "listener_auth_errors": 0, + "listener_auth_errors_max": 0, + "listener_cmd_flush": 0, + "listener_cmd_flush_max": 0, + "listener_cmd_get": 0, + "listener_cmd_get_max": 0 + } + }, + "event": { + "dataset": "redisenterprise.proxy", + "module": "redisenterprise", + "duration": 51870343 + } +} diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/docs.asciidoc new file mode 100644 index 000000000000..948e0e38ab28 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/docs.asciidoc @@ -0,0 +1 @@ +This is the `proxy` metricset of the redisenterprise module. The metricset is compatible with Redis Enterprise Software. diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/_meta/fields.yml b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/fields.yml new file mode 100644 index 000000000000..1c1fa1b036d7 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/fields.yml @@ -0,0 +1,4 @@ +- name: proxy + type: group + release: beta + fields: diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/config.yml b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/config.yml new file mode 100644 index 000000000000..361e43c5ccda --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/config.yml @@ -0,0 +1,4 @@ +type: http +url: "/" +suffix: plain +remove_fields_from_comparison: ["prometheus.labels.instance"] diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain new file mode 100644 index 000000000000..423aaadae08c --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain @@ -0,0 +1,168 @@ +# HELP listener_acc_other_latency_max +# TYPE listener_acc_other_latency_max counter +listener_acc_other_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_touch_max +# TYPE listener_cmd_touch_max counter +listener_cmd_touch_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_egress_bytes +# TYPE listener_egress_bytes counter +listener_egress_bytes{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_req_max +# TYPE listener_read_req_max counter +listener_read_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_monitor_sessions_count +# TYPE listener_monitor_sessions_count counter +listener_monitor_sessions_count{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_req_max +# TYPE listener_write_req_max counter +listener_write_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_res_max +# TYPE listener_write_res_max counter +listener_write_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_started_res_max +# TYPE listener_write_started_res_max counter +listener_write_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_res_max +# TYPE listener_total_res_max counter +listener_total_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_other_latency +# TYPE listener_acc_other_latency counter +listener_acc_other_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_started_res_max +# TYPE listener_total_started_res_max counter +listener_total_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_started_res +# TYPE listener_total_started_res counter +listener_total_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_req_max +# TYPE listener_other_req_max counter +listener_other_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_req +# TYPE listener_write_req counter +listener_write_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_res +# TYPE listener_write_res counter +listener_write_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_flush_max +# TYPE listener_cmd_flush_max counter +listener_cmd_flush_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_touch +# TYPE listener_cmd_touch counter +listener_cmd_touch{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_cmds +# TYPE listener_auth_cmds counter +listener_auth_cmds{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_ingress_bytes +# TYPE listener_ingress_bytes counter +listener_ingress_bytes{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_write_latency +# TYPE listener_acc_write_latency counter +listener_acc_write_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_conns +# TYPE listener_conns counter +listener_conns{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_started_res +# TYPE listener_write_started_res counter +listener_write_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_latency +# TYPE listener_acc_latency counter +listener_acc_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_read_latency_max +# TYPE listener_acc_read_latency_max counter +listener_acc_read_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_ingress_bytes_max +# TYPE listener_ingress_bytes_max counter +listener_ingress_bytes_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_connections_received +# TYPE listener_total_connections_received counter +listener_total_connections_received{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_last_req_time +# TYPE listener_last_req_time counter +listener_last_req_time{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_res +# TYPE listener_other_res counter +listener_other_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_started_res_max +# TYPE listener_other_started_res_max counter +listener_other_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_req +# TYPE listener_other_req counter +listener_other_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_max_connections_exceeded +# TYPE listener_max_connections_exceeded counter +listener_max_connections_exceeded{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_get +# TYPE listener_cmd_get counter +listener_cmd_get{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_res +# TYPE listener_total_res counter +listener_total_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_req +# TYPE listener_total_req counter +listener_total_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_res_max +# TYPE listener_read_res_max counter +listener_read_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_latency_max +# TYPE listener_acc_latency_max counter +listener_acc_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_set +# TYPE listener_cmd_set counter +listener_cmd_set{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_connections_received_max +# TYPE listener_total_connections_received_max counter +listener_total_connections_received_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_cmds_max +# TYPE listener_auth_cmds_max counter +listener_auth_cmds_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_write_latency_max +# TYPE listener_acc_write_latency_max counter +listener_acc_write_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_errors_max +# TYPE listener_auth_errors_max counter +listener_auth_errors_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_req_max +# TYPE listener_total_req_max counter +listener_total_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_max_connections_exceeded_max +# TYPE listener_max_connections_exceeded_max counter +listener_max_connections_exceeded_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_last_res_time +# TYPE listener_last_res_time counter +listener_last_res_time{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_flush +# TYPE listener_cmd_flush counter +listener_cmd_flush{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_read_latency +# TYPE listener_acc_read_latency counter +listener_acc_read_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_started_res +# TYPE listener_read_started_res counter +listener_read_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_egress_bytes_max +# TYPE listener_egress_bytes_max counter +listener_egress_bytes_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_set_max +# TYPE listener_cmd_set_max counter +listener_cmd_set_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_errors +# TYPE listener_auth_errors counter +listener_auth_errors{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_started_res +# TYPE listener_other_started_res counter +listener_other_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_started_res_max +# TYPE listener_read_started_res_max counter +listener_read_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_get_max +# TYPE listener_cmd_get_max counter +listener_cmd_get_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_res_max +# TYPE listener_other_res_max counter +listener_other_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_req +# TYPE listener_read_req counter +listener_read_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_res +# TYPE listener_read_res counter +listener_read_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json new file mode 100644 index 000000000000..0d155f6664c7 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json @@ -0,0 +1,87 @@ +[ + { + "event": { + "dataset": "redisenterprise.proxy", + "duration": 115000, + "module": "redisenterprise" + }, + "metricset": { + "name": "proxy", + "period": 10000 + }, + "prometheus": { + "labels": { + "bdb": "1", + "cluster": "cluster.local", + "endpoint": "1:1", + "instance": "127.0.0.1:58281", + "job": "redisenterprise", + "node": "1", + "port": "12000", + "proxy": "1:1:1" + }, + "metrics": { + "listener_acc_latency": 0, + "listener_acc_latency_max": 0, + "listener_acc_other_latency": 0, + "listener_acc_other_latency_max": 0, + "listener_acc_read_latency": 0, + "listener_acc_read_latency_max": 0, + "listener_acc_write_latency": 0, + "listener_acc_write_latency_max": 0, + "listener_auth_cmds": 0, + "listener_auth_cmds_max": 0, + "listener_auth_errors": 0, + "listener_auth_errors_max": 0, + "listener_cmd_flush": 0, + "listener_cmd_flush_max": 0, + "listener_cmd_get": 0, + "listener_cmd_get_max": 0, + "listener_cmd_set": 0, + "listener_cmd_set_max": 0, + "listener_cmd_touch": 0, + "listener_cmd_touch_max": 0, + "listener_conns": 0, + "listener_egress_bytes": 0, + "listener_egress_bytes_max": 0, + "listener_ingress_bytes": 0, + "listener_ingress_bytes_max": 0, + "listener_last_req_time": 0, + "listener_last_res_time": 0, + "listener_max_connections_exceeded": 0, + "listener_max_connections_exceeded_max": 0, + "listener_monitor_sessions_count": 0, + "listener_other_req": 0, + "listener_other_req_max": 0, + "listener_other_res": 0, + "listener_other_res_max": 0, + "listener_other_started_res": 0, + "listener_other_started_res_max": 0, + "listener_read_req": 0, + "listener_read_req_max": 0, + "listener_read_res": 0, + "listener_read_res_max": 0, + "listener_read_started_res": 0, + "listener_read_started_res_max": 0, + "listener_total_connections_received": 0, + "listener_total_connections_received_max": 0, + "listener_total_req": 0, + "listener_total_req_max": 0, + "listener_total_res": 0, + "listener_total_res_max": 0, + "listener_total_started_res": 0, + "listener_total_started_res_max": 0, + "listener_write_req": 0, + "listener_write_req_max": 0, + "listener_write_res": 0, + "listener_write_res_max": 0, + "listener_write_started_res": 0, + "listener_write_started_res_max": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redisenterprise" + } + } +] diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml b/x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml new file mode 100644 index 000000000000..20a090d9da34 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml @@ -0,0 +1,9 @@ +default: true +input: + module: prometheus + metricset: collector + defaults: + metrics_path: / + metrics_filters: + include: ["listener_*"] + exclude: ["up"] diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/proxy_integration_test.go b/x-pack/metricbeat/module/redisenterprise/proxy/proxy_integration_test.go new file mode 100644 index 000000000000..f103b99ee320 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/proxy_integration_test.go @@ -0,0 +1,48 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build integration + +package proxy + +import ( + "os" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/elastic/beats/libbeat/tests/compose" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "redisenterprise", compose.UpWithTimeout(5*time.Minute)) + + f := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := f.FetchEvents() + if len(errs) > 0 { + t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) + } + assert.NotEmpty(t, events) + t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "redisenterprise", + "metricsets": []string{"proxy"}, + "hosts": []string{host}, + "ssl.verification_mode": "none", + } +} diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go b/x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go new file mode 100644 index 000000000000..fb68fdbeb12a --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go @@ -0,0 +1,32 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build !integration + +package proxy + +import ( + "os" + "testing" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + + // Register input module and metricset + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestEventMapping(t *testing.T) { + logp.TestingSetup() + + mbtest.TestDataFiles(t, "redisenterprise", "proxy") +} diff --git a/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py b/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py new file mode 100644 index 000000000000..806f7a37c7ad --- /dev/null +++ b/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py @@ -0,0 +1,50 @@ +import os +from parameterized import parameterized +import redis +import sys +import unittest + +sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system')) +from xpack_metricbeat import XPackTest, metricbeat + + +@metricbeat.parameterized_with_supported_versions +class Test(XPackTest): + + COMPOSE_SERVICES = ['redisenterprise'] + + @parameterized.expand([ + ("node", "node"), + ("proxy", "listener") + ]) + @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") + def test_metricset(self, metricset, metric_name_prefix): + """ + Test redis enterprise metricset + """ + + self.render_config_template(modules=[{ + "name": "redisenterprise", + "metricsets": [metricset], + "hosts": ['https://' + self.compose_host(port='8070/tcp')], + "period": "5s", + "extras": { + "ssl.verification_mode": "none" + } + }]) + proc = self.start_beat(home=self.beat_path) + self.wait_until(lambda: self.output_lines() > 0, max_timeout=120) + proc.check_kill_and_wait() + self.assert_no_logged_warnings(replace=['SSL/TLS verifications disabled.']) + + output = self.read_output_json() + self.assertGreater(len(output), 0) + + for evt in output: + self.assert_fields_are_documented(evt) + self.assertIn("prometheus", evt.keys(), evt) + self.assertIn("metrics", evt["prometheus"].keys(), evt) + self.assertGreater(len(evt["prometheus"]["metrics"].keys()), 0) + + for metric in evt["prometheus"]["metrics"].keys(): + assert metric.startswith(metric_name_prefix + "_") diff --git a/x-pack/metricbeat/modules.d/redisenterprise.yml.disabled b/x-pack/metricbeat/modules.d/redisenterprise.yml.disabled new file mode 100644 index 000000000000..c3121d7c2fb1 --- /dev/null +++ b/x-pack/metricbeat/modules.d/redisenterprise.yml.disabled @@ -0,0 +1,11 @@ +# Module: redisenterprise +# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-redisenterprise.html + +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] From eaae0c664f56aef1ddaef08161e87f7050153d03 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Mon, 2 Mar 2020 13:08:26 -0500 Subject: [PATCH 21/21] Add doppler_address, uaa_address, rlp_address to config.reference.yml. --- metricbeat/docs/modules/cloudfoundry.asciidoc | 3 +++ .../metricbeat/module/cloudfoundry/_meta/config.reference.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/metricbeat/docs/modules/cloudfoundry.asciidoc b/metricbeat/docs/modules/cloudfoundry.asciidoc index ac1efe5d0646..ce079c0f4527 100644 --- a/metricbeat/docs/modules/cloudfoundry.asciidoc +++ b/metricbeat/docs/modules/cloudfoundry.asciidoc @@ -125,6 +125,9 @@ metricbeat.modules: - value enabled: true api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + doppler_address: '${CLOUDFOUNDRY_DOPPLER_ADDRESS:""}' + uaa_address: '${CLOUDFOUNDRY_UAA_ADDRESS:""}' + rlp_address: '${CLOUDFOUNDRY_RLP_ADDRESS:""}' client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}' ---- diff --git a/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml b/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml index a2803b06d406..c157d5deeff2 100644 --- a/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml +++ b/x-pack/metricbeat/module/cloudfoundry/_meta/config.reference.yml @@ -5,5 +5,8 @@ - value enabled: true api_address: '${CLOUDFOUNDRY_API_ADDRESS:""}' + doppler_address: '${CLOUDFOUNDRY_DOPPLER_ADDRESS:""}' + uaa_address: '${CLOUDFOUNDRY_UAA_ADDRESS:""}' + rlp_address: '${CLOUDFOUNDRY_RLP_ADDRESS:""}' client_id: '${CLOUDFOUNDRY_CLIENT_ID:""}' client_secret: '${CLOUDFOUNDRY_CLIENT_SECRET:""}'