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

If filterprocessor filters all data, stop further processing #1500

Merged

Conversation

anniefu
Copy link
Contributor

@anniefu anniefu commented Aug 5, 2020

Description:
Add a sentinel error to processhelper package that can be returned by other processors to indicate that the incoming batch of metrics data has been determined to be irrelevant and should be skipped for any further processing. If skipped, processhelper will nullify the sentinel error and return nil.

Have the filterprocessor return the sentinel error if all metrics are filtered out by the filters. This prevents any further unnecessary processing and exporting of the empty metrics data.

Link to tracking Issue: #1491

Testing: Unit tests

Documentation: N/A, no user-facing changes to fix big (though I did fix some typos in existing doc).

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 5, 2020

CLA Check
The committers are authorized under a signed CLA.

@project-bot project-bot bot added this to In progress in Collector Aug 5, 2020
@codecov
Copy link

codecov bot commented Aug 5, 2020

Codecov Report

Merging #1500 into master will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1500      +/-   ##
==========================================
+ Coverage   90.98%   91.02%   +0.03%     
==========================================
  Files         239      239              
  Lines       16744    16750       +6     
==========================================
+ Hits        15235    15247      +12     
+ Misses       1080     1077       -3     
+ Partials      429      426       -3     
Impacted Files Coverage Δ
processor/filterprocessor/filter_processor.go 95.23% <100.00%> (+0.50%) ⬆️
processor/processorhelper/processor.go 100.00% <100.00%> (ø)
receiver/otlpreceiver/otlp.go 94.44% <0.00%> (+2.77%) ⬆️
translator/internaldata/resource_to_oc.go 87.50% <0.00%> (+4.16%) ⬆️

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 8af0a90...4766920. Read the comment docs.

@anniefu
Copy link
Contributor Author

anniefu commented Aug 5, 2020

@bogdandrutu, @james-bebbington please review when you get a chance, thanks!

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.

LGTM. Not required for this PR but it would be good to use obsreport in this processor at some point to report on how much data is filtered out.

Collector automation moved this from In progress to Reviewer approved Aug 13, 2020
@anniefu
Copy link
Contributor Author

anniefu commented Aug 13, 2020

@bogdandrutu could you take a look when you get a minute? Thanks!

@anniefu
Copy link
Contributor Author

anniefu commented Aug 13, 2020

LGTM. Not required for this PR but it would be good to use obsreport in this processor at some point to report on how much data is filtered out.

Oh, cool, I was not aware of obsreport, this is a good idea down the line.

@bogdandrutu bogdandrutu merged commit 052b36e into open-telemetry:master Aug 13, 2020
Collector automation moved this from Reviewer approved to Done Aug 13, 2020
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
…n-telemetry#1501)

* Reverse order of attribute precedence when merging two Resources

This reflects a change in the specification itself.
open-telemetry/opentelemetry-specification#1345

* Resolves open-telemetry#1500

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
* Add syslog receiver

* Update components.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Collector
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants