Skip to content

Commit

Permalink
[libbeat] AWS ELB Monitoring (#12401) (#13105)
Browse files Browse the repository at this point in the history
Experimental autodiscovery provider for AWS ELBs.

(cherry picked from commit 2c85c97)
  • Loading branch information
andrewvc authored Jul 30, 2019
1 parent 7f239fe commit a82ed33
Show file tree
Hide file tree
Showing 64 changed files with 8,475 additions and 16 deletions.
27 changes: 27 additions & 0 deletions heartbeat/docs/autodiscover-aws-elb-config.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{beatname_uc} supports templates for modules:

["source","yaml",subs="attributes"]
-------------------------------------------------------------------------------------
heartbeat.autodiscover:
providers:
- type: aws_elb
period: 1m
regions: ["us-east-1", "us-east-2"]
# If you don't wish to use env vars or shared credentials files explicitly put credentials here.
#access_key_id: my-access-key
#secret_access_key: my-secret-access-key
#session_token: my-session-token
templates:
- condition:
equals.port: 8080
config:
- type: tcp
hosts: ["${data.host}:${data.port}"]
schedule: "@every 5s"
timeout: 1s
-------------------------------------------------------------------------------------

This configuration launches a `tcp` monitor for all ELBs that have a declared port.

This autodiscover provider takes our standard AWS credentials options.

2 changes: 2 additions & 0 deletions heartbeat/docs/configuring-howto.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ include::{libbeat-dir}/docs/loggingconfig.asciidoc[]
include::{libbeat-dir}/docs/shared-env-vars.asciidoc[]
:standalone!:

:autodiscoverAWSELB:
include::{libbeat-dir}/docs/shared-autodiscover.asciidoc[]
:autodiscoverAWSELB!:

:standalone:
include::{libbeat-dir}/docs/yaml.asciidoc[]
Expand Down
49 changes: 45 additions & 4 deletions libbeat/docs/shared-autodiscover.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ start/stop events. This ensures you don't need to worry about state, but only de
[float]
===== Docker

The Docker autodiscover provider watches for Docker containers to start and stop. These are the available fields on every
The Docker autodiscover provider watches for Docker containers to start and stop.


These are the available fields during within config templating. The `docker.*` fields will be available on each emitted event.
event:

* host
Expand Down Expand Up @@ -113,8 +116,9 @@ endif::[]
[float]
===== Kubernetes

The Kubernetes autodiscover provider watches for Kubernetes pods to start, update, and stop. These are the available fields on every
event:
The Kubernetes autodiscover provider watches for Kubernetes pods to start, update, and stop.

These are the available fields during within config templating. The `kubernetes.*` fields will be available on each emitted event.

* host
* port (if exposed)
Expand Down Expand Up @@ -231,7 +235,7 @@ and the Jolokia agents has to be allowed. Also notice that this multicast
address is in the 239.0.0.0/8 range, that is reserved for private use within an
organization, so it can only be used in private networks.

These are the available fields on every event:
These are the available fields during within config templating. The `jolokia.*` fields will be available on each emitted event.

* jolokia.agent.id
* jolokia.agent.version
Expand All @@ -257,6 +261,43 @@ the ones used for discovery probes, they have these settings:
include::../../{beatname_lc}/docs/autodiscover-jolokia-config.asciidoc[]
endif::autodiscoverJolokia[]

ifdef::autodiscoverAWSELB[]
[float]
===== Amazon ELBs

*Note: This provider is experimental*

The Amazon ELB autodiscover provider discovers https://aws.amazon.com/elasticloadbalancing/[ELBs] and their listeners. This is useful when you don't want to connect
directly to a service, but rather to the ELB fronting a pool of services.

This provider will yield one config block per ELB Listener. So, if you have one ELB exposing both ports 80 and 443, it
will generate two configs, one for each port. Keep in mind that the beat will de-duplicate configs. So, if the generated
configs are the same only one will actually run.

This provider will load AWS credentials using the standard AWS environment variables and shared credentials files see https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html[Best Practices for Managing AWS Access Keys] for more information. If you do not wish to use these, you may explicitly set the `access_key_id` and `secret_access_key` variables.

These are the available fields during within config templating. The `elb_listener.*` fields will be available on each emitted event.

* host
* port
* elb_listener.listener_arn
* elb_listener.load_balancer_arn
* elb_listener.protocol
* elb_listener.type
* elb_listener.scheme
* elb_listener.availability_zones
* elb_listener.created
* elb_listener.state
* elb_listener.ip_address_type
* elb_listener.security_groups
* elb_listener.vpc_id
* elb_listener.ssl_policy

include::../../{beatname_lc}/docs/autodiscover-aws-elb-config.asciidoc[]

endif::autodiscoverAWSELB[]


ifdef::autodiscoverHints[]
[[configuration-autodiscover-hints]]
=== Hints based autodiscover
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a82ed33

Please sign in to comment.