Repository navigation
Is it possible to obtain kubernetes (node/pod level) metrics and forward them to a sink? #17584
|
I see that vector can obtain host metrics (CPU/Mem/Disk), but is there anyway to obtain node level metrics and pod level metrics as a source and forward them via a sink? I looked at internal metrics, but that doesn't seem to be what I am looking for. Thanks! |
Replies: 1 comment
|
Yes. Vector's
For example, with kube-state-metrics installed, this prints the collected metrics as JSON. Use your service's actual address: sources:
kubernetes_metrics:
type: prometheus_scrape
endpoints:
- http://kube-state-metrics.monitoring.svc:8080/metrics
scrape_interval_secs: 15
sinks:
inspect:
type: console
inputs: [kubernetes_metrics]
encoding:
codec: jsonA forwarding sink can consume the same |
Yes. Vector's
prometheus_scrapesource can collect these metrics and forward them to a metrics-capable sink. The endpoint depends on what you need:/metrics/cadvisorendpoint on each node.node-exporter.kube-state-metrics. This does not provide actual CPU or memory usage.For example, with kube-state-metrics installed, this prints the collected metrics as JSON. Use your service's actual address: