-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Upgrade azure-eventhub to input v2 API #39511
Upgrade azure-eventhub to input v2 API #39511
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
025e137
to
62b90b3
Compare
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a quick look at the InputV2 API part of the PR and it looks good. I just have a question about an empty file.
This pull request is now in conflicts. Could you fix it? 🙏
|
I cannot comment the lines you did not change, but is there reason to leave this? And again in the test: Is it even possible this condition to be true at all? |
@@ -31,6 +32,7 @@ import ( | |||
func xpackInputs(info beat.Info, log *logp.Logger, store beater.StateStore) []v2.Plugin { | |||
return []v2.Plugin{ | |||
azureblobstorage.Plugin(log, store), | |||
azureeventhub.Plugin(log), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused, what's this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This registers azureeventhub
(using the input plugin v2 API) and makes it available to Filebeat. Previous, the registration was happening using the old API:
beats/x-pack/filebeat/input/azureeventhub/input.go
Lines 35 to 40 in db9406b
func init() { | |
err := input.Register(inputName, NewInput) | |
if err != nil { | |
panic(fmt.Errorf("failed to register %v input: %w", inputName, err)) | |
} | |
} |
Without registration, the plugin is unknown to Filebeat.
This pull request is now in conflicts. Could you fix it? 🙏
|
Your question makes me think I don't fully understand how Can you elaborate on this? Thanks! |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
Indeed, I went to have a look and I think I was confused when I wrote that comment. I was reading the unit tests to understand the code at first and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the go.mod changes
Switch from the v1 Outlet to the v2 PipelineClient
It seems we only need to wait for the context to be done here.
The existing input version does not handle publishing acks from the Beats pipeline. The input API v1 does not seem to offer this feature. With the transition to the input API v2, we have acks management. However, the legacy event hub SDK internally updates the checkpoint info after a successful handler call, and does not seem to offer hooks for acks management. Since the new modern SDK offers better checkpoint management, we keep the current behavior intact, and we'll implement ACKs in the event hub input v2.
Co-authored-by: Tiago Queiroz <[email protected]>
cc1d245
to
b0b04ee
Compare
Registers the `azure-eventhub` input on the Windows platform. During the recent [upgrade](#39511) of the input from the Filebeat input API v1 to input API v2, I missed registering the input for the Windows platform in the `x-pack/filebeat/input/default-inputs/inputs_windows.go` file.
Registers the `azure-eventhub` input on the Windows platform. During the recent [upgrade](#39511) of the input from the Filebeat input API v1 to input API v2, I missed registering the input for the Windows platform in the `x-pack/filebeat/input/default-inputs/inputs_windows.go` file. (cherry picked from commit cc561ff)
Registers the `azure-eventhub` input on the Windows platform. During the recent [upgrade](#39511) of the input from the Filebeat input API v1 to input API v2, I missed registering the input for the Windows platform in the `x-pack/filebeat/input/default-inputs/inputs_windows.go` file. (cherry picked from commit cc561ff) Co-authored-by: Maurizio Branca <[email protected]>
Proposed commit message
Upgrade azure-eventhub to input v2 API.
The input v2 API provides better health status reporting and control. This is a preliminary step in introducing support for the modern Azure Event Hub SDK for Go.
Notes for reviewers
This PR aims to update the azure-eventhub input to the input v2 API without introducing behavior change. The PR is a stepping stone to #33815 (the PR is coming)
Here is a list of changes to keep in mind during the review.
The PR:
azureInput
toeventHubInputV1
because I want to continue offering the legacy SDK while we introduce aneventHubInputV2
with the modern event hub SDK in the next PR. TheeventHubInputManager
will select the input version depending on the configuration.parseMultipleMessages()
tounpackRecords()
because seems to better represent the behavior.Keep existing behavior: Beats pipeline acks
It's important to note that the original input version did not handle publishing ACKs to the Beats pipeline. This was primarily because (AFAIK) the input API v1 did not provide this functionality.
With the transition to the input API v2, we have acks management. However, the legacy event hub SDK internally updates the checkpoint info after a successful handler call and does not seem to offer hooks to plug proper ACK management.
Since the new modern SDK offers better checkpoint management, in this PR, we keep the current behavior intact, and we'll implement ACKs in the event hub input v2.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs