Skip to content

Conversation

mauri870
Copy link
Member

Proposed commit message

Currently default processors are only applied under fleet management. Enable default processors for beats when running under OTel receiver mode.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@mauri870 mauri870 added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team bugfix backport-8.x Automated backport to the 8.x branch with mergify backport-9.0 Automated backport to the 9.0 branch labels Feb 10, 2025
@mauri870 mauri870 added this to the otel milestone Feb 10, 2025
@mauri870 mauri870 self-assigned this Feb 10, 2025
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Feb 10, 2025
@mauri870 mauri870 force-pushed the fbreceiver-default-processors branch from e1456a5 to c1bb6e1 Compare February 10, 2025 16:25
@mauri870 mauri870 marked this pull request as ready for review February 10, 2025 16:58
@mauri870 mauri870 requested a review from a team as a code owner February 10, 2025 16:58
@mauri870 mauri870 requested review from faec and leehinman February 10, 2025 16:58
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

Copy link
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely fixes the immediate issue.

Longer term though, I'm not sure if we want to always assume that a Beat Receiver will use the default processors.

Maybe change it so that we look at something in the config passed to NewBeatReceiver, and set a field called "UseDefaultProcessors" accordingly in Info. Would need to be before

processingFactory := settings.Processing
But that would let us eventually change if the Default Processors are used based off a config setting.

What do you think?

@mauri870 mauri870 marked this pull request as draft February 11, 2025 14:55
@mauri870
Copy link
Member Author

Thanks, makes total sense. I'll make the necessary changes.

@mauri870 mauri870 marked this pull request as ready for review February 12, 2025 12:39
@mauri870 mauri870 requested a review from leehinman February 12, 2025 12:39
@mauri870 mauri870 force-pushed the fbreceiver-default-processors branch from aa7be28 to 061af6b Compare February 12, 2025 12:41

// NewBeatReceiver creates a Beat that will be used in the context of an otel receiver
func NewBeatReceiver(settings Settings, receiverConfig map[string]interface{}, consumer consumer.Logs, core zapcore.Core) (*Beat, error) {
func NewBeatReceiver(settings Settings, receiverConfig map[string]interface{}, useDefaultProcessors bool, consumer consumer.Logs, core zapcore.Core) (*Beat, error) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the option inside receiverConfig is also possible, but it only contains the Beats configuration, so I'd have to remove the key from the map. Being explicit here seems more appropriate.

Copy link
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank You.

@mauri870 mauri870 merged commit d813311 into elastic:main Feb 14, 2025
142 checks passed
mergify bot pushed a commit that referenced this pull request Feb 14, 2025
* fix(otel): ensure default processors are applied in fbreceiver

* set default processors in NewBeatReceiver

(cherry picked from commit d813311)
mergify bot pushed a commit that referenced this pull request Feb 14, 2025
* fix(otel): ensure default processors are applied in fbreceiver

* set default processors in NewBeatReceiver

(cherry picked from commit d813311)
mauri870 added a commit that referenced this pull request Feb 14, 2025
… (#42713)

* fix(otel): ensure default processors are applied in fbreceiver

* set default processors in NewBeatReceiver

(cherry picked from commit d813311)

Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
mauri870 added a commit that referenced this pull request Feb 14, 2025
… (#42712)

* fix(otel): ensure default processors are applied in fbreceiver

* set default processors in NewBeatReceiver

(cherry picked from commit d813311)

Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-9.0 Automated backport to the 9.0 branch bugfix Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fbreceiver] Default Processors are not being applied
3 participants