File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -1147,29 +1147,6 @@ func (e *Exporter) setupInternalMetrics() {
11471147
11481148// Describe implements prometheus.Collector.
11491149func (e * Exporter ) Describe (ch chan <- * prometheus.Desc ) {
1150- // We cannot know in advance what metrics the exporter will generate
1151- // from Postgres. So we use the poor man's describe method: Run a collect
1152- // and send the descriptors of all the collected metrics. The problem
1153- // here is that we need to connect to the Postgres DB. If it is currently
1154- // unavailable, the descriptors will be incomplete. Since this is a
1155- // stand-alone exporter and not used as a library within other code
1156- // implementing additional metrics, the worst that can happen is that we
1157- // don't detect inconsistent metrics created by this exporter
1158- // itself. Also, a change in the monitored Postgres instance may change the
1159- // exported metrics during the runtime of the exporter.
1160- metricCh := make (chan prometheus.Metric )
1161- doneCh := make (chan struct {})
1162-
1163- go func () {
1164- for m := range metricCh {
1165- ch <- m .Desc ()
1166- }
1167- close (doneCh )
1168- }()
1169-
1170- e .Collect (metricCh )
1171- close (metricCh )
1172- <- doneCh
11731150}
11741151
11751152// Collect implements prometheus.Collector.
You can’t perform that action at this time.
0 commit comments