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

[cmd/mdatagen] optimize mdatagen for batchprocessor failed test #9768

Merged

Conversation

fatsheep9146
Copy link
Contributor

@fatsheep9146 fatsheep9146 commented Mar 15, 2024

Description:
fix #9688

The batchprocessor use a batchProcessor as a common struct which implements consumer.Traces, consumer.Metrics, consumer.Logs in the meantime.

As a result, the generated lifecycle test will fail, since when it create a metrics, traces processor object, it will still fall to the case consumer.Logs and panic.

=== RUN   TestComponentLifecycle/metrics-shutdown
=== RUN   TestComponentLifecycle/metrics-lifecycle
panic: interface conversion: interface {} is plog.Logs, not pmetric.Metrics

goroutine 37 [running]:
go.opentelemetry.io/collector/processor/batchprocessor.(*batchMetrics).add(0x14000208120?, {0x10572aae0?, 0x1400029c3f0?})
	/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:450 +0x208
go.opentelemetry.io/collector/processor/batchprocessor.(*shard).processItem(0x14000292200, {0x10572aae0?, 0x1400029c3f0?})
	/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:226 +0x38
go.opentelemetry.io/collector/processor/batchprocessor.(*shard).start(0x14000292200)
	/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:199 +0x1a0
created by go.opentelemetry.io/collector/processor/batchprocessor.(*batchProcessor).newShard in goroutine 36
	/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:160 +0x1a4
exit status 2
FAIL	go.opentelemetry.io/collector/processor/batchprocessor	0.594s

Link to tracking Issue:
fix #9688

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
@fatsheep9146 fatsheep9146 requested a review from a team as a code owner March 15, 2024 05:50
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.98%. Comparing base (ef9caab) to head (78da03c).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9768      +/-   ##
==========================================
+ Coverage   90.96%   90.98%   +0.02%     
==========================================
  Files         353      353              
  Lines       18630    18621       -9     
==========================================
- Hits        16947    16943       -4     
+ Misses       1356     1352       -4     
+ Partials      327      326       -1     

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

@dmitryax dmitryax merged commit ae29878 into open-telemetry:main Mar 15, 2024
46 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 15, 2024
@dmitryax
Copy link
Member

Thanks @fatsheep9146! Can you please update contrib as well?

@fatsheep9146
Copy link
Contributor Author

fatsheep9146 commented Mar 15, 2024

Thanks @fatsheep9146! Can you please update contrib as well?

No problem! I will do this ASAP. @dmitryax

@fatsheep9146
Copy link
Contributor Author

Thanks @fatsheep9146! Can you please update contrib as well?

@dmitryax Contrib will be updated by open-telemetry/opentelemetry-collector-contrib#31778

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.

lifecycle tests: batch processor fix failing test
2 participants