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 @@ -1236,29 +1236,6 @@ func (e *Exporter) setupInternalMetrics() {
12361236
12371237// Describe implements prometheus.Collector.
12381238func (e * Exporter ) Describe (ch chan <- * prometheus.Desc ) {
1239- // We cannot know in advance what metrics the exporter will generate
1240- // from Postgres. So we use the poor man's describe method: Run a collect
1241- // and send the descriptors of all the collected metrics. The problem
1242- // here is that we need to connect to the Postgres DB. If it is currently
1243- // unavailable, the descriptors will be incomplete. Since this is a
1244- // stand-alone exporter and not used as a library within other code
1245- // implementing additional metrics, the worst that can happen is that we
1246- // don't detect inconsistent metrics created by this exporter
1247- // itself. Also, a change in the monitored Postgres instance may change the
1248- // exported metrics during the runtime of the exporter.
1249- metricCh := make (chan prometheus.Metric )
1250- doneCh := make (chan struct {})
1251-
1252- go func () {
1253- for m := range metricCh {
1254- ch <- m .Desc ()
1255- }
1256- close (doneCh )
1257- }()
1258-
1259- e .Collect (metricCh )
1260- close (metricCh )
1261- <- doneCh
12621239}
12631240
12641241// Collect implements prometheus.Collector.
You can’t perform that action at this time.
0 commit comments