Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[otelcol] Improve error message when connectors lead to ambiguous IDs #8120

Closed
mx-psi opened this issue Jul 21, 2023 · 0 comments · Fixed by #8121
Closed

[otelcol] Improve error message when connectors lead to ambiguous IDs #8120

mx-psi opened this issue Jul 21, 2023 · 0 comments · Fixed by #8121
Assignees
Labels

Comments

@mx-psi
Copy link
Member

mx-psi commented Jul 21, 2023

When defining a pipeline, a component ID on the receivers or exporters section can be ambiguous if there is both a receiver/exporter and a connector with said ID.

For example, if we were to add a datadog connector, with the following configuration:

Sample ambiguous configuration (click to expand)
receivers:
  datadog:

exporters:
  datadog:
    api::key: ${env:DD_API_KEY}

connectors:
  datadog:

service:
  pipelines:
    traces:
      receivers: [datadog]
      exporters: [datadog]
    metrics:
      receivers: [datadog]
      exporters: [datadog]

will error out with

Error: invalid configuration: connectors::datadog: there's already an exporter named "datadog"

A valid way to work around this is to use different IDs for the receiver/exporter and the connector:

Sample unambiguous configuration (click to expand)
receivers:
  datadog:

exporters:
  datadog:
    api::key: ${env:DD_API_KEY}

connectors:
  datadog/connector:

service:
  pipelines:
    traces:
      receivers: [datadog]
      exporters: [datadog/connector]
    metrics:
      receivers: [datadog/connector]
      exporters: [datadog]

We should improve the error message given in this case to something closer to the following:

Error: invalid configuration: ambiguous ID 'datadog': Found both 'datadog' exporter and 'datadog' connector.
Add a suffix to one of the components' IDs to eliminate ambiguity (e.g. rename 'datadog' connector to 'datadog/connector')

The necessary information is available here.


Originally discussed in open-telemetry/opentelemetry-collector-contrib#19740 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants