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

[chore] migrate receiver/* to use errors.Join #8225

Closed

Conversation

shivanshuraj1333
Copy link
Member

Part of: #8210

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Is there a way to override how errors.Join outputs the errors? Looking at https://github.com/open-telemetry/opentelemetry-collector/actions/runs/5852149629/job/15867545790?pr=8225#step:6:243, it looks like the output will be changed:

--- FAIL: TestScrapeErrorsCombine (0.00s)
    scrapeerror_test.go:95: 
        	Error Trace:	/home/runner/work/opentelemetry-collector/opentelemetry-collector/receiver/scrapererror/scrapeerror_test.go:95
        	Error:      	Error message not equal:
        	            	expected: "bad scrapes; err: bad scrape"
        	            	actual  : "bad scrapes\nerr: bad scrape"
        	Test:       	TestScrapeErrorsCombine
    scrapeerror_test.go:95: 
        	Error Trace:	/home/runner/work/opentelemetry-collector/opentelemetry-collector/receiver/scrapererror/scrapeerror_test.go:95
        	Error:      	Error message not equal:
        	            	expected: "bad regular; err: bad reg"
        	            	actual  : "bad regular\nerr: bad reg"
        	Test:       	TestScrapeErrorsCombine
    scrapeerror_test.go:95: 
        	Error Trace:	/home/runner/work/opentelemetry-collector/opentelemetry-collector/receiver/scrapererror/scrapeerror_test.go:95
        	Error:      	Error message not equal:
        	            	expected: "bad two scrapes; 10 scrapes failed: bad things happened; bad event; event: something happened"
        	            	actual  : "bad two scrapes\n10 scrapes failed: bad things happened\nbad event\nevent: something happened"
        	Test:       	TestScrapeErrorsCombine
FAIL

@seankhliao
Copy link
Contributor

errors.Join doesn't offer any direct control over the output format, it was decided that there are too many opinions to easily support and instead errors.Join should remain opinionated.

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Seems like you need to update some tests since errors are now separated by \n instead of ; and we can't control the output format

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the Stale label Sep 16, 2023
@github-actions
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Sep 30, 2023
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 this pull request may close these issues.

5 participants