Table of Contents
The goal was to get the metrics from the TrueNAS reporting tap inside my normal monitoring stack which consists of prometheus and grafana. In earlier versions of TrueNAS this was possible by utilising the collectd
graphite push service to push the metrics to a graphite_exporter
instance which then converts the metrics to prometheus metrics based on the provided mapping file. In TrueNAS scale 23.10 the reporting system was changed to netdata
and was missing the export feature all along. In 23.10.1
the export mechanism was added back in still lacking the ability to directly export the metrics to promeheus but still in the graphite form. But the metrics format changed due to the tool change.
The goal of this small repository is to provide you with a new graphite_mapping.conf
which is suitable to be used with the new metrics exposed by TrueNAS. This mapping file is in active development and may change regularly in the near future. Besides the raw mapping file a based grafana dashboard nad a quick summary of the required settings in TrueNAS are also included.
- Prepare environment
- Getting basic metrics extraction working
- Documentation
- Start of git project
- Fully detailed list of all metrics
- Multiple dashboards with pictures
- Convert all metrics to prometheus metrics without catch all rules
- Unify all metrics to a similar schema
See the open issues for a full list of proposed features (and known issues).
Those are the supported and tested versions of TrueNAS in combination with this exporter. Feel free to create a PR with a tested flag if you use a version not mentioned here.
TrueNAS Version | Supported | Tested |
---|---|---|
23.10.0 | ❔ (should work) | ❌ |
23.10.1 | ✅ | ✅ by @Supporterino |
23.10.2 | ✅ | ✅ by @Supporterino |
24.04.0 | ✅ | ✅ by @Supporterino |
24.04.1 | ✅ | ✅ by @Supporterino |
24.04.2 | ✅ | ✅ by @Supporterino |
TrueNAS SCALE has its own ability to export reporting data to other apps or charts in the Graphite protocol (e.g. Netdata, Prometheus/Grafana).
To create or edit the reporter for use with Prometheus:
- Go to the
Reporting
tab and click theExporters
button on the top right. - Click
Add
to create a new reporter or click theEdit
pencil icon next to the reporter you wish to use.
Ensure the following fields are adjusted depending on your target app or chart, as outlined in the TrueNAS instructions.
- The prefix for the graphite metrics need to be set to
truenas
for the mapping file to work - The hostname field should be choosen according to your needs it will later populate the
instance
label of your metrics - The
update every
field should match your scrape time - For
Send Names Instead Of Ids
, leave it blank and it will default totrue
(otherwise it may error out when trying to create the exporter).
The destination ip and port need to be set to target your graphite_exporter
I won't cover the setup process of this tool since it was already present for me. Feel free to open a PR with an recommended install method.
You obviously need a running graphite_exporter
which is scrabed by your prometheus instance and is reachable by your TrueNAS instance to push metrics to.
Check TRUENAS.md to see options to use this exporter directly inside of TrueNAS.
To utilise the provided graphite_mapping.conf
replace your existing conf of your graphite_exporter
and restart it. For the grafana dashboards you can simply import the provided json
file.
See METRICS.md for the exposed metrics by this config.
The dasboards are located inside the dashboards
folder and are simple json files which can be imported into grafana und used with the metrics.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request