Historical Metrics for Applications?

I can see the realtime per app CPU, RAM, Block I/O and Network metrics in the Apps pane of the TruesNAS webui, but I wonder is historical data kept, and is it accessible?

If not in TrueNAS itself, is there are an app that gather, store and report on this data?

I scrape the docker socket directly, export the metrics to prometheus and build myself a grafana dashboard

1 Like

If you’re interested this is the composefile for the metric exporter i use:

name: docker-stats-exporter
services:
  docker_stats_exporter:
    image: wywywywy/docker_stats_exporter:latest
    container_name: docker-stats
    restart: always
    ports:
      - "9487:9487"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

and this is the entry in the prometheus.yml

  - job_name: 'docker_stats_exporter'
    metrics_path: /
    static_configs:
    - targets:
        - '191.1.1.9:9487' #replace with your ip
2 Likes

Cheers @LarsR, that’s really helpful. I’ve been trying to get cAdvisor to run on TrueNAS, without much success.

I’m a bit new to prometheus and grafana, but docker-stats-exporter appears to be exposing the network and block IO stats as gauges, when they are in fact counters?

It’s easy enough to write the correct query for in Grafana (stick an ‘increase’ operator on the query), but I wonder if I’m missing something as docker-stats-exporter seems quite popular, and it has no issues open for this.

Have to double check, it’s been almost a year since i set it up… and i’ve mostly forgot what i set up and how :sweat_smile: