Telegraf configs and Grafana dashboards used at
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
squeaky otter 6bb40507ca
Add dynamic statds dashboard
5 years ago
dashboards Add dynamic statds dashboard 5 years ago
telegraf.d Updates 5 years ago Add dynamic statds dashboard 5 years ago Add script 5 years ago
sidekiq.rb First import 5 years ago Updates 5 years ago
telegraf.conf First import 5 years ago

Telegraf and Grafana stuff


This are used for the Mastodon instance

2. Scripts

  • script : location or in folder ; which host should I put it ?
  • telegraf.conf : base config for each hosts
  • sidekiq.rb : location: /home/mastodon/sidekiq/sidekiq.rb ; where is redis located
  • : location: /etc/telegraf/ ; where is redis located
  • telegraf.d/logs.conf : in /etc/telegraf/telegraf.d/ ; nginx fronts
  • telegraf.d/nginx.conf : same ; nginx fronts
  • telegraf.d/postgresql.conf : same ; postgresql
  • telegraf.d/postgresql_extensible.conf : same ; postgresql
  • telegraf.d/procstat_minio.conf : same ; where is minio running
  • telegraf.d/procstat_nodejs.conf : same ; where is nodejs streaming running
  • telegraf.d/procstat_puma00.conf : same ; where is puma/web running
  • telegraf.d/procstat_puma01.conf : same ; same
  • telegraf.d/procstat_sidekiq.conf : same ; where is sidekiq running
  • telegraf.d/redis.conf : same ; where is redis running
  • telegraf.d/sidekiq.conf : same ; where is sidekiq running

3. Explanations and notes

  • Postgresql have the default metrics + _extensible which runs specifics SQL Queries like number of accounts
  • procstat_ only count for processes memory/cpu and threads
  • Some inputs should be edited if you have more or less than two puma processes, more sidekick, more nodejs etc. Actually they grep the process and EXCEPT ONLY ONE.
  • Sudo config:
    • telegraf ALL=(ALL:ALL) NOPASSWD: ALL
    • I'm too lazy, feel free to adapt, telegraf should be able to run: "/sbin/iptables -nvL *', the sudo command inside

4. Dashboards

  • Import them, they are pretty self-explenatory
  • My default source influxdb database is named 'telegraf' an events 'events'
  • dashboards/statsd.js is a dynamic dashboard to be put under /usr/share/grafana/public/dashboards
    • And accessible from /dashboard/script/statsd.js

5. Events

  • Add the following to /etc/systemd/system/mastodon-*.service :

    • ExecStopPost=/usr/local/bin/ stop mastodon-web
    • ExecStartPost=/usr/local/bin/ started mastodon-web
  • Adapt the "mastodon-web" at end for each service file.

  • Every start or stop it will push an event to influxdb with action and git commit of the working directory of mastodon