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

Add pipeline ID to the error message for unused connectors. #12410

Merged

Conversation

sudiptob2
Copy link
Contributor

@sudiptob2 sudiptob2 commented Feb 17, 2025

Description

As mentioned in this #8721 (comment), the error message for unused connectors currently lacks specific pipeline names, making debugging more difficult.

This PR enhances the error message by including pipeline names in the [signal/name] format, consistent with how they appear in config.yaml. This provides a better context for identifying misconfigurations.

Link to tracking issue

Related to #8721

Testing

A few scenarios and example output are given below. I will do additional testing and add unit tests if necessary.

1. Used as a receiver but not used as an exporter with 1 signal

config.yaml
receivers:
  otlp:
    protocols:
      grpc:
exporters:
  debug:
connectors:
  forward:
service:
  pipelines:
    logs/in:
      receivers: [otlp]
      processors: []
      exporters: [debug]
    logs/out:
      receivers: [forward]
      processors: []
      exporters: [debug]

Main Branch Output:

Error: failed to build pipelines: connector "forward" used as receiver in logs pipeline but not used in any supported exporter pipeline

Proposed Output:

Error: failed to build pipelines: connector "forward" used as receiver in [logs/out] pipeline but not used in any supported exporter pipeline

2. Plain

config.yaml
receivers:
  otlp:
    protocols:
      grpc:
exporters:
  debug:
connectors:
  forward:
service:
  pipelines:
    traces:
      receivers: [ otlp ]
      processors: [ ]
      exporters: [ forward ]
    metrics:
      receivers: [ forward ]
      processors: [ ]
      exporters: [ debug ]

Main Branch Output:

Error: failed to build pipelines: connector "forward" used as exporter in traces pipeline but not used in any supported receiver pipeline

Proposed Output:

Error: failed to build pipelines: connector "forward" used as exporter in [traces] pipeline but not used in any supported receiver pipeline

3. Multiple pipeline

config.yaml
receivers:
  otlp:
    protocols:
      grpc:
exporters:
  debug:
connectors:
  forward:
service:
  pipelines:
    logs/in:
      receivers: [otlp]
      processors: []
      exporters: [forward]
    logs/in2:
      receivers: [ otlp ]
      processors: [ ]
      exporters: [ forward ]
    logs/out:
      receivers: [otlp]
      processors: []
      exporters: [debug]
    traces:
      receivers: [ otlp ]
      processors: [ ]
      exporters: [ forward ]
    metrics:
      receivers: [ forward ]
      processors: [ ]
      exporters: [ debug ]

Main Branch Output:

Error: failed to build pipelines: connector "forward" used as exporter in logs pipeline but not used in any supported receiver pipeline

Proposed Output:

Error: failed to build pipelines: connector "forward" used as exporter in [logs/in2 logs/in] pipeline but not used in any supported receiver pipeline

Copy link

linux-foundation-easycla bot commented Feb 17, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@sudiptob2 sudiptob2 force-pushed the feat/8721/add-full-pipeline-name branch 3 times, most recently from bfa89c4 to b043489 Compare February 18, 2025 01:40
@sudiptob2 sudiptob2 marked this pull request as ready for review February 18, 2025 01:46
@sudiptob2 sudiptob2 requested a review from a team as a code owner February 18, 2025 01:46
@sudiptob2 sudiptob2 force-pushed the feat/8721/add-full-pipeline-name branch 2 times, most recently from a3130ef to a3fc63c Compare February 18, 2025 18:21
@sudiptob2
Copy link
Contributor Author

Thank you so much for your quick response and amazing suggestions. I have made the adjustment, let me know how it looks @bogdandrutu

@sudiptob2 sudiptob2 force-pushed the feat/8721/add-full-pipeline-name branch from a3fc63c to 372ab66 Compare February 19, 2025 00:24
@sudiptob2 sudiptob2 force-pushed the feat/8721/add-full-pipeline-name branch from 372ab66 to 9faed07 Compare February 19, 2025 18:49
Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link

codecov bot commented Feb 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.10%. Comparing base (4c4a9c2) to head (8c3e534).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12410   +/-   ##
=======================================
  Coverage   92.09%   92.10%           
=======================================
  Files         465      465           
  Lines       25173    25180    +7     
=======================================
+ Hits        23184    23191    +7     
  Misses       1592     1592           
  Partials      397      397           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

auto-merge was automatically disabled February 23, 2025 18:57

Head branch was pushed to by a user without write access

@sudiptob2
Copy link
Contributor Author

@bogdandrutu Thanks for approving the PR earlier. I added a changelog entry. Could you please re-review?

@bogdandrutu bogdandrutu added this pull request to the merge queue Feb 24, 2025
Merged via the queue into open-telemetry:main with commit 18e18b2 Feb 24, 2025
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants