Skip to content

Commit

Permalink
add README.md to metrics-pusher
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-oleynik committed Aug 1, 2024
1 parent d8e8522 commit 60bfaae
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions metrics-pusher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Metric Pusher

## Usage

Run using docker:

```sh
docker run -v /var/run/docker.sock:/var/run/docker.sock \
-e INSTANCE_NAME="foo" \
-e PUSHGATEWAY_URL="https://<domain>/path/to/pushgateway" \
-e SCRAPE_INTERVAL=60 \
-e AUTH_USER="<user>" \
-e AUTH_PASSWORD="<password>" \
-e ENDPOINTS="http://<domain1>,http://<domain2>" \
scalableminds/metrics-pusher
```

This will scrape all containers with label `gather.logs=true`.

## Configuration

Environment Variables:

| Name | Description |
|------|-------------|
| `INSTANCE_NAME` | Job name used for pushing metrics |
| `PUSHGATEWAY_URL` | URL to push metrics to (e.g. `https://<domain>/path/to/pushgateway`) |
| `SCRAPE_INTERVAL` | Scrape interval in seconds. Default to 60. |
| `AUTH_USER` | User for Basic Auth |
| `AUTH_PASSWORD` | Password for Basic Auth |
| `ENDPOINTS` | Comma separated list of URLs. Allows at most one URL per hostname. |

2 changes: 1 addition & 1 deletion metrics-pusher/metrics-pusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def push_metrics(
pushgateway_url = os.environ.get("PUSHGATEWAY_URL")
scrape_interval = int(os.getenv("SCRAPE_INTERVAL", "60"))
auth_user = os.environ.get("AUTH_USER")
auth_pass = os.environ.get("AUTH_PASS")
auth_pass = os.environ.get("AUTH_PASSWORD")
urls = os.environ.get("ENDPOINTS")

if name is None or name == "":
Expand Down

0 comments on commit 60bfaae

Please sign in to comment.