////
This file is generated! See scripts/mage/docs_collector.go
////

[[metricbeat-module-cloudfoundry]]
[role="xpack"]
== Cloudfoundry module

beta[]

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]
=== Dashboards

The Cloud Foundry module includes some dashboards.

The overview dashboard can be used to visualize the current status of your Cloud
Foundry deployments.

image::./images/metricbeat-cloudfoundry-overview.png[]

The platform health dashboard includes visualizations that help diagnosting
issues related to the applications deployed in Cloud Foundry.

image::./images/metricbeat-cloudfoundry-platform-health.png[]


[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: "(`log-stream` subdomain under the same domain as `api_server`)".

[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.

[float]
==== `version`

Consumer API version to connect with Cloud Foundry to collect events. Use `v1` to collect events using Doppler/Traffic Control.
Use `v2` to collect events from the RLP Gateway. Default: "`v1`".

[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:""}'
  shard_id: metricbeat
  version: v1
----

[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[]

