diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 1ee51d3c5a..0bcdbf5643 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -361,8 +361,35 @@ sssd::package_name: sssd::service_names: - "sssd" -telegraf::logfile: "/dev/null" telegraf::quiet: true +telegraf::hostname: "%{facts.networking.fqdn}" +telegraf::inputs: + cpu: + - percpu: true + totalcpu: true + mem: [{}] + disk: [{}] + diskio: [{}] + net: + - ignore_protocol_stats: true + nstat: [{}] + swap: [{}] + system: [{}] + ethtool: [{}] + kernel: [{}] + kernel_vmstat: [{}] + netstat: [{}] + processes: [{}] + puppetagent: + - location: "/opt/puppetlabs/puppet/public/last_run_summary.yaml" +telegraf::outputs: + http: + - url: "https://mimir.o11y.dev.lsst.org/api/v1/push" + data_format: "prometheusremotewrite" + headers: + Content-Type: "application/x-protobuf" + Content-Encoding: "snappy" + X-Prometheus-Remote-Write-Version: "0.1.0" mit_krb5::includedir: - "/etc/krb5.conf.d/" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1c9e899818..642bbc6c33 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -150,6 +150,7 @@ def node_files shared_examples 'common' do |facts:, no_auth: false, chrony: true, network: true| include_examples 'bash_completion', facts: facts include_examples 'convenience' + include_examples 'telegraf' unless no_auth # inspect config fragment instead of class params to ensure that %{uid} is not diff --git a/spec/support/spec/telegraf.rb b/spec/support/spec/telegraf.rb new file mode 100644 index 0000000000..3e48a85341 --- /dev/null +++ b/spec/support/spec/telegraf.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +shared_examples 'telegraf' do + it do + is_expected.to contain_class('telegraf').with_outputs( + 'http' => [{ + 'url' => 'https://mimir.o11y.dev.lsst.org/api/v1/push', + 'data_format' => 'prometheusremotewrite', + 'headers' => { + 'Content-Type' => 'application/x-protobuf', + 'Content-Encoding' => 'snappy', + 'X-Prometheus-Remote-Write-Version' => '0.1.0', + }, + }], + ) + end +end