-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 processor helper. In the future add metrics and tracing #1359
Add processor helper. In the future add metrics and tracing #1359
Conversation
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.
Overall I think this makes the process of creating components more straightforward, so happy to approve. I have a few suggestions to consider.
@@ -28,6 +28,8 @@ const ( | |||
typeStr = "filter" | |||
) | |||
|
|||
var processorCapabilities = component.ProcessorCapabilities{MutatesConsumedData: false} | |||
|
|||
// NewFactory returns a new factory for the Filter processor. | |||
func NewFactory() component.ProcessorFactory { | |||
return processorhelper.NewFactory( |
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.
Instead of:
processorhelper.WithMetrics(createMetricsProcessor)
Would it make sense to consider working towards:
processorhelper.WithMetrics(filterMetrics, processorhelper.WithCapabilities(processorCapabilities))
And eventually remove the need for processorhelper/processor.go
.
Not sure if that's feasible given the rest of the startup code & need for backwards compatibilty.
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.
I will think about, but seems hard to cover all the cases:
- Somewhere you need a new instance of the underlying processor that is wrapped so there needs to be a function that does what the current create does before calling into the new helper.
- Capabilities may differ based on the config or params (things that are passed during create method). I know we don't do that now but it is a possibility.
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package processorhelper |
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.
How about moving this up a level and making this just e.g. processor.NewTraceProcessor
to signify this is the first class way that components should be created?
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.
I can do that in a follow-up.
6e20722
to
4bb1f60
Compare
4bb1f60
to
1d015b5
Compare
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
1d015b5
to
7a36529
Compare
Codecov Report
@@ Coverage Diff @@
## master #1359 +/- ##
==========================================
+ Coverage 90.11% 90.28% +0.16%
==========================================
Files 217 218 +1
Lines 15242 15299 +57
==========================================
+ Hits 13736 13813 +77
+ Misses 1096 1076 -20
Partials 410 410
Continue to review full report at Codecov.
|
And update .gitignore, so the built binary does not show up in git status.
* Update smart agent deps * Update smart agent bundle to 5.19.1 * Update changelog
No description provided.