<p>Like the title says, does anyone here know of the proper way to go about adding <code>cardano-node</code> version to the <code>cardano_node_metrics</code> being exported by Prometheus to Grafana? I would like to add this information to the dashboard without having to create a whole separate set of scripts and services to obtain this information.</p>
<p>There is <a href="https://github.com/input-output-hk/cardano-node/issues/3693" rel="nofollow noreferrer">this</a> Github issue with the same request, but it is marked as closed without any explanation/documentation.</p>
<p>Then there is also <a href="https://forum.cardano.org/t/grafana-displays-no-data-on-several-metrics-when-importing-cardano-application-dashboard-v2-json/53731" rel="nofollow noreferrer">this</a>, which seems to imply that it is possible and is somehow used by IOG for their internal operations or something. But it involves Nix, which is currently beyond my realm of understanding.</p>
<p>My solution is to use <code>prometheus_client</code> in Python to create a service on each node just to export the version. But if there is a cleaner way...please let me know.</p>

CC BY-SA 4.0
2023-02-09T16:57:25.907Z
On last your link "there is also this, which seems to imply...", if you look down OP mentioned that it is not native metric, but rather generated by script, same idea as with your Python script. I would guess that is the way...
os11k
CC BY-SA 4.0
2023-02-09T20:52:23.567Z
Yes, that is the route that I went. A Python script to get the versions and dump it to an appropriately formatted text file to use with Prometheus text file collectors.
King Leon
<cardano-cli><cardano-node><spo>
Is there a way to get cardano-node version in Prometheus metrics?
# Is there a way to get cardano-node version in Prometheus metrics?

(Asked by: username_0 on 2023-02-05)

Like the title says, does anyone here know of the proper way to go about adding `cardano-node` version to the `cardano_node_metrics` being exported by Prometheus to Grafana? I would like to add this information to the dashboard without having to create a whole separate set of scripts and services to obtain this information.

There is [this](https://github.com/input-output-hk/cardano-node/issues/3693) Github issue with the same request, but it is marked as closed without any explanation/documentation.

Then there is also [this](https://forum.cardano.org/t/grafana-displays-no-data-on-several-metrics-when-importing-cardano-application-dashboard-v2-json/53731), which seems to imply that it is possible and is somehow used by IOG for their internal operations or something. But it involves Nix, which is currently beyond my realm of understanding.

My solution is to use `prometheus_client` in Python to create a service on each node just to export the version. But if there is a cleaner way...please let me know.

**Tags:** cardano-cli, cardano-node, spo
> **Comments:**
> **username_1**: On last your link "there is also this, which seems to imply...", if you look down OP mentioned that it is not native metric, but rather generated by script, same idea as with your Python script. I would guess that is the way...  
> **username_0**: Yes, that is the route that I went. A Python script to get the versions and dump it to an appropriately formatted text file to use with Prometheus text file collectors.  

---

## 0 answers

