Creating a Wiretap
In this guide we will create a Wiretap to monitor the CloudEvent traffic happening within our bridge.
What is a Wiretap?
A Wiretap is a powerful debugging tool/methodology that can be used to understand the flow of events through the system by subscribing to all of the events that pass through the associated
Broker. This is accomplished by the use of a
Trigger to route all of the events into a logging service.
Implementing a Wiretap
Creating an Example Bridge
Lets create a configuration that demonstrates the idea of a wiretap. The full manifest is available here in case you want to directly apply the whole configuration to your cluster.
To start, we need to create a
WebhookSource that will receive events over HTTP, and a
Broker that will ingest those events:
Implement a Wiretap
To add a Wiretap, we can create a
Service and a
Service we will be using is called Event Display, which is a simple service that logs the events it receives.
We'll create a Trigger that routes all events passing through the broker to the Event Display service:
- name: event-display
- protocol: TCP
Using the Wiretap
Now that we have all the parts in place, we can utilize our
Wiretap to monitor the events that are being sent through our broker from the
Retrieve the URL where the Webhook is listening for incoming requests.
curl or any HTTP capable client to post an event to the webhook.
View the logs of the
Event Display service:
kubectl logs deployments/event-display