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

fix: Sampling Processor not removing higher level objs #1879

Conversation

dpaasman00
Copy link
Contributor

Proposed Change

While testing the Sampling Processor I noticed that in BindPlane the 'Filter Debug Logs' processor recommendation was being recommended despite no debug logs being present.
Screenshot 2024-09-24 at 11 01 49 AM

After debugging, I discovered this was occurring because this processor only deleted log records, leaving behind the parent scope and resource level objects. This was causing these objects to be initialized with default values when they were technically empty.

This change cleans up these objects if they are effectively empty. So resource spans/metrics/logs are removed if there are no scope entries, and scope spans/metrics/logs are removed if there are no spans/metrics/logRecords present. This successfully removes the filter debug recommendation.
image

To test, add the following replace statements to the transform agent go.mod, and then configure local bindplane to use this build of the transform agent (or just use a remote bta with this build).

replace github.com/observiq/bindplane-agent/processor/samplingprocessor => github.com/observiq/bindplane-agent/processor/samplingprocessor v1.60.1-0.20240925175304-a8f9052d43bf
replace github.com/observiq/bindplane-agent/expr => github.com/observiq/bindplane-agent/expr v1.60.1-0.20240925175304-a8f9052d43bf
Checklist
  • Changes are tested
  • CI has passed

@dpaasman00 dpaasman00 force-pushed the dakotapaasman/bpop-855-filter-debug-logs-recommendation-appearing-when-it-shouldnt branch from d820a7f to 680de41 Compare September 25, 2024 19:46
@dpaasman00 dpaasman00 merged commit a022fea into release/v1.61.0 Sep 26, 2024
15 checks passed
@dpaasman00 dpaasman00 deleted the dakotapaasman/bpop-855-filter-debug-logs-recommendation-appearing-when-it-shouldnt branch September 26, 2024 19:02
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