Skip to content

Validate Connector Usage #8721

@arielvalentin

Description

@arielvalentin

Is your feature request related to a problem? Please describe.

I expected the configuration validator to find pipeline issues related to invalid usage of connector components, however the collector fails to start due to invalid usage and exits.

Here is an example that defines a count connector and uses it as a receiver in a metrics pipeline:

---
receivers:
  otlp:
    protocols:
      grpc:
      http:
exporters:
  logging:
connectors:
  count:

service:
  pipelines:
    traces/in:
      receivers: [otlp]
      exporters: [logging]
    metrics/out:
      receivers: [count]
      exporters: [logging]

The config.yaml passes validation:

otel-validations(:|✔) %
🤘 docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.87.0 validate --config=/etc/otelcol-contrib/config.yaml

otel-validations(:|✔) %
🤘 echo $?
0

However upon using this configuration, the collector reports an error and exits:

otel-validations(:|✔) %
🤘 docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.87.0
2023-10-22T21:05:36.612Z	info	[email protected]/telemetry.go:84	Setting up own telemetry...
2023-10-22T21:05:36.612Z	info	[email protected]/telemetry.go:201	Serving Prometheus metrics	{"address": ":8888", "level": "Basic"}
Error: failed to build pipelines: connector "count" used as receiver in metrics pipeline but not used in any supported exporter pipeline
2023/10/22 21:05:36 collector server run finished with error: failed to build pipelines: connector "count" used as receiver in metrics pipeline but not used in any supported exporter pipeline

otel-validations(:|✔) %
🤘 echo $?
1

 
Describe the solution you'd like

I expect the validator to return an error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions