Skip to content

[cmd/otelcorecol]: lists OTLP exporters twice (duplicate canonical entries) due to alias #14492

@RealAnna

Description

@RealAnna

Component(s)

cmd/otelcorecol

What happened?

Describe the bug

Title

components command lists OTLP exporters twice (duplicate canonical entries) due to alias

Description

After upgrading to OpenTelemetry Collector v0.144.0, the generated collector’s components command outputs duplicate entries for OTLP exporters. The duplicates are not alias/canonical pairs; they are two identical canonical entries each for otlp_grpc and otlp_http.

Impact

  • Breaks tests that compare components output with the manifest (counts inflate).
  • Masks real double-registration bugs during validation.

Environment

  • Core: v0.144.0
  • Contrib: v0.144.0
  • OS/Arch: observed on darwin/arm64 and linux/amd64
  • Built via cmd/builder; using the components subcommand to dump YAML.

Steps to reproduce

  1. Build a custom collector with builder (v0.144.0) including:
    • go.opentelemetry.io/collector/exporter/otlpexporter
    • go.opentelemetry.io/collector/exporter/otlphttpexporter
  2. Run:
    ./your-collector-binary components
  3. Inspect the exporters in the YAML output.

What did you expect to see?

Each exporter should be listed exactly once. If deprecated aliases are included for compatibility, they should not cause duplicate canonical entries in the output.

What did you see instead?

otlp_grpc and otlp_http each appear twice with identical name/module/stability.

Collector version

v0.144.0

Environment information

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

exporters:
  otlp_grpc:
    endpoint: https://localhost:4312
  otlp_http:
    endpoint: https://localhost:7821

Log output

- name: otlp_grpc
  module: go.opentelemetry.io/collector/exporter/otlpexporter v0.144.0
  stability:
    logs: Stable
    metrics: Stable
    traces: Stable
- name: otlp_grpc
  module: go.opentelemetry.io/collector/exporter/otlpexporter v0.144.0
  stability:
    logs: Stable
    metrics: Stable
    traces: Stable
- name: otlp_http
  module: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.144.0
  stability:
    logs: Stable
    metrics: Stable
    traces: Stable
- name: otlp_http
  module: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.144.0
  stability:
    logs: Stable
    metrics: Stable
    traces: Stable

Additional context

  • Recent rename + alias support (otlpotlp_grpc, otlphttpotlp_http) may interact with module/alias mapping in the generated components command: the alias is a separate type entry, but the components command prints only the canonical “name” (after normalization), not the alias string. So both the canonical and its alias end up rendered with the same name/module/stability, making them appear as identical duplicates.

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