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

Standarize Settings instead of Params and Parameters #2991

Conversation

pmatyjasek-sumo
Copy link
Contributor

A proposal solution of standarize constructors parameters

Description:
Fixes #2650
Changes:
Replace: ReceiverCreateParams, ProcessorCreateParams, ExtensionCreateParams and ExporterCreateParams with ComponentSettings struct
Replace all dependencies in Extensions, Exporters, Processors and Receivers
Replace Parameters and settings structs with new struct Settings
Replace dependencies in service and main
Update tests

Signed-off-by: Patryk Matyjasek pmatyjasek@sumologic.com

Link to tracking Issue:
#2650

Testing: < Describe what testing was performed and which tests were added.>
UT

Documentation: < Describe the documentation added.>
In code comments

@pmatyjasek-sumo
Copy link
Contributor Author

@bogdandrutu @tigrannajaryan please take a look for this proposal

@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #2991 (2aa2886) into main (73b55f0) will decrease coverage by 0.41%.
The diff coverage is 97.64%.

❗ Current head 2aa2886 differs from pull request most recent head 44f32bb. Consider uploading reports for the commit 44f32bb to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2991      +/-   ##
==========================================
- Coverage   92.06%   91.65%   -0.42%     
==========================================
  Files         313      312       -1     
  Lines       15439    15428      -11     
==========================================
- Hits        14214    14140      -74     
- Misses        817      881      +64     
+ Partials      408      407       -1     
Impacted Files Coverage Δ
component/componenttest/nop_exporter.go 100.00% <ø> (ø)
component/componenttest/nop_extension.go 100.00% <ø> (ø)
component/componenttest/nop_processor.go 100.00% <ø> (ø)
component/componenttest/nop_receiver.go 100.00% <ø> (ø)
component/processor.go 100.00% <ø> (ø)
exporter/fileexporter/factory.go 100.00% <ø> (ø)
exporter/loggingexporter/factory.go 73.68% <ø> (ø)
internal/testcomponents/example_exporter.go 100.00% <ø> (ø)
internal/testcomponents/example_extension.go 88.88% <ø> (ø)
internal/testcomponents/example_processor.go 92.85% <ø> (ø)
... and 60 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51661b8...44f32bb. Read the comment docs.

@pmatyjasek-sumo pmatyjasek-sumo force-pushed the pm_standarize_constructor_settings branch 2 times, most recently from 2aa2886 to 72ef9d6 Compare April 28, 2021 08:28
@pmatyjasek-sumo pmatyjasek-sumo marked this pull request as ready for review April 29, 2021 15:02
@pmatyjasek-sumo pmatyjasek-sumo requested a review from a team April 29, 2021 15:02
Fixes open-telemetry#2650
Changes:
 Replace: ReceiverCreateParams, ProcessorCreateParams, ExtensionCreateParams and ExporterCreateParams with ComponentSettings struct
 Replace all dependencies in Extensions, Exporters, Processors and Receivers
 Replace Parameters and settings structs with new struct Settings
 Replace dependencies in service and main
 Update tests

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

# Conflicts:
#	exporter/kafkaexporter/factory.go
#	exporter/kafkaexporter/factory_test.go
#	exporter/kafkaexporter/kafka_exporter.go
#	exporter/kafkaexporter/kafka_exporter_test.go
#	exporter/prometheusexporter/factory.go
#	receiver/jaegerreceiver/jaeger_agent_test.go
#	receiver/jaegerreceiver/trace_receiver_test.go
#	receiver/kafkareceiver/factory.go
#	receiver/kafkareceiver/factory_test.go
#	receiver/kafkareceiver/kafka_receiver.go
#	receiver/kafkareceiver/kafka_receiver_test.go

# Conflicts:
#	processor/batchprocessor/batch_processor.go
#	processor/batchprocessor/batch_processor_test.go
#	processor/batchprocessor/factory.go
#	processor/filterprocessor/filter_processor_test.go
#	service/application.go

# Conflicts:
#	cmd/otelcol/main.go
#	component/component.go
#	component/exporter.go
#	component/extension.go
#	component/processor.go
#	component/processor_test.go
#	component/receiver.go
#	exporter/exporterhelper/factory_test.go
#	extension/extensionhelper/factory_test.go
#	processor/batchprocessor/batch_processor.go
#	processor/processorhelper/factory_test.go
#	receiver/jaegerreceiver/factory.go
#	receiver/jaegerreceiver/trace_receiver_test.go
#	receiver/otlpreceiver/factory.go
#	receiver/prometheusreceiver/factory.go
#	receiver/receiverhelper/factory_test.go
#	service/application.go
#	service/application_test.go
#	service/defaultcomponents/default_exporters_test.go
#	service/defaultcomponents/default_extensions_test.go
#	service/defaultcomponents/default_processors_test.go
#	service/defaultcomponents/default_receivers_test.go
#	service/internal/builder/exporters_builder.go
#	service/internal/builder/extensions_builder.go
#	service/internal/builder/pipelines_builder.go
#	service/internal/builder/receivers_builder.go
#	service/service.go
#	service/service_test.go
#	testbed/testbed/otelcol_runner.go
Fix Windows building

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

# Conflicts:
#	CHANGELOG.md
Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

I like the direction, we should probably start by doing smaller PRs, like changing the service package initially.

@pmatyjasek-sumo
Copy link
Contributor Author

Thanks @bogdandrutu for the response. I'll split it into smaller PRs.

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2021

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

@github-actions github-actions bot added the Stale label Jun 1, 2021
@bogdandrutu bogdandrutu removed the Stale label Jun 7, 2021
@bogdandrutu
Copy link
Member

@pmatyjasek-sumo is this PR still useful?

@pmatyjasek-sumo
Copy link
Contributor Author

No. I'm closing it

hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
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.

Standardize on params vs settings vs options
2 participants