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 ingoing and outgoing counts to processorhelper #10910

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

djaglowski
Copy link
Member

Description

Implements ingoing and outgoing counts as described in #10708.

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 92.20779% with 6 lines in your changes missing coverage. Please review.

Project coverage is 92.21%. Comparing base (35024cf) to head (96867af).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
processor/processorhelper/logs.go 77.77% 1 Missing and 1 partial ⚠️
processor/processorhelper/metrics.go 77.77% 1 Missing and 1 partial ⚠️
processor/processorhelper/traces.go 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10910      +/-   ##
==========================================
- Coverage   92.21%   92.21%   -0.01%     
==========================================
  Files         414      414              
  Lines       19718    19792      +74     
==========================================
+ Hits        18183    18251      +68     
- Misses       1165     1168       +3     
- Partials      370      373       +3     

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

@djaglowski djaglowski force-pushed the processor-helper-metrics branch from 259cf00 to f574d98 Compare August 19, 2024 19:37
@djaglowski djaglowski marked this pull request as ready for review August 19, 2024 22:20
@djaglowski djaglowski requested review from a team and TylerHelmuth August 19, 2024 22:20
@djaglowski
Copy link
Member Author

Any thoughts on this, @open-telemetry/collector-contrib-approvers?

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.

Thanks @djaglowski, this looks good overall, just one question around setting the meter provider

@@ -39,12 +40,25 @@ func NewLogsProcessor(
return nil, errors.New("nil logsFunc")
}

