elastic / elastic/stream

Allow configurable accepted HTTP status codes for webhook protocol

Open
#193 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
12
Forks
18
Avg merge
10h 32m
Merged PRs (30d)
1

Description

The webhook protocol currently treats only **HTTP 200 (http.StatusOK)** as a successful response. Any other status code (including other 2xx codes such as `202`) is treated as an error.

Please add support for an **allowlist of accepted status codes** (e.g. `200`, `202`) so webhook integrations can treat other 2xx codes as success.

Some webhook endpoints legitimately respond with status codes other than 200 (for example **202 Accepted** when the payload is queued for async processing). Today these are handled as failures even though the request succeeded from the sender’s perspective.

For instance, this would be helpful a Zipkin-related input package being added in **elastic/integrations**:
- https://github.com/elastic/integrations/pull/17226

And zipkin receiver returns a 202 code when sending JSONs to its endpoint ([related code](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/055d6fb4f0ab68d7c0fe58e4d24153b85243a8bb/receiver/zipkinreceiver/trace_receiver.go#L240-L246)).

Could it be added a new configuration option to define which HTTP status codes should be considered successful for webhook delivery (as allowed list)? The default value for this allowed list should be 200 to keep the same behavior as it is now.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.