[9.1](backport #47299) [beatreceiver] only add default processors if running under agent #47413
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Proposed commit message
We're injecting default processors while running in standalone beatreceivers. This is not the case in standalone beats.
We should inject only if we're running under agent (Fixed via #46539).
Benchmarks shows improvement and are close to normal mode. There is still some difference and I'll work on that as a follow-up.
Checklist
./changelog/fragmentsusing the changelog tool.How to test this PR locally
You can test the build from this PR with benchbuilder and compare the results without the changes of this PR.
Related issues
Results