Skip to content
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
24 changes: 22 additions & 2 deletions heartbeat/docs/heartbeat-observer-options.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
[[configuration-observer-options]]
== Add observer and geo metadata

It is often useful to view and query various attributes of the instance Heartbeat is running on. This data is attached to events via the <<add-observer-metadata,`add_observer_metadata`>> processor. This processor populates the ECS `observer.*` fields. One field of particular utility is the `observer.geo.name` field, which you can configure via this processor. Use this field to create distinctive geographic regions for your uptime checks. You might label your regions by datacenter name or geographic region, e.g. `virginia-dc-1`, or `us-east-1a`, or `virginia-us`.
Use the `heartbeat.run_from` option to set the geographic location fields relevant to a given heartbeat instance.

Note that Heartbeat should not be used with the similarly named <<add-host-metadata,`add_host_metadata`>> processor. In ECS parlance the host is the thing that is monitored, not the thing doing the monitoring, which is the observer.
The `run_from` option is used to label the geographic location where the monitor is running.
Note, you can also set the `run_from` option on an individual monitor to apply a unique setting to just that monitor.

The `run_from` option takes two top-level fields:

* `id`: A string used to uniquely identify the geographic location. It is indexed as the `observer.name` field.
* `geo`: A map conforming to {ecs-ref}/ecs-geo.html[ECS geo fields]. It is indexed under `observer.geo`.

Example:

```yaml
heartbeat.run_from:
id: my-custom-geo
geo:
name: nyc-dc1-rack2
location: 40.7128, -74.0060
continent_name: North America
country_iso_code: US
region_name: New York
region_iso_code: NY
city_name: New York
```
41 changes: 41 additions & 0 deletions heartbeat/docs/monitors/monitor-common-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,47 @@ If the timeout is exceeded, {beatname_uc} publishes a `service-down` event. If t
value specified for `timeout` is greater than `schedule`, intermediate checks
will not be executed by the scheduler.

[float]
[[monitor-run-from]]
=== `run_from`

Use the `run_from` option to set the geographic location fields relevant to a given heartbeat monitor.

The `run_from` option is used to label the geographic location where the monitor is running.
Note, you can also set the `run_from` option on all monitors via the `heartbeat.run_from` option.

The `run_from` option takes two top-level fields:

* `id`: A string used to uniquely identify the geographic location. It is indexed as the `observer.name` field.
* `geo`: A map conforming to {ecs-ref}/ecs-geo.html[ECS geo fields]. It is indexed under `observer.geo`.

Example:

```yaml
- type: http
# Set enabled to true (or delete the following line) to enable this example monitor
enabled: true
# ID used to uniquely identify this monitor in elasticsearch even if the config changes
id: geo-test
# Human readable display name for this service in Uptime UI and elsewhere
name: Geo Test
# List or urls to query
urls: ["http://example.net"]
# Configure task schedule
schedule: '@every 10s'
run_from:
id: my-custom-geo
geo:
name: nyc-dc1-rack1
location: 40.7128, -74.0060
continent_name: North America
country_iso_code: US
region_name: New York
region_iso_code: NY
city_name: New York

```

[float]
[[monitor-fields]]
==== `fields`
Expand Down