Skip to content

Commit

Permalink
(common) update telegraf inputs + push metrics to mimir
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Nov 3, 2023
1 parent 12d80fd commit d49b6d2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
29 changes: 28 additions & 1 deletion hieradata/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions spec/support/spec/telegraf.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d49b6d2

Please sign in to comment.