You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expand Prometheus Metrics to state device/folder names #9519
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
State only the object ids as label to be scraped. I would welcome the addition of the clear-text values as labels in addition to the ids.
Problem or use case
After scraping a Syncthing server using Prometheus, I can display the metrics with tools like Grafana. Sadly, I can only display the unresolved ids of the folders / devices inside the UI, as no further information is available.
This leads to problems that alerts cannot contain easy-to-interepret descriptions - for admins to decide if they want to start investigation. In addition, admins cannot interpret e.g. if spikes in traffic are legitimate (as the device is only visible as ID) in Grafana, which makes anomaly-investigations harder.
Finally, with growing numbers of devices and folders connected to an instance (for me >40 folders / >8 devices) the metrics get more and more hard to read - pie charts containing statistics about specific folders in comparison to each other are just unreadable.
Here are some samples (blue = mask for privacy):
Alternatives or workarounds
Write an own exporter to scrape Syncthing-metrics and label them with the metadata available over the api.
@simonmicro could you provide an example of what device metadata you'd like to see exposed with those metrics? I'm thinking about giving this a shot. :)
@SophisticaSean Thank you very much about your motivation to pick this up! Mostly, I just would like to see the device's assigned name or (in case of folders) the assigned name from the web-ui. This would make identifying the metrics much easier!
But, as you ask... Maybe there is more metadata available? Could you compile a short list of ideas (be it just code references), where I could get an idea from what to suggest?
@SophisticaSean Thank you very much about your motivation to pick this up! Mostly, I just would like to see the device's assigned name or (in case of folders) the assigned name from the web-ui. This would make identifying the metrics much easier!
But, as you ask... Maybe there is more metadata available? Could you compile a short list of ideas (be it just code references), where I could get an idea from what to suggest?
Thanks in advance!
Yeah I'll take a look. My cursory glance revealed that this metric output takes the device ID's in as an argument, so we'd have to do some reworking to expose more data to the resulting prometheus metrics output.
I suspect there are a number of places exporting things by ID where the name is not readily available. An other option could be to expose an info metric, like a gauge with ID, name, type labels and just the value 1 for each folder & device. You can then join with that in the promql query.
@calmh Yes! This would also be a solution. Just presenting some metadata-metrics, which present the labels for the folder / device ids or even more metadata (last seen, connect time, connect ip, ...). Good idea!
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
SophisticaSean commentedon May 18, 2024
@simonmicro could you provide an example of what device metadata you'd like to see exposed with those metrics? I'm thinking about giving this a shot. :)
simonmicro commentedon May 19, 2024
@SophisticaSean Thank you very much about your motivation to pick this up! Mostly, I just would like to see the device's assigned name or (in case of folders) the assigned name from the web-ui. This would make identifying the metrics much easier!
But, as you ask... Maybe there is more metadata available? Could you compile a short list of ideas (be it just code references), where I could get an idea from what to suggest?
Thanks in advance!
SophisticaSean commentedon May 20, 2024
Yeah I'll take a look. My cursory glance revealed that this metric output takes the device ID's in as an argument, so we'd have to do some reworking to expose more data to the resulting prometheus metrics output.
calmh commentedon May 20, 2024
I suspect there are a number of places exporting things by ID where the name is not readily available. An other option could be to expose an info metric, like a gauge with ID, name, type labels and just the value 1 for each folder & device. You can then join with that in the promql query.
simonmicro commentedon May 20, 2024
@calmh Yes! This would also be a solution. Just presenting some metadata-metrics, which present the labels for the folder / device ids or even more metadata (last seen, connect time, connect ip, ...). Good idea!
feat(config): expose folder and device info as metrics (fixes #9519) (#…
Merge branch 'main' into v2
Merge tag 'v1.30.0' into feature/merge_upstream
Feature/merge upstream (#21)
chore(deps): update syncthing/syncthing docker tag to v2 (#2048)