Class: Kube::Cluster::Standard::VictoriaMetrics::VMAgent

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

Overview

Scrapes targets (selecting all scrape objects by default) and remote-writes the samples into a VMSingle/VMCluster.

Instance Method Summary collapse

Constructor Details

#initialize(name:, remote_write_url:, scrape_interval: "30s", select_all: true, &block) ⇒ VMAgent

Returns a new instance of VMAgent.



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

def initialize(name:, remote_write_url:, scrape_interval: "30s", select_all: true, &block)
  super() {
    .name           = name
    spec.selectAllByDefault = select_all
    spec.scrapeInterval     = scrape_interval
    spec.remoteWrite        = [{ url: remote_write_url }]
    instance_exec(&block) if block
  }
end