Skip to content

Testing changes from collector-core#12825 #39446

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

Closed

Conversation

ArthurSens
Copy link
Member

This PR's intention is only to test changes made by open-telemetry/opentelemetry-collector#12825

I've added a test that only passes if I add the replace directives, which proves it works :)
Without them, the test fails with:

--- FAIL: TestSnappyCompression (0.01s)
    --- FAIL: TestSnappyCompression/request_0 (0.00s)
        /Users/arthursens/Documents/projetos/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:477: 
            	Error Trace:	/Users/arthursens/Documents/projetos/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:477
            	Error:      	Not equal: 
            	            	expected: 204
            	            	actual  : 400
            	Test:       	TestSnappyCompression/request_0
        /Users/arthursens/Documents/projetos/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:478: snappy: corrupt input
            
    --- FAIL: TestSnappyCompression/request_1 (0.00s)
        /Users/arthursens/Documents/projetos/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:477: 
            	Error Trace:	/Users/arthursens/Documents/projetos/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:477
            	Error:      	Not equal: 
            	            	expected: 204
            	            	actual  : 400
            	Test:       	TestSnappyCompression/request_1
        /Users/arthursens/Documents/projetos/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:478: snappy: corrupt input
            
FAIL
FAIL	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver	0.370s

I've also done some manual testing, by building the collector with the remotewrite receiver and also with the replace directives. The error I used to see in Prometheus before this change:

time=2025-04-15T21:25:13.165Z level=ERROR source=queue_manager.go:1670 msg="non-recoverable error" component=remote remote_name=2757a8 url=http://localhost:9091/api/v1/write failedSampleCount=563 failedHistogramCount=0 failedExemplarCount=0 err="server returned HTTP status 400 Bad Request: snappy: corrupt input\n"

Has been replaced with a new error 🥳

time=2025-04-15T21:30:56.747Z level=ERROR source=queue_manager.go:1670 msg="non-recoverable error" component=remote remote_name=2757a8 url=http://localhost:9091/api/v1/write failedSampleCount=563 failedHistogramCount=0 failedExemplarCount=0 err="server returned HTTP status 400 Bad Request: unsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_cycles_automatic_gc_cycles_total\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_cycles_forced_gc_cycles_total\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_cycles_total_gc_cycles_total\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_duration_seconds\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_duration_seconds\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_duration_seconds\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_duration_seconds\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_duration_seconds\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_duration_seconds_sum\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_duration_seconds_count\"\nunsupported metric type \"METRIC_TYPE_UNSPECIFIED\" for metric \"go_gc_gogc_percent\"\nunsupported metric type \"METRIC"

Things are still not 100% correct, but at least snappy decoding is not a problem anymore :)

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 Apr 30, 2025
@ArthurSens
Copy link
Member Author

Closing, the problem was fixed in open-telemetry/opentelemetry-collector#12911

@ArthurSens ArthurSens closed this May 7, 2025
@ArthurSens ArthurSens deleted the test-collector-core#12825 branch May 7, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant