-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
Signed-off-by: Pete Wall <pete.wall@grafana.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- | ||
(NOTE: Do not edit README.md directly. It is a generated file!) | ||
( To make changes, please modify values.yaml or description.txt and run `make examples`) | ||
--> | ||
# Annotation-based autodiscovery | ||
|
||
This example shows how to enable the annotation-based autodiscovery feature, which makes it very simple to add scrape | ||
Check warning on line 7 in charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md GitHub Actions / runner / alex
|
||
targets. With this feature enabled, any Kubernetes Pods or Services with the `k8s.grafana.com/scrape` annotation set to | ||
`true` will be automatically discovered and scraped by the collector. There are several other annotations that can be | ||
used to customize the scrape configuration, such as: | ||
|
||
* `k8s.grafana.com/job`: The value to use for the `job` label. | ||
Check failure on line 12 in charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md GitHub Actions / runner / markdownlint
|
||
* `k8s.grafana.com/instance`: The value to use for the `instance` label. | ||
Check failure on line 13 in charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md GitHub Actions / runner / markdownlint
|
||
* `k8s.grafana.com/metrics.path`: The path to scrape for metrics. Defaults to `/metrics`. | ||
Check failure on line 14 in charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md GitHub Actions / runner / markdownlint
|
||
* `k8s.grafana.com/metrics.portNumber`: The port on the Pod or Service to scrape for metrics. This is used to target a specific port by its number, rather than all ports. | ||
Check failure on line 15 in charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md GitHub Actions / runner / markdownlint
|
||
* `k8s.grafana.com/metrics.portName`: The named port on the Pod or Service to scrape for metrics. This is used to target a specific port by its name, rather than all ports. | ||
Check failure on line 16 in charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md GitHub Actions / runner / markdownlint
|
||
* `k8s.grafana.com/metrics.scheme`: The scheme to use when scraping metrics. Defaults to `http`. | ||
Check failure on line 17 in charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md GitHub Actions / runner / markdownlint
|
||
* `k8s.grafana.com/metrics.scrapeInterval`: The scrape interval to use when scraping metrics. Defaults to `60s`. | ||
Check failure on line 18 in charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md GitHub Actions / runner / markdownlint
|
||
|
||
For more information, see the [Annotation Autodiscovery feature documentation](https://github.com/grafana/k8s-monitoring-helm/tree/main/charts/feature-annotation-autodiscovery). | ||
|
||
## Values | ||
|
||
```yaml | ||
--- | ||
cluster: | ||
name: annotation-autodiscovery-cluster | ||
|
||
destinations: | ||
- name: prometheus | ||
type: prometheus | ||
url: http://prometheus.prometheus.svc:9090/api/v1/write | ||
|
||
annotationAutodiscovery: | ||
enabled: true | ||
|
||
alloy-metrics: | ||
enabled: true | ||
``` |