Skip to content

Commit

Permalink
[Heartbeat] Add id/name to all YML examples, fix geo defaults (elasti…
Browse files Browse the repository at this point in the history
…c#17886)

This patch fixes elastic#16460 by using the `id` and `name` fields in all our examples. Customers should always set these. The only reason we don't require them is backwards compat concerns with earlier 7.x heartbeats.

This patch also fixes the indentation of the `add_observer_metadata` example in `heartbeat.yml`. Prior to this uncommenting it would not yield a valid config, due it being at the wrong indent level.
  • Loading branch information
andrewvc authored Apr 22, 2020
1 parent aa5c4a2 commit cdb20e2
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 38 deletions.
19 changes: 13 additions & 6 deletions heartbeat/_meta/beat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ heartbeat.monitors:
- type: icmp # monitor type `icmp` (requires root) uses ICMP Echo Request to ping
# configured hosts

# Monitor name used for job name and document type.
#name: icmp
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-monitor

# Human readable display name for this service in Uptime UI and elsewhere
name: my-icmp-monitor

# Enable/Disable monitor
#enabled: true
Expand Down Expand Up @@ -89,9 +92,11 @@ heartbeat.monitors:

- type: tcp # monitor type `tcp`. Connect via TCP and optionally verify endpoint
# by sending/receiving a custom payload
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-monitor

# Monitor name used for job name and document type
#name: tcp
# Human readable display name for this service in Uptime UI and elsewhere
name: my-tcp-monitor

# Enable/Disable monitor
#enabled: true
Expand Down Expand Up @@ -165,9 +170,11 @@ heartbeat.monitors:
#keep_null: false

- type: http # monitor type `http`. Connect via HTTP an optionally verify response
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-http-monitor

# Monitor name used for job name and document type
#name: http
# Human readable display name for this service in Uptime UI and elsewhere
name: My Monitor

# Enable/Disable monitor
#enabled: true
Expand Down
7 changes: 4 additions & 3 deletions heartbeat/_meta/beat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ heartbeat.config.monitors:
# Configure monitors inline
heartbeat.monitors:
- type: http

# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-monitor
# Human readable display name for this service in Uptime UI and elsewhere
name: My Monitor
# List or urls to query
urls: ["http://localhost:9200"]

# Configure task schedule
schedule: '@every 10s'

# Total test connection and data exchange timeout
#timeout: 16s

Expand Down
19 changes: 13 additions & 6 deletions heartbeat/heartbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ heartbeat.monitors:
- type: icmp # monitor type `icmp` (requires root) uses ICMP Echo Request to ping
# configured hosts

# Monitor name used for job name and document type.
#name: icmp
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-monitor

# Human readable display name for this service in Uptime UI and elsewhere
name: my-icmp-monitor

# Enable/Disable monitor
#enabled: true
Expand Down Expand Up @@ -89,9 +92,11 @@ heartbeat.monitors:

- type: tcp # monitor type `tcp`. Connect via TCP and optionally verify endpoint
# by sending/receiving a custom payload
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-monitor

# Monitor name used for job name and document type
#name: tcp
# Human readable display name for this service in Uptime UI and elsewhere
name: my-tcp-monitor

# Enable/Disable monitor
#enabled: true
Expand Down Expand Up @@ -165,9 +170,11 @@ heartbeat.monitors:
#keep_null: false

- type: http # monitor type `http`. Connect via HTTP an optionally verify response
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-http-monitor

# Monitor name used for job name and document type
#name: http
# Human readable display name for this service in Uptime UI and elsewhere
name: My Monitor

# Enable/Disable monitor
#enabled: true
Expand Down
20 changes: 10 additions & 10 deletions heartbeat/heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ heartbeat.config.monitors:
# Configure monitors inline
heartbeat.monitors:
- type: http

# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-monitor
# Human readable display name for this service in Uptime UI and elsewhere
name: My Monitor
# List or urls to query
urls: ["http://localhost:9200"]

# Configure task schedule
schedule: '@every 10s'

# Total test connection and data exchange timeout
#timeout: 16s

Expand Down Expand Up @@ -121,13 +122,12 @@ output.elasticsearch:

processors:
- add_observer_metadata:
# Optional, but recommended geo settings for the location Heartbeat is running in
#geo:
# Token describing this location
#name: us-east-1a

# Lat, Lon "
#location: "37.926868, -78.024902"
# Optional, but recommended geo settings for the location Heartbeat is running in
#geo:
# Token describing this location
#name: us-east-1a
# Lat, Lon "
#location: "37.926868, -78.024902"

#================================ Logging =====================================

Expand Down
6 changes: 4 additions & 2 deletions heartbeat/monitors.d/sample.http.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
# be loaded.

- type: http # monitor type `http`. Connect via HTTP an optionally verify response
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-http-monitor

# Monitor name used for job name and document type
#name: http
# Human readable display name for this service in Uptime UI and elsewhere
name: My HTTP Monitor

# Enable/Disable monitor
#enabled: true
Expand Down
9 changes: 5 additions & 4 deletions heartbeat/monitors.d/sample.icmp.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
# be loaded.

- type: icmp # monitor type `icmp` (requires root) uses ICMP Echo Request to ping
# configured hosts
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-icmp-monitor

# Monitor name used for job name and document type.
#name: icmp
# Human readable display name for this service in Uptime UI and elsewhere
name: My ICMP Monitor

# Enable/Disable monitor
#enabled: true

# Configure task schedule using cron-like syntax
schedule: '*/5 * * * * * *' # exactly every 5 seconds like 10:00:00, 10:00:05, ...
schedule: '@every 5s' # every 5 seconds from start of beat

# List of hosts to ping
hosts: ["localhost"]
Expand Down
6 changes: 6 additions & 0 deletions heartbeat/monitors.d/sample.tcp.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
- type: tcp # monitor type `tcp`. Connect via TCP and optionally verify endpoint
# by sending/receiving a custom payload

# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: my-tcp-monitor

# Human readable display name for this service in Uptime UI and elsewhere
name: My TCP monitor

# Monitor name used for job name and document type
#name: tcp

Expand Down
13 changes: 6 additions & 7 deletions libbeat/_meta/config.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,12 @@ processors:
{{else}}
processors:
- add_observer_metadata:
# Optional, but recommended geo settings for the location {{ .BeatName | title }} is running in
#geo:
# Token describing this location
#name: us-east-1a

# Lat, Lon "
#location: "37.926868, -78.024902"
# Optional, but recommended geo settings for the location {{ .BeatName | title }} is running in
#geo:
# Token describing this location
#name: us-east-1a
# Lat, Lon "
#location: "37.926868, -78.024902"
{{end}}
#================================ Logging =====================================

Expand Down

0 comments on commit cdb20e2

Please sign in to comment.