Skip to content

Commit

Permalink
Telegraf can now collect non-numeric features!
Browse files Browse the repository at this point in the history
  • Loading branch information
juliarobles committed Oct 8, 2024
1 parent d6fa5b1 commit 0d3ec06
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion OpenTwins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: 0.5.0
appVersion: 0.6.0
description:
Esta es una plataforma de codigo abierto orientada a gemelos digitales.
keywords:
Expand Down
48 changes: 25 additions & 23 deletions OpenTwins/templates/config-maps/cm-telegraf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,38 @@ data:
{{- end }}

{{- if and .Values.mosquitto.enabled .Values.connections.telegraf.source.mosquitto.enabled }}
[[processors.rename]]
[[processors.rename.replace]]
dest = "parent"
tag = "extra_attributes__parents"
[[processors.rename.replace]]
dest = "originator"
tag = "headers_ditto-originator"
[[processors.rename.replace]]
dest = "idSimulationRun"
tag = "extra_features_idSimulationRun_properties_value"
[[processors.rename.replace]]
dest = "thingId"
tag = "extra_thingId"

[[inputs.mqtt_consumer]]
data_format = "json"
[[inputs.mqtt_consumer]]
qos = 1
servers = [
"tcp://{{ include "opentwins.mosquitto.fullname" . }}:1883"
]
tag_keys = [
"extra_attributes__parents",
"extra_thingId",
"headers_ditto-originator",
"extra_features_idSimulationRun_properties_value",
"value_time_properties_value"
]
topics = [
"{{ .Values.connections.ditto.target.mosquitto.address }}"
]
data_format = "json_v2"
[[inputs.mqtt_consumer.json_v2]]
[[inputs.mqtt_consumer.json_v2.tag]]
path = "extra.attributes._parents"
rename = "parent"
optional = true
[[inputs.mqtt_consumer.json_v2.tag]]
path = "extra.thingId"
rename = "thingId"
[[inputs.mqtt_consumer.json_v2.tag]]
path = "headers.ditto-originator"
rename = "originator"
optional = true
[[inputs.mqtt_consumer.json_v2.tag]]
path = "extra.features.idSimulationRun.properties.value"
rename = "idSimulationRun"
optional = true
[[inputs.mqtt_consumer.json_v2.object]]
path = "{value}"
optional = true
excluded_keys = ["value_thingId", "value_policyId", "value_attributes", "value_features"]
[[inputs.mqtt_consumer.json_v2.object]]
path = '{"value":value.features}'
optional = true
{{- end }}

{{- end }}
4 changes: 3 additions & 1 deletion OpenTwins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ kafka:
##################################################################
telegraf:
enabled: true # Value added by OpenTwins to indicate if this component should be installed or not
metrics:
internal:
enabled: false
config:

# Do no modify
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
processors: []
Expand Down

0 comments on commit 0d3ec06

Please sign in to comment.