Skip to content

validate command does not validate pipeline type #8007

Closed
@andrzej-stencel

Description

@andrzej-stencel

Describe the bug

Thew validate command intoduced in #7835 does not validate the type of pipeline a component is assigned to. For example, if a metrics-only component is used in a logs pipeline, validation passes, but I would expect it to fail.

Steps to reproduce

$ otelcol-contrib-0.80.0-linux_amd64 --config config.yaml 
2023-07-03T11:49:33.120+0200    info    service/telemetry.go:81 Setting up own telemetry...
2023-07-03T11:49:33.120+0200    info    service/telemetry.go:104        Serving Prometheus metrics      {"address": ":8888", "level": "Basic"}
2023-07-03T11:49:33.120+0200    info    exporter@v0.80.0/exporter.go:275        Stability level of component is undefined       {"kind": "exporter", "data_type": "logs", "name": "prometheus"}
Error: failed to build pipelines: failed to create "prometheus" exporter for data type "logs": telemetry type is not supported
2023/07/03 11:49:33 collector server run finished with error: failed to build pipelines: failed to create "prometheus" exporter for data type "logs": telemetry type is not supported
  • Run the validate command:
$ otelcol-contrib-0.80.0-linux_amd64 validate --config config.yaml
$ echo $?
0

What did you expect to see?
Validation fails

What did you see instead?
Validation succeeds

What version did you use?
v0.80.0

What config did you use?

exporters:
  awscloudwatchlogs:
    log_group_name: x
    log_stream_name: x
  jaeger:
    endpoint: x
  prometheus:

receivers:
  filelog:
  httpcheck:
    endpoint: x
  zipkin:

service:
  pipelines:
    logs:
      exporters:
      - prometheus # metrics-only
      receivers:
      - zipkin # traces-only

    metrics:
      exporters:
      - jaeger # traces-only
      receivers:
      - filelog # logs-only

    traces:
      exporters:
      - awscloudwatchlogs # logs-only
      receivers:
      - httpcheck # metrics-only

Environment
OS: Ubuntu 23.04 lunar

Additional context

Currently, there is no documentation describing to what extent the validation works. I believe it's reasonable for the user to assume the pipeline types would be validated. I understand that what the validate command does under the hood is just run Validate() on the config object.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedGood issue for contributors to OpenTelemetry Service to pick up

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions