-
-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
was looking at how i could run different collectors against the same list of target/jobs and noticed SQLEXPORTER_COLLECTOR_FILES can be defined as an environment variable. However, this does not work due to loadCollectorFiles() running before processEnvConfig() in the UnmarshallYAML in config.go.
To Reproduce
export SQLEXPORTER_COLLECTOR_FILES=mssql_test.collector.yml
./sql_exporter
time=2025-10-26T14:26:38.827+02:00 level=ERROR source=main.go:107 msg="Error creating exporter" error="unknown collector \"mssql_*\" referenced in job \"sqlserver01\""
Expected behavior
defining SQLEXPORTER_COLLECTOR_FILES should load the collector file.
Configuration
sql_exporter.yml
jobs:
- job_name: sqlserver01
collectors: [mssql_*]
static_configs:
- targets:
sqlserver01: sqlserver://test:test@192.168.15.240:1433/master
- job_name: sqlserver02
collectors: [mssql_*]
static_configs:
- targets:
sqlserver02: sqlserver://test:test@192.168.15.240:1433/master
Additional context
switching loadCollectorFiles() and processEnvConfig() around, the exporter runs successfully with SQLEXPORTER_COLLECTOR_FILES set
burningalchemist
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working