Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
juliarobles committed Nov 29, 2023
2 parents 4f9282d + 4f7ec31 commit 7c3a3dd
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ curl -i -X POST -u devops:${DITTO_DEVOPS_PWD} -H 'Content-Type: application/json
"type": "connectivity.commands:createConnection",
"connection": {
"id": "kafka-connection",
"name": "kafka-connection",
"connectionType": "kafka",
"connectionStatus": "open",
"failoverEnabled": true,
Expand All @@ -320,7 +321,7 @@ curl -i -X POST -u devops:${DITTO_DEVOPS_PWD} -H 'Content-Type: application/json
{
"address": "digitaltwins",
"topics": [
"_/_/things/twin/events",
"_/_/things/twin/events?extraFields=thingId,attributes/_parents,features/idSimulationRun/properties/value",
"_/_/things/live/messages"
],
"authorizationContext": [
Expand Down Expand Up @@ -351,10 +352,16 @@ export INFLUX_TOKEN=<INFLUX_TOKEN>
<img src="images/create-token-influxdb.JPG" height="300">
</p>

You also need to store in variables the IPs and ports of both Kafka and InfluxDB, as well as the name of the Kafka topic. These variables will be INFLUX_IP, INFLUX_PORT, KAFKA_IP, KAFKA_PORT and KAFKA_TOPIC. Once all variables are ready, Telegraf can be displayed with the values defined in the [values-telegraf.yaml](files_for_manual_deploy/values-telegraf.yaml) file.
You also need to store in variables the URLs of both Kafka and InfluxDB (follow the format IP:PORT), as well as the name of the Kafka topic. These variables will be **INFLUX_URL**, **KAFKA_BROKER** and **KAFKA_TOPIC**. Once all variables are ready, Telegraf can be displayed with the values defined in the [values-telegraf.yaml](files_for_manual_deploy/values-telegraf.yaml) file.

```sh
helm install -n $NS telegraf influxdata/telegraf -f values-telegraf.yaml --version=1.8.18
helm upgrade --install -n $NS test-telegraf influxdata/telegraf \
-f values-telegraf.yaml \
--version=1.8.27 \
--set config.outputs[0].influxdb_v2.token=$INFLUX_TOKEN \
--set config.outputs[0].influxdb_v2.urls[0]=$INFLUX_URL \
--set config.inputs[0].kafka_consumer.brokers[0]=$KAFKA_BROKER \
--set config.inputs[0].kafka_consumer.topics[0]=$KAFKA_TOPIC
```

If the pod is ready and running it should be working, but it is advisable to check its logs to make sure.
Expand Down
40 changes: 40 additions & 0 deletions files_for_manual_deploy/values-telegraf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# # helm upgrade --install -n digitaltwins test-telegraf influxdata/telegraf -f testeo-variables.yaml --version=1.8.27 --set config.outputs[0].influxdb_v2.token=$INFLUX_TOKEN --set config.outputs[0].influxdb_v2.urls[0]=$INFLUX_URL --set config.inputs[0].kafka_consumer.brokers[0]=$KAFKA_BROKER --set config.inputs[0].kafka_consumer.topics[0]=$KAFKA_TOPIC
service:
enabled: false
config:
agent:
debug: true
processors:
- rename:
replace:
- tag: "extra_thingId"
dest: "thingId"
- tag: "extra_attributes__parents"
dest: "parent"
- tag: "headers_ditto-originator"
dest: "originator"
- tag: "extra_features_idSimulationRun_properties_value"
dest: "idSimulationRun"
outputs:
- influxdb_v2:
urls:
- ""
token: ""
organization: "influxdata"
bucket: "default"
inputs:
- kafka_consumer:
brokers:
- ""
topics:
- "digitaltwins"
tag_keys:
- "extra_attributes__parents"
- "extra_thingId"
- "headers_ditto-originator"
- "extra_features_idSimulationRun_properties_value"
max_message_len: 1000000
data_format: "json"
metrics:
internal:
enabled: false

0 comments on commit 7c3a3dd

Please sign in to comment.