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 processor helper. In the future add metrics and tracing #1359

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

bogdandrutu
Copy link
Member

No description provided.

Copy link
Member

@james-bebbington james-bebbington left a 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.

processor/filterprocessor/factory.go Outdated Show resolved Hide resolved
@@ -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(
Copy link
Member

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.

Copy link
Member Author

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:

  1. 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.
  2. 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
Copy link
Member

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?

Copy link
Member Author

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.

@bogdandrutu bogdandrutu force-pushed the processorhelper branch 4 times, most recently from 6e20722 to 4bb1f60 Compare July 15, 2020 18:17
@bogdandrutu bogdandrutu removed WIP discussion-needed Community discussion needed labels Jul 15, 2020
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #1359 into master will increase coverage by 0.16%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
processor/attributesprocessor/attributes.go 94.11% <100.00%> (-1.34%) ⬇️
processor/attributesprocessor/factory.go 86.20% <100.00%> (+2.20%) ⬆️
processor/filterprocessor/factory.go 100.00% <100.00%> (ø)
processor/filterprocessor/filter_processor.go 94.73% <100.00%> (-1.01%) ⬇️
processor/memorylimiter/factory.go 100.00% <100.00%> (ø)
processor/memorylimiter/memorylimiter.go 90.90% <100.00%> (+3.26%) ⬆️
processor/processorhelper/processor.go 100.00% <100.00%> (ø)
processor/resourceprocessor/factory.go 100.00% <100.00%> (ø)
processor/resourceprocessor/resource_processor.go 100.00% <100.00%> (+25.00%) ⬆️
processor/spanprocessor/factory.go 100.00% <100.00%> (ø)
... and 2 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 2ba9cdc...7a36529. Read the comment docs.

@bogdandrutu bogdandrutu merged commit afc4796 into open-telemetry:master Jul 15, 2020
@bogdandrutu bogdandrutu deleted the processorhelper branch July 15, 2020 19:26
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
And update .gitignore, so the built binary does not show up in git
status.
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
* Update smart agent deps

* Update smart agent bundle to 5.19.1

* Update changelog
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.

2 participants