opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

[service] Validate pipeline type against component types

Open ycombinator opened this issue 1 year ago • 8 comments
trafficstars

Description: <Describe what has changed.>

This change adds another layer of validation to pipelines. It validates that all the components in a pipeline are of the same type as the pipeline.

For example, if a metrics pipeline contains a traces-only receiver, the otelcol validate -config ... command will fail.

Link to tracking Issue: Fixes #8007.

Testing: Added unit test + existing tests are passing.

Documentation: godoc.

ycombinator avatar Jan 10 '24 02:01 ycombinator

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Feb 01 '24 03:02 github-actions[bot]

PR is still active; waiting on review.

ycombinator avatar Feb 01 '24 12:02 ycombinator

Codecov Report

Attention: Patch coverage is 82.05128% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 90.97%. Comparing base (c6d1482) to head (da1f5d8). Report is 3 commits behind head on main.

:exclamation: Current head da1f5d8 differs from pull request most recent head 58523a4. Consider uploading reports for the commit 58523a4 to get more accurate results

Files Patch % Lines
receiver/receivertest/nop_receiver.go 23.52% 13 Missing :warning:
otelcol/collector.go 94.44% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9257      +/-   ##
==========================================
- Coverage   91.31%   90.97%   -0.34%     
==========================================
  Files         357      353       -4     
  Lines       19202    18748     -454     
==========================================
- Hits        17534    17056     -478     
- Misses       1340     1364      +24     
  Partials      328      328              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 12 '24 07:02 codecov[bot]

Hi @bogdandrutu, would you mind kicking off the CI checks again on this PR, please? Thanks!

ycombinator avatar Feb 12 '24 23:02 ycombinator

Thanks @atoulme, for kicking off CI again. I've fixed another linter error (from impi) in https://github.com/open-telemetry/opentelemetry-collector/pull/9257/commits/8b53d4ea9d24e6d5cc19b73fa1d971573112b7a0. Would you mind kicking off CI one more time, please? Thank you.

BTW, I noticed that CI, specifically the contrib-tests / contrib-tests-matrix (receiver-1) (pull_request) check, is failing on these tests from opentelemetry-collector-contrib:

--- FAIL: TestScrape (0.06s)
    --- FAIL: TestScrape/Standard (0.01s)
        network_scraper_test.go:234: 
            	Error Trace:	/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:234
            	            				/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:203
            	Error:      	Not equal: 
            	            	expected: 12
            	            	actual  : 13
            	Test:       	TestScrape/Standard
    --- FAIL: TestScrape/Standard_with_direction_removed (0.01s)
        network_scraper_test.go:234: 
            	Error Trace:	/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:234
            	            				/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:203
            	Error:      	Not equal: 
            	            	expected: 12
            	            	actual  : 13
            	Test:       	TestScrape/Standard_with_direction_removed
    --- FAIL: TestScrape/Validate_Start_Time (0.01s)
        network_scraper_test.go:234: 
            	Error Trace:	/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:234
            	            				/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:203
            	Error:      	Not equal: 
            	            	expected: 12
            	            	actual  : 13
            	Test:       	TestScrape/Validate_Start_Time
    --- FAIL: TestScrape/Include_Filter_that_matches_nothing (0.01s)
        network_scraper_test.go:234: 
            	Error Trace:	/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:234
            	            				/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:203
            	Error:      	Not equal: 
            	            	expected: 12
            	            	actual  : 13
            	Test:       	TestScrape/Include_Filter_that_matches_nothing
    --- FAIL: TestScrape/Conntrack_error_ignored_if_metric_disabled (0.01s)
        network_scraper_test.go:234: 
            	Error Trace:	/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:234
            	            				/tmp/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/network_scraper_test.go:203
            	Error:      	Not equal: 
            	            	expected: 12
            	            	actual  : 13
            	Test:       	TestScrape/Conntrack_error_ignored_if_metric_disabled
FAIL
FAIL	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper	0.081s

I'm not following how the failing assertion in a test for the hostmetricsreceiver component might be failing because of the change in this PR here. 🤔

ycombinator avatar Feb 13 '24 00:02 ycombinator

It's possible contrib CI is broken. Rerunning.

atoulme avatar Feb 13 '24 00:02 atoulme

It's possible contrib CI is broken. Rerunning.

Thanks. ~Or could it be because I'm not a OTel Community member (yet)?~

[EDIT] Never mind, I misunderstood what you meant by "contrib CI". I understand now that you were referring to the failing tests, not the fact that you have to manually trigger CI runs for me on this PR.

ycombinator avatar Feb 13 '24 00:02 ycombinator

Nothing like that, we just run CI by checking out the latest main of contrib, which can break.

FWIW CI doesn't run for you on commit because this is your first PR. After you have a commit in the repository, CI will run when you push to your branch without our intervention.

atoulme avatar Feb 13 '24 00:02 atoulme

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Feb 27 '24 03:02 github-actions[bot]

Hi @atoulme, could you please guide me on what's needed to merge this PR? I'm afraid it will be closed in 14 days otherwise due to being stale. Thanks!

ycombinator avatar Feb 28 '24 17:02 ycombinator

Hi @atoulme, could you please guide me on what's needed to merge this PR? I'm afraid it will be closed in 14 days otherwise due to being stale. Thanks!

you ask for review by pinging approvers. I'm not an approver. You can participate in the SIG meeting as well, which is happening right now, to ask for review.

atoulme avatar Feb 28 '24 17:02 atoulme

you ask for review by pinging approvers.

Pinging @Aneurysm9, @djaglowski, @jpkrohling for review. Thanks!

ycombinator avatar Mar 05 '24 17:03 ycombinator

Hi @djaglowski, @bogdandrutu, @sfc-gh-bdrutu, is there any more work needed on this PR? Thanks!

ycombinator avatar Mar 19 '24 22:03 ycombinator

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Apr 09 '24 03:04 github-actions[bot]

@codeboten @bogdandrutu @dmitryax @mx-psi Would one of you have some time to review this PR and merge it if it's ready, please? It's been open for nearly three months now. Thank you!

ycombinator avatar Apr 09 '24 06:04 ycombinator