Conversation
|
Cherry-pick of af5d23e has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
🤖 GitHub commentsJust comment with:
|
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
…cessor v2 (#47956) Support for AMQP-over-WebSocket transport in the azure-eventhub processor v2. Enterprise users often need to comply with network restrictions, which means using AMQP may not be an option. In addition to AMQP-over-WebSocket support, this change allows users to run the azure-eventhub input behind an HTTPS proxy. (cherry picked from commit af5d23e) # Conflicts: # x-pack/filebeat/input/azureeventhub/auth.go # x-pack/filebeat/input/azureeventhub/config.go # x-pack/filebeat/input/azureeventhub/v2_input.go # Conflicts: # x-pack/filebeat/input/azureeventhub/auth.go # x-pack/filebeat/input/azureeventhub/config.go # x-pack/filebeat/input/azureeventhub/v2_input.go
13fa47c to
ceff8e8
Compare
|
This pull request has not been merged yet. Could you please review and merge it @zmoog? 🙏 |
|
@zmoog Don't forget this PR please. |
Thanks for the heads up, but I'm not going to forget these PRs: I promised this feature to some users. |
Proposed commit message
Support for AMQP-over-WebSocket transport in the azure-eventhub processor v2.
Enterprise users often need to comply with network restrictions, which means using AMQP may not be an option.
In addition to AMQP-over-WebSocket support, this change allows users to run the azure-eventhub input behind an HTTPS proxy.
Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
No disruptive user impact. The input still defaults to AMQP transport, and unless users switch to WS transport, the behavior is unchanged.
Author's Checklist
How to test this PR locally
I used the following Filebeat config:
Here are a couple of vscode configuration to test the WebSocket-only and WebSocket with HTTPS proxy scenarios (make sure to replace the placeholders
YOUR * GOES HEREwith actual values).WebSocket only
{ "version": "0.2.0", "configurations": [ { "name": "Launch Filebeat", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/x-pack/filebeat/main.go", "args": [ "-e", "-v", "-d", "*", "--strict.perms=false", "--path.home", "${workspaceFolder}/x-pack/filebeat", "-E", "cloud.id=<YOUR CLOUD ID GOES HERE>", "-E", "cloud.auth=<YOUR USERNAME GOES HERE>:<YOUR PASSWORD GOES HERE>", "-E", "gc_percent=100", "-E", "setup.ilm.enabled=false", "-E", "setup.template.enabled=false", "-E", "output.elasticsearch.allow_older_versions=true" ], "env": { "EVENTHUB_NAME": "logs", "EVENTHUB_CONNECTION_STRING": "<YOUR EVENT HUB CONNECTION STRING GOES HERE>", "EVENTHUB_CONSUMER_GROUP": "$Default", "STORAGE_ACCOUNT": "<YOUR STORAGE ACCOUNT NAME GOES HERE>", "STORAGE_ACCOUNT_KEY": "<YOUR STORAGE ACCOUNT KEY GOES HERE>", "STORAGE_ACCOUNT_CONNECTION_STRING": "<YOUR STORAGE ACCOUNT CONNECTION STRING GOES HERE>", "PROCESSOR_VERSION": "v2", "MIGRATE_CHECKPOINT": "true", "TRANSPORT": "websocket" } } ] }WebSocket with HTTPS proxy
{ "version": "0.2.0", "configurations": [ { "name": "Launch Filebeat", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/x-pack/filebeat/main.go", "args": [ "-e", "-v", "-d", "*", "--strict.perms=false", "--path.home", "${workspaceFolder}/x-pack/filebeat", "-E", "cloud.id=<YOUR CLOUD ID GOES HERE>", "-E", "cloud.auth=<YOUR USERNAME GOES HERE>:<YOUR PASSWORD GOES HERE>", "-E", "gc_percent=100", "-E", "setup.ilm.enabled=false", "-E", "setup.template.enabled=false", "-E", "output.elasticsearch.allow_older_versions=true" ], "env": { "EVENTHUB_NAME": "logs", "EVENTHUB_CONNECTION_STRING": "<YOUR EVENT HUB CONNECTION STRING GOES HERE>", "EVENTHUB_CONSUMER_GROUP": "$Default", "STORAGE_ACCOUNT": "<YOUR STORAGE ACCOUNT NAME GOES HERE>", "STORAGE_ACCOUNT_KEY": "<YOUR STORAGE ACCOUNT KEY GOES HERE>", "STORAGE_ACCOUNT_CONNECTION_STRING": "<YOUR STORAGE ACCOUNT CONNECTION STRING GOES HERE>", "PROCESSOR_VERSION": "v2", "MIGRATE_CHECKPOINT": "true", "TRANSPORT": "websocket", "HTTP_PROXY": "http://127.0.0.1:9090", "HTTPS_PROXY": "http://127.0.0.1:9090" } } ] }To test the proxy support, I used mitmproxy, an interactive HTTPS proxy with request inspection:
Since the Azure services require using an HTTPS proxy, you also need to set up a certificate for mitmproxy. See https://docs.mitmproxy.org/stable/concepts/certificates/ fore more details.
The mitmproxy main view:
Upgrade to AMQP-over-WebSocket:
WebSocket details:
Event hub messages received using AMQP-over-websocket through the proxy:
Related issues
Use cases
This is an automatic backport of pull request #47956 done by [Mergify](https://mergify.com).