Skip to content

Commit

Permalink
remove prom exporter Describe
Browse files Browse the repository at this point in the history
  • Loading branch information
MadVikingGod authored and dashpole committed Oct 17, 2022
1 parent 1cbd4c2 commit 3d1c919
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- `sdktrace.TraceProvider.Shutdown` and `sdktrace.TraceProvider.ForceFlush` to not return error when no processor register. (#3268)
- The `"go.opentelemetry.io/otel/exporters/prometheus".New` now also returns an error indicating the failure to register the exporter with Prometheus. (#3239)
- The prometheus exporter will no longer try to enumerate the metrics it will send to prometheus on startup. This fixes a warning on startup. (#????)

### Fixed

Expand Down
13 changes: 6 additions & 7 deletions exporters/prometheus/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@ func New(opts ...Option) (*Exporter, error) {
}

// Describe implements prometheus.Collector.
//
// Opentelemetry SDK doesn't have information on which will exist when the collector
// is registered. By returning nothing we are an "unckeched" collector in prometheus,
// and assume responsibility for consistency of the metrics produced.
//
// See https://pkg.go.dev/github.com/prometheus/client_golang@v1.13.0/prometheus#hdr-Custom_Collectors_and_constant_Metrics
func (c *collector) Describe(ch chan<- *prometheus.Desc) {
metrics, err := c.reader.Collect(context.TODO())
if err != nil {
otel.Handle(err)
}
for _, metricData := range getMetricData(metrics) {
ch <- metricData.description
}
}

// Collect implements prometheus.Collector.
Expand Down

0 comments on commit 3d1c919

Please sign in to comment.