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

Upgrade azure-eventhub to input v2 API #39511

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

zmoog
Copy link
Contributor

@zmoog zmoog commented May 10, 2024

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:

  • Renames the azureInput to eventHubInputV1 because I want to continue offering the legacy SDK while we introduce an eventHubInputV2 with the modern event hub SDK in the next PR. The eventHubInputManager will select the input version depending on the configuration.
  • Switches the pipeline publishing process from Outlet (input v1) to PipelineClient (input v2).
  • Starts the EPH and stops it when the input context is "done".
  • Rename parseMultipleMessages() to unpackRecords() 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

  • 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.

Disruptive User Impact

Author's Checklist

  • Test reload configuration

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 10, 2024
@mergify mergify bot assigned zmoog May 10, 2024
Copy link
Contributor

mergify bot commented May 10, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @zmoog? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@zmoog zmoog changed the title Upgrade azure-eventhub to input v2 API [WIP] Upgrade azure-eventhub to input v2 API May 10, 2024
@zmoog zmoog added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label May 10, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 10, 2024
@zmoog zmoog force-pushed the zmoog/azure-eventhub-to-input-api-v2 branch from 5e9d1fd to 025e137 Compare May 16, 2024 14:42
@zmoog zmoog force-pushed the zmoog/azure-eventhub-to-input-api-v2 branch from 025e137 to 62b90b3 Compare May 20, 2024 08:39
@zmoog zmoog changed the title [WIP] Upgrade azure-eventhub to input v2 API Upgrade azure-eventhub to input v2 API May 20, 2024
zmoog added 5 commits May 21, 2024 13:31
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.
@zmoog zmoog marked this pull request as ready for review May 22, 2024 08:29
@zmoog zmoog requested review from a team as code owners May 22, 2024 08:29
@zmoog zmoog requested a review from a team as a code owner May 22, 2024 08:29
@zmoog zmoog requested review from belimawr and leehinman May 22, 2024 08:29
@elasticmachine
Copy link
Collaborator

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@zmoog zmoog requested a review from faec May 22, 2024 09:39
Copy link
Contributor

@belimawr belimawr left a 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.

x-pack/filebeat/input/azureeventhub/v1_input_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

mergify bot commented May 24, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b zmoog/azure-eventhub-to-input-api-v2 upstream/zmoog/azure-eventhub-to-input-api-v2
git merge upstream/main
git push upstream zmoog/azure-eventhub-to-input-api-v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Azure] Upgrade azure-eventhub to Input API v2
3 participants