Skip to content

configuration of explicitly declared interal-telemetry does not match default values of implicit/not declared configuration #13867

@litetex

Description

@litetex

Component(s)

service

What happened?

Describe the bug
Most of my otelc instances scrape the default internal telemetry with a prometheus job like this:

receivers:
  prometheus/default:
    config:
      scrape_configs:
        - job_name: otel-collector-self-metrics
          static_configs:
            - targets: ['localhost:8888']

this works fine and it looks like it has without_type_suffix and without_units internally set to true.

However when you explicitly declare internal-telemetry - to e.g. change the host - without_type_suffix and without_units now default to false ⁉️

So for to restore the original behavior you have to manually without_type_suffix and without_units to true.

service:
  # https://opentelemetry.io/docs/collector/internal-telemetry/
  telemetry:
    metrics:
      readers:
        - pull:
            exporter:
              prometheus:
                host: '[::0]'
                port: 8888
                # https://github.com/open-telemetry/opentelemetry-collector/blob/v0.125.0/CHANGELOG.md#v1250v01190
                without_type_suffix: true
                without_units: true

Steps to reproduce

  1. Start a default otelc and let it scrape it's metrics and store the somewhere
  2. There should be a metric named otelcol_process_memory_rss
  3. Add
    service:
      telemetry:
        metrics:
          readers:
            - pull:
                exporter:
                  prometheus:
                    host: '[::0]'
                    port: 8888
  4. Restart the collector
  5. The metric otelcol_process_memory_rss should vanish and now you get otelcol_process_memory_rss_bytes

What did you expect to see?
without_type_suffix and without_units should default to true if nothing is configured as is the case when not explicitly declaring internal-telemetry.

What did you see instead?
Already described above

Collector version

0.135.0

Environment information

Environment

OS: Docker - otel/opentelemetry-collector-contrib:0.135.0

OpenTelemetry Collector configuration

receivers:
  prometheus/default:
    config:
      scrape_configs:
        - job_name: otel-collector-self-metrics
          static_configs:
            - targets: ['localhost:8888']
...

Log output

-

Additional context

The documentation also doesn't refer to without_type_suffix and without_units and similar options and it should be updated.

I only found out about the change after manually checking the changelogs.

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions