Supports telegraf 0.1.9+
Example:
class { 'telegraf':
tags => {
dc => $dc,
# some other tags if you like...
}
}
class { 'telegraf::outputs::amqp':
amqp_user => 'user',
amqp_pass => 'pass',
amqp_hub => 'hostname',
amqp_vhost => 'vhost'
exchange => 'telegraf',
routing_tag => 'dc',
}
Custom output example:
telegraf::outputs { "prometheus_client.${dc}":
conf => {
'listen' => ":${port}",
'path' => $path,
'namepass' => $namepass
}
}
telegraf::outputs { "prometheus_client.${dc2}":
conf => {
'listen' => ":${port}",
'path' => $path,
'namepass' => $namepass
}
}
Custom metrics example:
telegraf::plugin { '[inputs.logparser.nginx_access_log]':
plugin_name => '[inputs.logparser]',
order => '05',
conf => {
'files' => ['/var/log/nginx/access.log'],
'from_beginning' => false,
'[inputs.logparser.grok]' => {
'patterns' => ['%{RT_CACHE_LOG_FORMAT}'],
'custom_patterns' => 'RT_CACHE_LOG_FORMAT %{IP:client_ip} %{NOTSPACE:ident} %{NOTSPACE:upstream_cache_status} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:resp_code:tag} (?:%{NUMBER:resp_bytes:int}|-) %{QS:referrer} %{QS:agent} %{QS:request_time} %{QS:upstream_response_time} %{QS:upstream_addr}',
'measurement' => 'nginx_access_log'
}
}
}