Class: Kube::Cluster::Standard::VictoriaMetrics::VMPodScrape
- Inherits:
-
Object
- Object
- Kube::Cluster::Standard::VictoriaMetrics::VMPodScrape
- Defined in:
- lib/kube/cluster/standard/victoria_metrics/vm_pod_scrape.rb
Overview
Declares how to scrape the pods selected by the app.kubernetes.io/name label (the pod-selector analogue of VMServiceScrape), relabelling the metrics onto a job.
Instance Method Summary collapse
-
#initialize(name:, job:, match_name:, port:, &block) ⇒ VMPodScrape
constructor
A new instance of VMPodScrape.
Constructor Details
#initialize(name:, job:, match_name:, port:, &block) ⇒ VMPodScrape
Returns a new instance of VMPodScrape.
14 15 16 17 18 19 20 21 |
# File 'lib/kube/cluster/standard/victoria_metrics/vm_pod_scrape.rb', line 14 def initialize(name:, job:, match_name:, port:, &block) super() { .name = name spec.selector = { matchLabels: { "app.kubernetes.io/name" => match_name } } spec.podMetricsEndpoints = [{ port: port, relabelConfigs: [{ targetLabel: "job", replacement: job }] }] instance_exec(&block) if block } end |