Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
docs: better readme
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed May 18, 2018
1 parent c6b3e88 commit e379653
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
Uses DigitalOcean's API to generate a `file_sd_config`'s compatible JSON
file, so you can service discovery DigitalOcean droplets on Prometheus.

Example usage:
## Usage

You can run it as docker container:

```sh
docker run \
-v "$PWD":/tmp \
-e DO_TOKEN="digitalocean-read-only-token" \
--restart=always \
totvslabs/prometheus-digitalocean-sd --output.file=/tmp/do_sd.json
```

And then change your `prometheus.yml` config file to use `file_sd_configs`
to read the `do_sd.json` file:

```yaml
scrape_configs:
Expand All @@ -24,3 +37,26 @@ scrape_configs:
- source_labels: [__meta_do_name]
target_label: instance_name
```
## File format
The JSON file will have the following format and labels:
```json
[
{
"targets": [
"1.2.3.4:9100"
],
"labels": {
"__meta_do_az": "sfo1",
"__meta_do_id": "1234",
"__meta_do_name": "droplet-name",
"__meta_do_public_ip": "1.2.3.4",
"__meta_do_size": "4gb",
"__meta_do_status": "active"
}
},
// all other droplets
]
```

0 comments on commit e379653

Please sign in to comment.