Class: Kube::Cluster::Standard::VictoriaMetrics::VLAgent

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

Overview

Collects Kubernetes pod logs and remote-writes them to a VLSingle.

Instance Method Summary collapse

Constructor Details

#initialize(name:, remote_write_url:, &block) ⇒ VLAgent

Returns a new instance of VLAgent.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/kube/cluster/standard/victoria_metrics/vl_agent.rb', line 12

def initialize(name:, remote_write_url:, &block)
  super() {
    .name          = name
    spec.useStrictSecurity = true
    spec.k8sCollector = {
      enabled:    true,
      msgFields:  %w[msg message log.msg],
      timeFields: %w[time ts timestamp],
    }
    spec.remoteWrite = [{ url: remote_write_url }]
    instance_exec(&block) if block
  }
end