Collector builder functions are only used internally in the `collector`
package, and shouldn't needlessly be exposed as part of the package API
to downstream clients.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Behaviour of init functions has been centralised in `collector/init.go`,
and can be called during exporter startup. This allows the exporter to
control the timing of collector initialisation, rather than relying on
the import & `init()` method.
This should reduce unexpected behaviour arising from the use of
`init()`, such as #551.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Bumps [github.com/alecthomas/kingpin](https://github.com/alecthomas/kingpin) from
v2.2.6 to v2.3.2.
This also changes the upstream package name from
gopkg.in/alecthomas/kingpin.v2 to github.com/alecthomas/kingpin/v2 which
is required by the upstream exporter-toolkit package.
Signed-off-by: Ben Reedy <breed808@breed808.com>
This change affects processing of single files with duplicate metrics.
Single files with duplicate metrics will be skipped, with no metrics being
collected and exposed by the exporter.
Previous duplicate metric processing across multiple files remains
unchanged (all files skipped, collector returns error).
Signed-off-by: Ben Reedy <breed808@breed808.com>
Loop was erroneously creating duplicate `windows_textfile_mtime_seconds`
metrics, causing the exporter to return a HTTP 500 error and no metrics
from any collector.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Check all textfile metrics will be checked for duplicates. If duplicates
are detected, drop all metrics and log error.
Signed-off-by: Ben Reedy <breed808@breed808.com>