Class: Kube::Cluster::Standard::VictoriaMetrics::VMStaticScrape

Inherits:
Object
  • Object
show all
Defined in:
lib/kube/cluster/standard/victoria_metrics/vm_static_scrape.rb

Overview

Scrapes a fixed set of static targets (host:port) under a named job — for endpoints that have no Service/Pod to select. Extra per-endpoint settings (path, scheme, labels) can be added in the block.

Instance Method Summary collapse

Constructor Details

#initialize(name:, job:, targets:, &block) ⇒ VMStaticScrape

Returns a new instance of VMStaticScrape.



14
15
16
17
18
19
20
21
# File 'lib/kube/cluster/standard/victoria_metrics/vm_static_scrape.rb', line 14

def initialize(name:, job:, targets:, &block)
  super() {
    .name       = name
    spec.jobName        = job
    spec.targetEndpoints = [{ targets: Array(targets) }]
    instance_exec(&block) if block
  }
end