-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[component] Refactor to use pipeline.ID and pipeline.Signal #11204
base: main
Are you sure you want to change the base?
[component] Refactor to use pipeline.ID and pipeline.Signal #11204
Conversation
fe90c10
to
1225ae3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11204 +/- ##
==========================================
- Coverage 91.80% 91.41% -0.39%
==========================================
Files 424 424
Lines 20094 20198 +104
==========================================
+ Hits 18447 18465 +18
- Misses 1268 1349 +81
- Partials 379 384 +5 ☔ View full report in Codecov by Sentry. |
1225ae3
to
3a776d6
Compare
#### Description To facilitate the work in #11204 as some breaking changes and some deprecations, this PR adds the new pipeline module separately so that future PRs can handle the breaking changes and deprecations. In order to make `Signal` uninstantiable outside of this repo, while still being extendable in places like `componentprofiles`, a new internal module is added to handle the `Signal` logic. To reduce the dependency sprawl that would happen if `signal` was an internal package in `go.opentelemetry.io/collector`, I made it a module, similar to `globalgates`. <!-- Issue number if applicable --> #### Link to tracking issue Related to #10947 <!--Describe what testing was performed and which tests were added.--> #### Testing Added unit tests <!--Describe the documentation added.--> #### Documentation Added godoc comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than fixing the merge conflicts, this looks good to me
@@ -153,5 +154,41 @@ func (cfg *Config) Validate() error { | |||
return fmt.Errorf("service::pipelines::%s: references exporter %q which is not configured", pipelineID, ref) | |||
} | |||
} | |||
|
|||
// Check that all pipelines reference only configured components. | |||
for pipelineID, pipeline := range cfg.Service.PipelinesWithPipelineID { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need a second for loop here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate of the for pipelineID, pipeline := range cfg.Service.Pipelines {
loop above it.
I didn't want to handle the merging of cfg.Service.Pipelines
into cfg.Service.PipelinesWithPipelineID
via the Validate function (it is instead handled in service.initGraph
) so I instead opted to validate both cfg.Service.Pipelines
and cfg.Service.PipelinesWithPipelineID
.
The line above, if err := cfg.Service.Validate(); err != nil
, will validate that only one of the 2 is set, so in reality only one of the two for loops is ever entered.
Description
Depends on #11209
This PR is a non-breaking implementation of #10947. It adds a new module,
pipeline
, which houses apipeline.ID
andpipeline.Signal
.pipeline.ID
is used to identify a pipeline within the service.pipeline.Signal
is uses to identify the signal associated to a pipeline.I do this work begrudgingly. As the PR shows, this is a huge refactor when done in a non-breaking way, will require 3 full releases, and doesn't benefit our End Users or, in my opinion, our Component Developers or Collector Library Users. I view this refactor as a Nice-To-Have, not a requirement for Component 1.0.
Link to tracking issue
Works towards #9429