Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #16671 to 7.x: Add cloudfoundry module to metricbeat #16741

Merged
merged 6 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add Load Balancing metricset to GCP {pull}15559[15559]
- Release `statsd` module as GA. {pull}16447[16447] {issue}14280[14280]
- Add `redisenterprise` module. {pull}16482[16482] {issue}15269[15269]
- Add `cloudfoundry` module to send events from Cloud Foundry. {pull}16671[16671]

*Packetbeat*

Expand Down
172 changes: 172 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ grouped in the following categories:
* <<exported-fields-beat>>
* <<exported-fields-ceph>>
* <<exported-fields-cloud>>
* <<exported-fields-cloudfoundry>>
* <<exported-fields-cockroachdb>>
* <<exported-fields-common>>
* <<exported-fields-consul>>
Expand Down Expand Up @@ -4628,6 +4629,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

Expand Down
151 changes: 151 additions & 0 deletions metricbeat/docs/modules/cloudfoundry.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
////
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 <<configuration-metricbeat>>. Here is an example configuration:

[source,yaml]
----
metricbeat.modules:
- module: cloudfoundry
metricsets:
- container
- counter
- 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:""}'
----

[float]
=== Metricsets

The following metricsets are available:

* <<metricbeat-metricset-cloudfoundry-container,container>>

* <<metricbeat-metricset-cloudfoundry-counter,counter>>

* <<metricbeat-metricset-cloudfoundry-value,value>>

include::cloudfoundry/container.asciidoc[]

include::cloudfoundry/counter.asciidoc[]

include::cloudfoundry/value.asciidoc[]

24 changes: 24 additions & 0 deletions metricbeat/docs/modules/cloudfoundry/container.asciidoc
Original file line number Diff line number Diff line change
@@ -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
<<exported-fields-cloudfoundry,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../../x-pack/metricbeat/module/cloudfoundry/container/_meta/data.json[]
----
24 changes: 24 additions & 0 deletions metricbeat/docs/modules/cloudfoundry/counter.asciidoc
Original file line number Diff line number Diff line change
@@ -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
<<exported-fields-cloudfoundry,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../../x-pack/metricbeat/module/cloudfoundry/counter/_meta/data.json[]
----
Loading