Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit c33b9d3

Browse files
author
odacremolbap
committed
add observability docs
1 parent 4ffbb65 commit c33b9d3

File tree

14 files changed

+374
-153
lines changed

14 files changed

+374
-153
lines changed

README.md

Lines changed: 3 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,11 @@
1-
![TriggerMesh Logo](docs/assets/triggermesh-logo.png)
1+
![TriggerMesh Logo](docs/assets/images/triggermesh-logo.png)
22

33
![CodeQL](https://github.com/triggermesh/triggermesh-core/actions/workflows/codeql.yaml/badge.svg?branch=main)
44
![Static](https://github.com/triggermesh/triggermesh-core/actions/workflows/static.yaml/badge.svg?branch=main)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/triggermesh/triggermesh-core)](https://goreportcard.com/report/github.com/triggermesh/triggermesh-core)
66

77
The TriggerMesh Core components conform the basis for creating event driven applications declaratively at Kubernetes.
88

9-
## Getting Started
10-
11-
TriggerMesh Core includes 2 components:
12-
13-
* RedisBroker, which uses a backing Redis instance to store events and routes them via Triggers.
14-
* Trigger, which subscribes to events and push them to your targets.
15-
16-
Events must conform to [CloudEvents spec](https://github.com/cloudevents/spec) using the [HTTP binding](https://github.com/cloudevents/spec/blob/main/cloudevents/bindings/http-protocol-binding.md).
17-
18-
Create a RedisBroker named `demo`.
19-
20-
```console
21-
kubectl apply -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/broker.yaml
22-
```
23-
24-
Wait until the RedisBroker is ready. It will inform in its status of the URL where events can be ingested.
25-
26-
```console
27-
kubectl get redisbroker demo
28-
29-
NAME URL AGE READY REASON
30-
demo http://demo-rb-broker.default.svc.cluster.local 10s True
31-
```
32-
33-
To be able to use the broker we will create a Pod that allow us to send events inside the Kubernetes cluster.
34-
35-
```console
36-
kubectl apply -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/curl.yaml
37-
```
38-
39-
It is possible now to send events to the broker address by issuing curl commands. The response for ingested events must be an `HTTP 200` which means that the broker has received it and will try to deliver them to configured triggers.
40-
41-
```console
42-
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local/ \
43-
-X POST \
44-
-H "Ce-Id: 1234-abcd" \
45-
-H "Ce-Specversion: 1.0" \
46-
-H "Ce-Type: demo.type1" \
47-
-H "Ce-Source: curl" \
48-
-H "Content-Type: application/json" \
49-
-d '{"test1":"no trigger configured yet"}'
50-
```
51-
52-
Unfortunately we haven't configured any trigger yet, which means any ingested event will not be delivered. `event_display` is a CloudEvents consumer that logs to console the list of events received. We will be creating 2 instances of `event_display`, one as the target for consumed events and another one for the Dead Letter Sink.
53-
A Dead Letter Sink, abbreviated DLS is a destination that consumes events that a subscription was not able to deliver to the intended target.
54-
55-
```console
56-
# Target service
57-
kubectl apply -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/display-target.yaml
58-
59-
# DLS service
60-
kubectl apply -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/display-deadlettersink.yaml
61-
```
62-
63-
The Trigger object configures the broker to consume events and send them to a target. The Trigger object can include filters that select which events should be forwarded to the target, and delivery options to configure retries and fallback targets when the event cannot be delivered.
64-
65-
```console
66-
kubectl apply -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/trigger.yaml
67-
```
68-
69-
The Trigger created above filters by CloudEvents containing `type: demo.type1` attribute and delivers them to `display-target` service, if delivery fails it will issue 3 retries and then forward the CloudEvent to the `display-deadlettersink` service.
70-
71-
Using the `curl` Pod again we can send this CloudEvent to the broker.
72-
73-
```console
74-
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local/ \
75-
-X POST \
76-
-H "Ce-Id: 1234-abcd" \
77-
-H "Ce-Specversion: 1.0" \
78-
-H "Ce-Type: demo.type1" \
79-
-H "Ce-Source: curl" \
80-
-H "Content-Type: application/json" \
81-
-d '{"test 2":"message for display target"}'
82-
```
83-
84-
The target display Pod will show the delivered event.
85-
86-
```console
87-
kubectl logs -l app=display-target --tail 100
88-
89-
☁️ cloudevents.Event
90-
Validation: valid
91-
Context Attributes,
92-
specversion: 1.0
93-
type: demo.type1
94-
source: curl
95-
id: 1234-abcd
96-
datacontenttype: application/json
97-
Extensions,
98-
triggermeshbackendid: 1666613846441-0
99-
Data,
100-
{
101-
"test": "value2"
102-
}
103-
```
104-
105-
To simulate a target failure we will reconfigure the target display service to make it point to a non existing Pod set:
106-
107-
```console
108-
kubectl delete -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/display-target.yaml
109-
```
110-
111-
Any event that pass the filter will try to be sent to the target, and upon failing will be delivered to the DLS.
112-
113-
```console
114-
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local/ \
115-
-X POST \
116-
-H "Ce-Id: 1234-abcd" \
117-
-H "Ce-Specversion: 1.0" \
118-
-H "Ce-Type: demo.type1" \
119-
-H "Ce-Source: curl" \
120-
-H "Content-Type: application/json" \
121-
-d '{"test 3":"not delivered, will be sent to DLS"}'
122-
```
123-
124-
```console
125-
kubectl logs -l app=display-deadlettersink --tail 100
126-
127-
☁️ cloudevents.Event
128-
Validation: valid
129-
Context Attributes,
130-
specversion: 1.0
131-
type: demo.type1
132-
source: curl
133-
id: 1234-abcd
134-
datacontenttype: application/json
135-
Extensions,
136-
triggermeshbackendid: 1666613846441-0
137-
Data,
138-
{
139-
"test": "value3"
140-
}
141-
```
142-
143-
To clean up the getting started guide, delete each of the created assets:
144-
145-
```console
146-
# Removal of display-target not in this list, since it was deleted previously.
147-
kubectl delete -f \
148-
https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/trigger.yaml,\
149-
https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/display-deadlettersink.yaml,\
150-
https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/broker.yaml,\
151-
https://raw.githubusercontent.com/triggermesh/triggermesh-core/main/docs/getting-started/curl.yaml
152-
```
153-
1549
## Installation
15510

15611
Devevlopment version might be unstable.
@@ -161,13 +16,8 @@ ko apply -f ./config
16116

16217
## Usage
16318

164-
### Brokers
165-
166-
TODO
167-
168-
### Triggers
169-
170-
TODO
19+
- [Getting Started](docs/getting-started.md).
20+
- [Broker Observability](docs/observable-broker.md).
17121

17222
## Contributing
17323

115 KB
Loading
110 KB
Loading
File renamed without changes.
File renamed without changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: eventing.triggermesh.io/v1alpha1
2+
kind: RedisBroker
3+
metadata:
4+
name: metrics-demo
5+
spec:
6+
broker:
7+
observability:
8+
valueFromConfigMap: metrics-demo-observability
9+

0 commit comments

Comments
 (0)