Skip to content

Commit

Permalink
Add list of labels and example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Sep 24, 2018
1 parent bce7382 commit d18f1f7
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,50 @@ This project provides a server to automatically discover nodes within your Hetzn
You can download prebuilt binaries from our [GitHub releases](https://github.com/promhippie/prometheus-hcloud-sd/releases), or you can use our Docker images published on [Docker Hub](https://hub.docker.com/r/promhippie/prometheus-hcloud-sd/tags/).


## Integration

### Available labels

The following list of meta labels can be used to relabel your scrape results entirely. Hopefully the names are self-explaining, that's why I have skipped a description for each label.

* `__meta_hcloud_name`
* `__meta_hcloud_status`
* `__meta_hcloud_public_ipv4`
* `__meta_hcloud_public_ipv6`
* `__meta_hcloud_type`
* `__meta_hcloud_cores`
* `__meta_hcloud_memory`
* `__meta_hcloud_disk`
* `__meta_hcloud_storage`
* `__meta_hcloud_cpu`
* `__meta_hcloud_datacenter`
* `__meta_hcloud_location`
* `__meta_hcloud_city`
* `__meta_hcloud_country`
* `__meta_hcloud_image_name`
* `__meta_hcloud_image_type`
* `__meta_hcloud_os_flavor`
* `__meta_hcloud_os_version`

### Prometheus config

Here you get a snippet for the Prometheus `scrape_config` that configures Prometheus to scrape `node_exporter` assuming that it is deployed on all your servers.

```
- job_name: node
file_sd_configs:
- files: [ "/etc/prometheus/hcloud.json" ]
relabel_configs:
- source_labels: [__meta_hcloud_public_ipv4]
replacement: "${1}:9100"
target_label: __address__
- source_labels: [__meta_hcloud_datacenter]
target_label: datacenter
- source_labels: [__meta_hcloud_name]
target_label: instance
```


## Development

Make sure you have a working Go environment, for further reference or a guide take a look at the [install instructions](http://golang.org/doc/install.html). This project requires Go >= v1.8.
Expand Down

0 comments on commit d18f1f7

Please sign in to comment.