Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Signed-off-by: gouthamve <gouthamve@gmail.com>
  • Loading branch information
gouthamve and pellared committed May 6, 2024
1 parent 6d9c443 commit 4e3ac55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -17,8 +17,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Added

- `NewSDK` in `go.opentelemetry.io/contrib/config` now returns a configured SDK with a valid `MeterProvider`. (#4804)
- Add an EXPERIMENTAL `OTEL_METRICS_PRODUCERS` environment variable to `go.opentelemetry.io/contrib/autoexport` to be set metrics producers. (#5281)
- `prometheus` and `none` are supported values. You can specify multiple producers separated by a comma.
- Add an experimental `OTEL_METRICS_PRODUCERS` environment variable to `go.opentelemetry.io/contrib/autoexport` to be set metrics producers. (#5281)
- `prometheus` and `none` are supported values. You can specify multiple producers separated by a comma.
- `WithFallbackMetricProducer(func(context.Context) (metric.Producer, error))` allows adding a fallback option if the env var is not set.

### Changed
Expand Down
7 changes: 4 additions & 3 deletions exporters/autoexport/metrics.go
Expand Up @@ -54,17 +54,18 @@ func WithFallbackMetricReader(metricReaderFactory func(ctx context.Context) (met
// OTEL_EXPORTER_PROMETHEUS_PORT (defaulting to 9464) define the host and port for the
// Prometheus exporter's HTTP server.
//
// Experimental: OTEL_METRICS_PRODUCERS can be used to configure metric producers.
// supported values: prometheus, none. Multiple values can be specified separated by commas.
//
// An error is returned if an environment value is set to an unhandled value.
//
// Use [RegisterMetricReader] to handle more values of OTEL_METRICS_EXPORTER.
// Use [RegisterMetricProducer] to handle more values of OTEL_METRICS_PRODUCERS.
//
// Use [WithFallbackMetricReader] option to change the returned exporter
// when OTEL_METRICS_EXPORTER is unset or empty.
//
// Use [IsNoneMetricReader] to check if the retured exporter is a "no operation" exporter.
//
// OTEL_METRICS_PRODUCERS can be used to configure metric producers; supported values: prometheus, none.
// Use [RegisterMetricProducer] to handle more values of OTEL_METRICS_PRODUCERS.
func NewMetricReader(ctx context.Context, opts ...MetricOption) (metric.Reader, error) {
return metricsSignal.create(ctx, opts...)
}
Expand Down

0 comments on commit 4e3ac55

Please sign in to comment.