knative / eventing

Event-driven application platform for Kubernetes
https://knative.dev/docs/eventing
Apache License 2.0
1.39k stars 582 forks source link

Support sending structured events from Triggers #8057

Open Cali0707 opened 4 days ago

Cali0707 commented 4 days ago

Problem Currently, when dispatching an event from a trigger, we send it in the binary event format. However, to integrate with some systems (such as AWS EventBridge) we will need to be able to support sending events in structured format.

To support this, I suggest that we add a label to the triggers such as:

apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
  name: my-trigger
  labels:
    eventing.knative.dev/event-format: structured
spec:
  ...

This label would have three values binary, structured, and input. If set to binary, then the trigger would deliver the event in binary format. If set to structured, then the trigger would deliver the event in structured format. If set to input, then the trigger would send the event in the format that the broker received it.

Persona: Which persona is this feature for? System integrators

Exit Criteria An e2e test that verifies that the event was received in structured format.

Time Estimate (optional): How many developer-days do you think this may take to resolve? 1-2 days

Additional context (optional) Add any other context about the feature request here.

Cali0707 commented 4 days ago

cc @pierDipi @matzew @creydr any thoughts about this?

If this design makes sense, I'll open an equivalent issue for subscriptions