Skip to content

Commit

Permalink
Add note on rules for scraping pods (#358)
Browse files Browse the repository at this point in the history
Added clarifying rules from #316 (comment) for the default script config to scrape pods.
  • Loading branch information
eamonryan authored Jan 26, 2021
1 parent 7c3d226 commit 940b499
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install-loki.sh)" | kubectl apply -f -
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install-tempo.sh)" | kubectl apply -f -
```
**Note:** For the above script to scrape your pods, they must conform to the following rules:

1. The pod must _not_ have an annotation matching `prometheus.io/scrape: "false"` (this wouldn't be there unless you explicitly add it or if you deploy a Helm chart that has it).
2. The pod _must_ have a port with a name ending in `-metrics`. This is the port that will be scraped by the Agent. A lot of people using Helm struggle with this, since Helm charts don't usually follow this. You would need to add a new scrape config to scrape helm charts or find a way to tweak the Helm chart to follow this rules.
3. The pod _must_ have a label named name with any non-empty value. Helm usually lets you add extra labels, so this is less of a problem for Helm users.
4. The pod must currently be running. (i.e., Kubernetes must not report it having a phase of Succeeded or Failed).

### Kubernetes Manifest

Expand Down

0 comments on commit 940b499

Please sign in to comment.