Telegraf configs and Grafana dashboards used at oldbytes.space http://grafana.admin.sigpipe.me

Valérianne Dashie 6bb40507ca
Add dynamic statds dashboard
6 months ago
dashboards Add dynamic statds dashboard 6 months ago
telegraf.d Updates 6 months ago
README.md Add dynamic statds dashboard 6 months ago
deploy.sh Add deploy.sh script 6 months ago
sidekiq.rb First import 6 months ago
sidekiq.sh Updates 6 months ago
telegraf.conf First import 6 months ago

README.md

Telegraf and Grafana stuff

1.

This are used for the oldbytes.space 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
  • sidekiq.sh : location: /etc/telegraf/sidekiq.sh ; 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 sidekiq.sh.

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/deploy.sh stop mastodon-web
    • ExecStartPost=/usr/local/bin/deploy.sh 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