Skip to content

Commit 3ab6740

Browse files
authored
blog: Camunda Exporter MVP (#602)
Run experiment about the MVP of the Camunda Exporter Project camunda/product-hub#2128
2 parents 5b01c3c + f377692 commit 3ab6740

19 files changed

+242
-0
lines changed
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
---
2+
layout: posts
3+
title: "Camunda Exporter MVP"
4+
date: 2024-10-24
5+
categories:
6+
- camunda
7+
- exporter
8+
tags:
9+
- performance
10+
authors: zell
11+
---
12+
13+
# Chaos Day Summary
14+
15+
After a long pause, I come back with an interesting topic to share and experiment with. Right now we are re-architecture
16+
Camunda 8. One important part (which I'm contributing to) is to get rid of Webapps Importer/Archivers and move
17+
data aggregation closer to the engine (inside a Zeebe Exporter).
18+
19+
Today, I want to experiment with the first increment/iteration of our so-called MVP. The MVP targets green field installations where you simply deploy Camunda (with a new Camunda Exporter enabled) without Importers.
20+
21+
**TL;DR;** All our experiments were successful. The MVP is a success, and we are looking forward to further improvements and additions. Next stop Iteration 2: Adding Archiving historic data and preparing for data migration (and polishing MVP).
22+
23+
## Camunda Exporter
24+
25+
The [Camunda Exporter project](https://github.com/camunda/product-hub/issues/2128) deserves a complete own blog post, here is just a short summary.
26+
27+
Our current Camunda architecture looks something like this (simplified).
28+
29+
![current](current-miro.png)
30+
31+
It has certain challenges, like:
32+
33+
* Space: duplication of data in ES
34+
* Maintenance: duplication of importer and archiver logic
35+
* Performance: Round trip (delay) of data visible to the user
36+
* Complexity: installation and operational complexity (we need separate pods to deploy)
37+
* Scalability: The Importer is not scalable in the same way as Zeebe or brokers (and workload) are.
38+
39+
These challenges we obviously wanted to overcome and the plan (as mentioned earlier) is to get rid of the need of separate importers and archivers (and in general to have separate application; but this is a different topic).
40+
41+
The plan for this project looks something like this:
42+
43+
![plan](how-brown-field.png)
44+
45+
We plan to:
46+
47+
1. Harmonize the existing indices stored in Elasticsearch/Opensearch
48+
2. Space: Reduce the unnecessary data duplication
49+
2. Move importer and archiver logic into a new Camunda exporter
50+
3. Performance: This should allow us to reduce one additional hop (as we don't need to use ES/OS as a queue)
51+
4. Maintenance: Indices and business logic is maintained in one place
52+
5. Scalability: With this approach, we can scale with partitions, as Camunda Exporters are executed for each partition separately (soon partition scaling will be introduced)
53+
6. Complexity: The Camunda Exporter will be built-in and shipped with Zeebe/Camunda 8. No additional pod/application is needed.
54+
55+
Note: Optimize is right now out of scope (due to time), but will later be part of this as well.
56+
57+
58+
### MVP
59+
60+
After we know what we want to achieve what is the Minimum viable product (MVP)?
61+
62+
We have divided the Camunda Exporter in 3-4 iterations. You can see and read more about this [here](https://github.com/camunda/issues/issues/803).
63+
64+
The first iteration contains the MVP (the first breakthrough). Providing the Camunda Exporter with the basic functionality ported from the Operate and Tasklist importers, writing into harmonized indices.
65+
66+
The MVP is targeting green field installations (clean installations) of Camunda 8 with Camunda Exporter without running the old Importer (no data migration yet),
67+
68+
![mvp](it1-mvp.png)
69+
70+
<!--truncate-->
71+
72+
## Chaos Experiment
73+
74+
What I want to verify today, when I deploy the Camunda 8 stack with Camunda Exporter (and Importer disabled):
75+
76+
* Are webapps schemas created in ES, by the new Camunda Exporter
77+
* Is data exported into the indices
78+
* Can Operate show data? (right now just checking for basic functionality)
79+
80+
Additionally, I would like to understand what the performance looks like, how the system behaves with two ES exporters (the old ES exporter and the new Camunda Exporter), and more.
81+
82+
For our experiment, I use a [newly defined realistic benchmark](https://github.com/camunda/camunda/issues/21472) (with a more complex process model). More about this in a separate blog post.
83+
84+
### Expected
85+
86+
I can deploy the newest helm charts (alpha stage), by disabling Importer manually, and will be able to use Zeebe and Operate together. See the verifications above.
87+
88+
### Actual
89+
90+
As always we use our [benchmark-helm charts](https://github.com/zeebe-io/benchmark-helm) (that building on top of our [Camunda Platform Helm](https://github.com/camunda/camunda-platform-helm) charts).
91+
92+
93+
### Installation
94+
95+
I had to adjust our benchmarks to [use the alpha snapshots ](https://github.com/zeebe-io/benchmark-helm/commit/db682a89788d6c511083ec743c6cf7d358155e3c)
96+
97+
```yaml
98+
dependencies:
99+
- name: camunda-platform
100+
repository: "oci://ghcr.io/camunda/helm"
101+
version: "0.0.0-snapshot-alpha"
102+
condition: "camunda.enabled"
103+
```
104+
105+
106+
and [disable the Importer via ENV](https://github.com/zeebe-io/benchmark-helm/commit/aafac6e9ec78e9cfd2e59a5b6f30bf887a4fcbd0)
107+
108+
```yaml
109+
env:
110+
- name: CAMUNDA_OPERATE_IMPORTERENABLED
111+
value: "false"
112+
```
113+
114+
With that, we can install our chart:
115+
116+
```shell
117+
$ helm install zeebe-benchmark-test charts/zeebe-benchmark/ --render-subchart-notes -f charts/zeebe-benchmark/values-realistic-benchmark.yaml --set global.elasticsearch.prefix=null
118+
```
119+
120+
### Basic First Verification
121+
122+
After our benchmark chart is deployed we can already see the first time our Camunda Exporter running :tada:
123+
124+
![firsttime](first-time-seeing-camunda-exporter.png)
125+
126+
127+
Worth mentioning that the Camunda Export already comes with some metrics, visible on our Zeebe Dashboard
128+
129+
![metrics](mvp-c8-exporter-metrics.png)
130+
![metrics2](mvp-c8-exporter-metrics2.png)
131+
132+
133+
The general overview also looks good. No obvious problem.
134+
135+
![general](mvp-general-overview.png)
136+
137+
Looking into logs we can see that at the start it fails temporarily because ES is not yet ready to accept the schema creation.
138+
139+
```
140+
ERROR - Failed to open exporter 'CamundaExporter'. Retrying...
141+
```
142+
143+
![log](exporter-opened.png)
144+
145+
At some point, the exporter can be opened and the loop stops.
146+
147+
I think generally it shouldn't be an ERROR but more a WARN (but these are details we can fix). Follow-up.
148+
149+
150+
### Verify Operate Data
151+
152+
To make sure that Operate is not importing, I checked the Operate dashboard. We can see that there is no Importer metrics. Furthermore, in the configuration and logs we see no indication of importing.
153+
154+
![op-metrics](no-importer-metrics.png)
155+
156+
157+
We can now start to port-forward to operate:
158+
159+
```shell
160+
k port-forward svc/zeebe-benchmark-test-operate 8081:80
161+
```
162+
163+
When opening Operate we see unfortunately no data.
164+
165+
![operate-no-data](mvp-no-data-operate.png)
166+
167+
#### Investigating missing data
168+
169+
We need to understand why there is no data available for Operate.
170+
171+
What we saw is that the Camunda Exporter is open (logs), that it is also makes progress and data is written to elastic (metrics). What we haven't checked Elasticsearch in detail.
172+
173+
Looking into ES dashboard we can see that indices are created, but the Operate indices seem to be empty.
174+
175+
![es-indices](mvp-operate-indices-empty.png)
176+
177+
When checking the Zeebe indices:
178+
179+
![zeebe-indices](mvp-zeebe-indices-filled.png)
180+
181+
we can see that they are filled. An attentive reader will also chekc that there actuall some prefix problem in the indices.
182+
183+
Thanks to Deepthi which spotted this as well (and told me), we were exporting to the wrong index names. There was a [bug](https://github.com/camunda/camunda-platform-helm/blob/46f6ee9d828439b0b1cf37bae4d135ba5281a832/charts/camunda-platform-alpha/templates/zeebe/configmap.yaml#L66) existing in the current alpha Helm chart version.
184+
185+
![wrong-prefix](mvp-wrong-prefix.png)
186+
187+
This has been fixed with [PR-2506](https://github.com/camunda/camunda-platform-helm/pull/2506). Until this gets merged I changed this manually via:
188+
189+
```shell
190+
# Get the templates
191+
helm template zeebe-benchmark-test charts/zeebe-benchmark/ --render-subchart-notes -f charts/zeebe-benchmark/values-realistic-benchmark.yaml --output-dir templates
192+
193+
# Adjust the config map - remove the prefix
194+
vim templates/zeebe-benchmark/charts/camunda-platform/templates/zeebe/configmap.yaml
195+
196+
# Apply all manifests
197+
k apply -f . --recursive
198+
```
199+
200+
> **Note:**
201+
>
202+
> I also tried
203+
> ```shell
204+
> helm template charts/zeebe-benchmark/ --version 0.0.0-snapshot-alpha --show-only charts/camunda-platform/templates/zeebe/configmap.yaml --set global.elasticsearch.prefix=null
205+
> ```
206+
> But this breaks the ES exporter.
207+
208+
With this change we were can see that indices are correctly created and filled!
209+
210+
![indices-filled](mvp-fixed-prefix-indices.png)
211+
212+
Finally, we are able to see data in Operate! :rocket: **WITHOUT ANY IMPORTER.**
213+
214+
![mvp-operate-data.png](mvp-operate-data.png)
215+
![mvp-operate-instance.png](mvp-operate-instance.png)
216+
![mvp-operate-pi.png](mvp-operate-pi.png)
217+
![operate-overview](mvp-decisions.png)
218+
219+
220+
## Conclusion
221+
222+
The MVP is a success. We were able to provide a Camunda Exporter that creates the necessary harmonized schema and migrate the basic business logic from Operate and Tasklist into the exporter. This allows us to use only the Camunda Exporter without running any Importer pod/application.
223+
224+
Great work Team :rocket: :tada:
225+
226+
**Next stop:**
227+
228+
_Iteration 2:_
229+
230+
* Implementing migration logic for old data
231+
* Moving Archiver logic (for historical data) into the Exporter
232+
* Polish MVP state (add some missing features like TreePath, etc.)
233+
234+
### Additional notes
235+
236+
This time I was not able to deep dive into performance or stability for this change. I plan to do this next.
237+
238+
### Found Bugs
239+
240+
* ERROR log level for logs that are transitive
241+
* Auth/User indices are still prefixed with identity
242+
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)