Parsing of MQTT user properties#

MQTT user properties are translated to open telemetry attributes per default. If you want to change this behaviour you can turn it off by setting the CreateAttributesFromUserProperties property to false.

MQTT user properties can be assessed inside expressions by using the UserProperty function. This function returns the value of the user property and expects the name of the property as an argument. If the name does not exist, the function returns an empty string.

Warning

If the name exists multiple times, only the first match is returned.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17

Processors:
  - Name: "Processor Temperature"
    Description: "Create attributes from user properties manually. Here the attribute key 'Category' is changed to 'Criticality'."
    Mqtt: 
      Subscriptions:
        - Topic: "sensor/+/data"
    Otel:
      Metrics:
        - Name: "Processor.Temperature"
          Description: "The current processor temperature."
          CreateAttributesFromUserProperties: false
          Instrument: Gauge
          Attributes:
            - Key: "Criticality"
              Value: "$(UserProperty('Category'))"
          Value: "PAYLOAD()"