Skip to content

Commit 67d1574

Browse files
feat(exporter): export CommandDistributionRecords
Adds configurations for exporting the CommandDistributionRecord
1 parent f1f86a2 commit 67d1574

File tree

7 files changed

+49
-0
lines changed

7 files changed

+49
-0
lines changed

dist/src/main/config/broker.standalone.yaml.template

+1
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@
657657
# event: true
658658
# rejection: false
659659
#
660+
# commandDistribution: true
660661
# decisionRequirements: true
661662
# decision: true
662663
# decisionEvaluation: true

dist/src/main/config/broker.yaml.template

+1
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@
587587
# event: true
588588
# rejection: false
589589
#
590+
# commandDistribution: true
590591
# decisionRequirements: true
591592
# decision: true
592593
# decisionEvaluation: true

exporters/elasticsearch-exporter/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ More specifically, each option configures the following:
120120
* `rejection` (`boolean`): if true, rejection records will be exported; if false, ignored.
121121

122122

123+
* `commandDistribution` (`boolean`): if true, records related to command distributions will be exported; if false, ignored.
123124
* `decisionRequirements` (`boolean`): if true, records related to decision requirements will be
124125
exported; if false, ignored.
125126
* `decision` (`boolean`): if true, records related to decisions will be exported; if false, ignored.
@@ -195,6 +196,7 @@ exporters:
195196
event: true
196197
rejection: false
197198
199+
commandDistribution: true
198200
decisionRequirements: true
199201
decision: true
200202
decisionEvaluation: true

exporters/elasticsearch-exporter/src/main/java/io/camunda/zeebe/exporter/ElasticsearchExporter.java

+3
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ private void createIndexTemplates() {
272272
if (index.resourceDeletion) {
273273
createValueIndexTemplate(ValueType.RESOURCE_DELETION);
274274
}
275+
if (index.commandDistribution) {
276+
createValueIndexTemplate(ValueType.COMMAND_DISTRIBUTION);
277+
}
275278
}
276279

277280
indexTemplatesCreated = true;

exporters/elasticsearch-exporter/src/main/java/io/camunda/zeebe/exporter/ElasticsearchExporterConfiguration.java

+5
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public boolean shouldIndexValueType(final ValueType valueType) {
105105
return index.signalSubscription;
106106
case RESOURCE_DELETION:
107107
return index.resourceDeletion;
108+
case COMMAND_DISTRIBUTION:
109+
return index.commandDistribution;
108110
default:
109111
return false;
110112
}
@@ -163,6 +165,7 @@ public static class IndexConfiguration {
163165
public boolean signal = true;
164166
public boolean signalSubscription = true;
165167
public boolean resourceDeletion = true;
168+
public boolean commandDistribution = true;
166169

167170
// index settings
168171
private Integer numberOfShards = null;
@@ -248,6 +251,8 @@ public String toString() {
248251
+ signalSubscription
249252
+ ", resourceDeletion="
250253
+ resourceDeletion
254+
+ ", recordDistribution="
255+
+ commandDistribution
251256
+ '}';
252257
}
253258
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"index_patterns": [
3+
"zeebe-record_command-distribution_*"
4+
],
5+
"composed_of": ["zeebe-record"],
6+
"priority": 20,
7+
"version": 1,
8+
"template": {
9+
"settings": {
10+
"number_of_shards": 1,
11+
"number_of_replicas": 0,
12+
"index.queries.cache.enabled": false
13+
},
14+
"aliases": {
15+
"zeebe-record-command-distribution": {}
16+
},
17+
"mappings": {
18+
"properties": {
19+
"value": {
20+
"dynamic": "strict",
21+
"properties": {
22+
"partitionId": {
23+
"type": "integer"
24+
},
25+
"valueType": {
26+
"type": "keyword"
27+
},
28+
"commandValue": {
29+
"enabled": false
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
36+
}

exporters/elasticsearch-exporter/src/test/java/io/camunda/zeebe/exporter/TestSupport.java

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ static void setIndexingForValueType(
7575
case SIGNAL -> config.signal = value;
7676
case SIGNAL_SUBSCRIPTION -> config.signalSubscription = value;
7777
case RESOURCE_DELETION -> config.resourceDeletion = value;
78+
case COMMAND_DISTRIBUTION -> config.commandDistribution = value;
7879
default -> throw new IllegalArgumentException(
7980
"No known indexing configuration option for value type " + valueType);
8081
}

0 commit comments

Comments
 (0)