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

http_endpoint: test ack api #9843

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/http_endpoint/_dev/deploy/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.3'
services:
test-webhook-http:
image: docker.elastic.co/observability/stream:v0.15.0
image: docker.elastic.co/observability/stream:v0.16.0
volumes:
- ./sample_logs:/sample_logs:ro
environment:
Expand All @@ -11,3 +11,14 @@ services:
- STREAM_USERNAME=abc123
- STREAM_PASSWORD=abc123
command: log --start-signal=SIGHUP --webhook-username=abc123 --webhook-password=abc123 --delay=10s /sample_logs/test-webhook.log
test-webhook-http-ack:
image: docker.elastic.co/observability/stream:v0.16.0
volumes:
- ./sample_logs:/sample_logs:ro
environment:
- STREAM_PROTOCOL=webhook
- STREAM_ADDR=http://elastic-agent:9516/json?wait_for_completion_timeout=1m
- STREAM_WEBHOOK_HEADER=Content-Type=application/json
- STREAM_USERNAME=abc123
- STREAM_PASSWORD=abc123
command: log --start-signal=SIGHUP --webhook-username=abc123 --webhook-password=abc123 --webhook-timeout=2m --delay=10s /sample_logs/test-webhook.log
Copy link
Member

Choose a reason for hiding this comment

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

The STREAM_USERNAME and STREAM_PASSWORD need to be STREAM_WEBHOOK_{USERNAME,PASSWORD} (plus they are redundant given the CLI flags). This goes all in on env config:

Suggested change
- STREAM_USERNAME=abc123
- STREAM_PASSWORD=abc123
command: log --start-signal=SIGHUP --webhook-username=abc123 --webhook-password=abc123 --webhook-timeout=2m --delay=10s /sample_logs/test-webhook.log
- STREAM_WEBHOOK_USERNAME=abc123
- STREAM_WEBHOOK_PASSWORD=abc123
- STREAM_WEBHOOK_TIMEOUT=2m
- STREAM_START_SIGNAL=SIGHUP
- STREAM_DELAY=10s
command: log /sample_logs/test-webhook.log

Copy link
Contributor Author

@efd6 efd6 May 17, 2024

Choose a reason for hiding this comment

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

These reflect what is above. Should I fix those too? Done

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
service: test-webhook-http-ack
service_notify_signal: SIGHUP
input: http_endpoint
vars:
data_stream.dataset: http_endpoint.http_endpoint
preserve_original_event: true
listen_address: 0.0.0.0
url: /json
prefix: event
listen_port: 9516
basic_auth: true
username: abc123
password: abc123
5 changes: 5 additions & 0 deletions packages/http_endpoint/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- version: "2.0.0-next" # Merge into next version and delete this and the following line.
changes:
- description: Added test for end-to-end ACK behaviour.
type: enhancement
link: https://github.com/elastic/integrations/pull/9843
- version: "2.0.0"
changes:
- description: Converted package to input type.
Expand Down