Skip to content

Expand Prometheus Metrics to state device/folder names #9519

Description

@simonmicro

Feature description

Currently, metrics like:

  • syncthing_protocol_recv_bytes_total
  • syncthing_model_folder_processed_bytes_total

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):

Screenshot from 2024-04-26 18-18-52
Screenshot from 2024-04-26 18-19-03

Alternatives or workarounds

  • Write an own exporter to scrape Syncthing-metrics and label them with the metadata available over the api.
  • Relabel all ids by hand in the Prometheus config?

Activity

  1. added
    enhancement
    needs-triage
    on Apr 26, 2024
  2. removed
    needs-triage
    on Apr 26, 2024
  3. SophisticaSean commented on May 18, 2024

    @SophisticaSean

    @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. :)

  4. simonmicro commented on May 19, 2024

    @simonmicro
    Author

    @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!

  5. SophisticaSean commented on May 20, 2024

    @SophisticaSean

    @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.

  6. calmh commented on May 20, 2024

    @calmh
    Member

    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.

  7. simonmicro commented on May 20, 2024

    @simonmicro
    Author

    @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!

  8. added theissue type on May 30, 2025
  9. added 2 commits that reference this issue on May 31, 2025
    1fdf079
    8d37e8f
  10. added 2 commits that reference this issue on Jul 5, 2025
    273fbe6
    e968c74
  11. added
    frozen-due-to-age
    on Jul 1, 2026
  12. locked and limited conversation to collaborators on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfrozen-due-to-age

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions