Skip to content

Commit 9690666

Browse files
authored
docs: Clarify metric collection methods for NTH modes
* Explained how Prometheus metric collection differs between IMDS and Queue modes. * Added a warning about serviceMonitor and podMonitor being Prometheus Operator resources. * Updated Queue mode to include two methods for metrics collection: using serviceMonitor with the Prometheus Operator or adding the aws-node-termination-handler service in `scrape_configs`. * Provided an example `scrape_configs` for Prometheus in the Helm chart. * Updated IMDS mode to mention podMonitor for metrics collection.
1 parent 498fc02 commit 9690666

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,28 @@ Available Prometheus metrics:
587587
| `actions_node` | Number of actions per node (Deprecated: Use actions metric instead)|
588588
| `events_error` | Number of errors in events processing |
589589

590+
The method of collecting Prometheus metrics changes depending on whether NTH is running in IMDS mode or Queue mode.
591+
592+
> [!WARNING]
593+
> Both `serviceMonitor` and `podMonitor` are custom resources provided by the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) for seamless integration with Kubernetes services and pods. For more details, please refer to [the API reference docs](https://prometheus-operator.dev/docs/api-reference/api/) for the Prometheus Operator.
594+
595+
In Queue mode, metrics can be collected in two ways:
596+
- Use a `serviceMonitor` custom resource with the Prometheus Operator to collect metrics.
597+
- Alternatively, add aws-node-termination-handler service address statically in Prometheus `scrape_configs`.
598+
599+
Example `scrape_configs` in prometheus helm chart:
600+
```yaml
601+
# charts/prometheus/values.yaml
602+
# See: https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus/values.yaml
603+
extraScrapeConfigs: |
604+
- job_name: 'aws-node-termination-handler'
605+
static_configs:
606+
- targets:
607+
- 'aws-node-termination-handler.kube-system.svc.cluster.local:9092'
608+
```
609+
610+
In IMDS mode, metrics can be collected as follows:
611+
- Use a `podMonitor` custom resource with the Prometheus Operator to collect metrics.
590612

591613
## Communication
592614
* If you've run into a bug or have a new feature request, please open an [issue](https://github.com/aws/aws-node-termination-handler/issues/new).

0 commit comments

Comments
 (0)