mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-06 17:22:09 +00:00
Merge pull request #683 from preved911/fix/extend_probe_path_metrics
Extending /probe path metrics
This commit is contained in:
commit
34d3605788
@ -78,6 +78,23 @@ func handleProbe(logger log.Logger) http.HandlerFunc {
|
||||
registry.MustRegister(probeSuccessGauge)
|
||||
registry.MustRegister(probeDurationGauge)
|
||||
|
||||
opts := []ExporterOpt{
|
||||
DisableDefaultMetrics(*disableDefaultMetrics),
|
||||
DisableSettingsMetrics(*disableSettingsMetrics),
|
||||
AutoDiscoverDatabases(*autoDiscoverDatabases),
|
||||
WithUserQueriesPath(*queriesPath),
|
||||
WithConstantLabels(*constantLabelsList),
|
||||
ExcludeDatabases(*excludeDatabases),
|
||||
IncludeDatabases(*includeDatabases),
|
||||
}
|
||||
|
||||
dsns := []string{dsn.GetConnectionString()}
|
||||
exporter := NewExporter(dsns, opts...)
|
||||
defer func() {
|
||||
exporter.servers.Close()
|
||||
}()
|
||||
registry.MustRegister(exporter)
|
||||
|
||||
// Run the probe
|
||||
pc, err := collector.NewProbeCollector(tl, registry, dsn)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user