Skip to content

Conversation

@lledey
Copy link

@lledey lledey commented Jan 24, 2026

This PR fixes an issue where the /metrics endpoint returns a 500 caused by the error collected metric XXX with unregistered descriptor Desc

The error comes from the fact that this service is using the prometheus Go client in a wrong way to initialize the Desc that the service will expose. The possible Desc values are currently initialized in the prometheus library by calling prometheus.DescribeByCollect here as part of the initialization of the service, and it works by collecting all the metrics once to get all the possible Desc values. The service here will only collect the metrics for the disks it managed to get stats for (here)

This is a problem in various scenario, for example

  • all disks are idle: no metrics are collected, so no Desc are initialized at all
  • disks are running and are in good condition: when a disk goes bad and error metrics start getting reported, these won't have been initialized previously

When looking at the prometheus.DescribeByCollect implementation and documentation here, it's clear that this method should not be used by this service because of the use-case described in this issue.

Fixes #326

@lledey
Copy link
Author

lledey commented Feb 6, 2026

Hey @NiceGuyIT, it seems like you've been the most recent active maintainer, do you think you could have a look at this PR at some point?

If that goes through, do you think you could also support on releasing a new version of the app? Or is there any guidance so that I could contribute there as well?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collector 500s when drives resume from idle after exporter was started

1 participant