-
Notifications
You must be signed in to change notification settings - Fork 117
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
Enrich failed events with custom attributes provided via HTTP Response Headers #2376
Comments
@danielezonca Thanks for the feedback! I have a question: IMO this lowers the burden of extra configuration? |
Do you mean something like a fixed prefix |
I believe this should be brought to general Knative Eventing spec first. So that interface(spec) - implementation relationship is preserved. Changes should be pushed downstream, not the other way around. If it makes sense :) |
Hi @egorlepa I agree that this is a good candidate for a knative eventing improvement. Fine for me to target spec first :) |
Let's have it on the Eventing WG call, today (Wednesday) |
We are using the If the response contains headers that start with the prefix, such as
Here is a e2e test that shows the pattern: https://github.com/knative-sandbox/eventing-kafka-broker/pull/2657/files#diff-0de2d5afb422b7e648e6a13010e4331ecad2c15de240dcea0e8177e263e73e10R391-R422 |
Problem
Currently deadLetterSink strategy enriches error message with a set of predefined attributes (
knativeerrordest
,knativeerrorcode
andknativeerrordata
).It is not possible to provide additional custom attributes to add to the error and the only attribute where there is a bit of control is
knativeerrordata
but it contains the body of the response so it is a single value.The proposal is to have a mechanism (opt-in?) to ask Knative Broker to take HTTP Response Headers and add them as CloudEvents attributes to the deadLetterSink event.
A proposal for the opt-in scenario could be to have an allowlist annotation defined at Trigger (or Broker?) level with the list of supported custom extensions and
*
to forward all of themPersona:
I think this feature is useful both for Event consumer (developer) and System Operator personas (essentially all personas involved with error handling)
Exit Criteria
It should be possible for a subscriber sink to enrich error HTTP Response with custom HTTP headers that are included in the deadLetterSink message
Time Estimate (optional):
This is probably a quite simple implementation in Knative Kafka Broker (it changes the same classes of this other PR #2374) so it could be probably also a
good-first-issue
(1-2 days). It might be useful to bring a similar requirement to Knative Eventing to generalise the solution but it can takes more time.Additional context (optional)
We have an error catalog (that is not based on HTTP error codes) that has error id, error reason and maybe also nested errors and we would like to avoid to "encode" them as raw string in the HTTP Response body.
Example
Event from Broker to Subscriber
HTTP Headers
Payload
Subscriber Response
HTTP Response
HTTP Response Body
DeadLetterSink message
Attributes
Body
The text was updated successfully, but these errors were encountered: