Skip to content

Commit

Permalink
otel/prometheus_exporter: disable otel_scope_info by default (#4775)
Browse files Browse the repository at this point in the history
* Disable scope_info by default

The collector doesn't implement this yet and the metrics are not very useful.

See: open-telemetry/opentelemetry-collector-contrib#24248

Signed-off-by: Goutham <gouthamve@gmail.com>

* Add changelog entry

Signed-off-by: Goutham <gouthamve@gmail.com>

---------

Signed-off-by: Goutham <gouthamve@gmail.com>
  • Loading branch information
gouthamve authored Aug 15, 2023
1 parent 883d569 commit 388aff7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Main (unreleased)
to enable decompression explicitly. See the [upgrade guide][] for migration
instructions. (@thampiotr)

- `otelcol.exporter.prometheus`: Set `include_scope_info` to `false` by default. You can set
it to `true` to preserve previous behavior. (@gouthamve)

### Enhancements

- Integrations: include `direct_connect`, `discovering_mode` and `tls_basic_auth_config_path` fields for MongoDB configuration. (@gaantunes)
Expand Down
4 changes: 2 additions & 2 deletions component/otelcol/exporter/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type Arguments struct {
// DefaultArguments holds defaults values.
var DefaultArguments = Arguments{
IncludeTargetInfo: true,
IncludeScopeInfo: true,
IncludeScopeInfo: false,
GCFrequency: 5 * time.Minute,
}

Expand Down Expand Up @@ -77,7 +77,7 @@ func New(o component.Options, c Arguments) (*Component, error) {

converter := convert.New(o.Logger, fanout, convert.Options{
IncludeTargetInfo: true,
IncludeScopeInfo: true,
IncludeScopeInfo: false,
})

res := &Component{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,20 @@ otelcol.exporter.prometheus "LABEL" {
Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`include_target_info` | `boolean` | Whether to include `target_info` metrics. | `true` | no
`include_scope_info` | `boolean` | Whether to include `otel_scope_info` metrics. | `true` | no
`include_scope_info` | `boolean` | Whether to include `otel_scope_info` metrics. | `false` | no
`gc_frequency` | `duration` | How often to clean up stale metrics from memory. | `"5m"` | no
`forward_to` | `list(receiver)` | Where to forward converted Prometheus metrics. | | yes

By default, OpenTelemetry resources are converted into `target_info` metrics,
and OpenTelemetry instrumentation scopes are converted into `otel_scope_info`
By default, OpenTelemetry resources are converted into `target_info` metrics.
OpenTelemetry instrumentation scopes are converted into `otel_scope_info`
metrics. Set the `include_scope_info` and `include_target_info` arguments to
`false`, respectively, to disable the custom metrics.

When `include_scope_info` is `true`, the instrumentation scope name and version
are added as `otel_scope_name` and `otel_scope_version` labels to every
converted metric sample.


When `include_scope_info` is true, OpenTelemetry Collector resources are converted into `target_info` metrics.
When `include_target_info` is true, OpenTelemetry Collector resources are converted into `target_info` metrics.

## Exported fields

Expand Down

0 comments on commit 388aff7

Please sign in to comment.