Skip to content

puppet module for telegraf - native client for influxdb

License

Notifications You must be signed in to change notification settings

wgsateam/puppet-telegraf

 
 

Repository files navigation

Puppet module to install and configure telegraf --- an OSS influxdb client

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'
    }
  }
}

About

puppet module for telegraf - native client for influxdb

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 57.9%
  • Puppet 36.6%
  • HTML 5.5%