if set.MeterProvider == nil {
set.MeterProvider = noop.NewMeterProvider()
Copy link
Contributor

Choose a reason for hiding this comment

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

i wouldn't expect this to be needed here, can you confirm whether it is?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, it was a problem with a particular test, not something that needs to be addressed here.

@@ -39,12 +40,25 @@ func NewMetricsProcessor(
return nil, errors.New("nil metricsFunc")
}

if set.MeterProvider == nil {
set.MeterProvider = noop.NewMeterProvider()
Copy link
Contributor

Choose a reason for hiding this comment

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

same question as above

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed for all three signals.

processor/processorhelper/metrics_test.go Outdated Show resolved Hide resolved
processor/processorhelper/traces_test.go Outdated Show resolved Hide resolved
@djaglowski djaglowski force-pushed the processor-helper-metrics branch from f574d98 to 4421a21 Compare September 6, 2024 18:58
Copy link
Member Author

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

I've rebased and resolved the conflict.

@@ -39,12 +40,25 @@ func NewLogsProcessor(
return nil, errors.New("nil logsFunc")
}

if set.MeterProvider == nil {
set.MeterProvider = noop.NewMeterProvider()
Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, it was a problem with a particular test, not something that needs to be addressed here.

@djaglowski
Copy link
Member Author

A contrib test failed, but I think it expected with this change:

=== Failed
=== FAIL: . TestFilterMetricProcessorTelemetry (0.00s)
make[3]: *** [../../Makefile.Common:128: test] Error 1
    generated_component_telemetry_test.go:55: 
        	Error Trace:	/tmp/opentelemetry-collector-contrib/processor/filterprocessor/generated_component_telemetry_test.go:55
        	            				/tmp/opentelemetry-collector-contrib/processor/filterprocessor/metrics_test.go:423
        	Error:      	Not equal: 
make[2]: *** [Makefile:187: processor/filterprocessor] Error 2
make[1]: *** [Makefile:127: gotest] Error 2
make: *** [Makefile:260: check-contrib] Error 2
        	            	expected: 1
        	            	actual  : 3
        	Test:       	TestFilterMetricProcessorTelemetry

=== FAIL: . TestFilterMetricProcessorTelemetry (re-run 1) (0.00s)
    generated_component_telemetry_test.go:55: 
        	Error Trace:	/tmp/opentelemetry-collector-contrib/processor/filterprocessor/generated_component_telemetry_test.go:55
        	            				/tmp/opentelemetry-collector-contrib/processor/filterprocessor/metrics_test.go:423
        	Error:      	Not equal: 
        	            	expected: 1
        	            	actual  : 3
        	Test:       	TestFilterMetricProcessorTelemetry

@codeboten
Copy link
Contributor

A contrib test failed, but I think it expected with this change:

=== Failed
=== FAIL: . TestFilterMetricProcessorTelemetry (0.00s)
make[3]: *** [../../Makefile.Common:128: test] Error 1
    generated_component_telemetry_test.go:55: 
        	Error Trace:	/tmp/opentelemetry-collector-contrib/processor/filterprocessor/generated_component_telemetry_test.go:55
        	            				/tmp/opentelemetry-collector-contrib/processor/filterprocessor/metrics_test.go:423
        	Error:      	Not equal: 
make[2]: *** [Makefile:187: processor/filterprocessor] Error 2
make[1]: *** [Makefile:127: gotest] Error 2
make: *** [Makefile:260: check-contrib] Error 2
        	            	expected: 1
        	            	actual  : 3
        	Test:       	TestFilterMetricProcessorTelemetry

=== FAIL: . TestFilterMetricProcessorTelemetry (re-run 1) (0.00s)
    generated_component_telemetry_test.go:55: 
        	Error Trace:	/tmp/opentelemetry-collector-contrib/processor/filterprocessor/generated_component_telemetry_test.go:55
        	            				/tmp/opentelemetry-collector-contrib/processor/filterprocessor/metrics_test.go:423
        	Error:      	Not equal: 
        	            	expected: 1
        	            	actual  : 3
        	Test:       	TestFilterMetricProcessorTelemetry

The test is likely a failure of the new metrics being emitted and the original test not expecting them to be there. Please open a PR to update the test as a follow up

@djaglowski
Copy link
Member Author

Thanks for the review @codeboten. I created open-telemetry/opentelemetry-collector-contrib#35073 to update the contrib test.

dps.AppendEmpty()
dps.AppendEmpty()

metricReader := sdkmetric.NewManualReader()
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the test code here use the generated test code? Can be done in a follow up PR

@codeboten codeboten merged commit fa34718 into open-telemetry:main Sep 9, 2024
47 of 49 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 9, 2024
codeboten added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Sep 9, 2024
…35073)

This updates collector modules and fixes a test that was broken by
open-telemetry/opentelemetry-collector#10910

---------

Signed-off-by: Dan Jaglowski <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Co-authored-by: Alex Boten <[email protected]>
dmathieu pushed a commit to dmathieu/opentelemetry-collector that referenced this pull request Sep 10, 2024
)

#### Description

Implements ingoing and outgoing counts as described in
open-telemetry#10708.
@djaglowski djaglowski deleted the processor-helper-metrics branch September 10, 2024 15:55
bogdandrutu pushed a commit that referenced this pull request Sep 10, 2024
Follow up for
#10910 (comment),
ping @djaglowski as the author of the PR

Signed-off-by: Alex Boten <[email protected]>
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
…pen-telemetry#35073)

This updates collector modules and fixes a test that was broken by
open-telemetry/opentelemetry-collector#10910

---------

Signed-off-by: Dan Jaglowski <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Co-authored-by: Alex Boten <[email protected]>
bogdandrutu added a commit that referenced this pull request Oct 4, 2024
…s Undefined Behavior (#11349)

The main issue is that after
#10910 the
err variable is shared between requests because it uses the same address
as the err defined outside the func.

This is an UB because we are overwriting memory and will cause crashes
like
#11335,
where the check for not nil happens then gets overwrite with nil and
crashes.

Fixes
#11350

---------

Signed-off-by: Bogdan Drutu <[email protected]>
jriguera pushed a commit to springernature/opentelemetry-collector-contrib that referenced this pull request Oct 4, 2024
…pen-telemetry#35073)

This updates collector modules and fixes a test that was broken by
open-telemetry/opentelemetry-collector#10910

---------

Signed-off-by: Dan Jaglowski <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Co-authored-by: Alex Boten <[email protected]>
jackgopack4 pushed a commit to jackgopack4/opentelemetry-collector that referenced this pull request Oct 8, 2024
…s Undefined Behavior (open-telemetry#11349)

The main issue is that after
open-telemetry#10910 the
err variable is shared between requests because it uses the same address
as the err defined outside the func.

This is an UB because we are overwriting memory and will cause crashes
like
open-telemetry#11335,
where the check for not nil happens then gets overwrite with nil and
crashes.

Fixes
open-telemetry#11350

---------

Signed-off-by: Bogdan Drutu <[email protected]>
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this pull request Dec 19, 2024
…s Undefined Behavior (open-telemetry#11349)

The main issue is that after
open-telemetry#10910 the
err variable is shared between requests because it uses the same address
as the err defined outside the func.

This is an UB because we are overwriting memory and will cause crashes
like
open-telemetry#11335,
where the check for not nil happens then gets overwrite with nil and
crashes.

Fixes
open-telemetry#11350

---------

Signed-off-by: Bogdan Drutu <[email protected]>
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