Skip to content

Latest commit

 

History

History
522 lines (486 loc) · 17.9 KB

telemetry-messages-format.md

File metadata and controls

522 lines (486 loc) · 17.9 KB

Telemetry Messages Processing

Home

Work in progress!!

Telemetry messagees used by the IIoT Platform

From IoT Hub - Generated by Edge Publisher

Samples Mode

Json Encoding

{
  "body": {
    "NodeId": "http://test.org/UA/Data/#i=10845",
    "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
    "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
    "DisplayName": "SByteValue",
    "Timestamp": "2020-03-25T00:30:59.8229777Z",
    "Status": "Good",
    "Value": {
      "Value": -30,
      "SourceTimestamp": "2020-03-25T00:30:59.0134194Z",
      "ServerTimestamp": "2020-03-25T00:30:59.0134194Z"
    },
    "ExtensionFields": {
      "EndpointId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
      "PublisherId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
      "DataSetWriterId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f"
    }
  },
  "enqueuedTime": "2020-03-25T00:31:00.078Z",
  "properties": {
    "iothub-creation-time-utc": "2020-03-25T00:30:59.8797427Z",
    "$$ContentType": "application/x-monitored-item-json-v1",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "03/25/20 12:30:59 AM"
  }
}

Binary Encoding

{
  "body": "U\u001f\u0000\u0000\u0001\u0003^*\u0018\u0000\u0000\u0000http://test.org/UA/Data/*\u0000\u0000\u0000opc.tcp://172.17.126.1:51210/UA/Server%\u0000\u0000\u0000urn:IndustrialHost01:OpcUaServer\t\u0000\u0000\u0000ByteValue\u0003\u000fy\u001f4\u0002V\u0001\r\u0003iV\u0013]\u001f4\u0002V\u0001V\u0013]\u001f4\u0002V\u0001\u0003\u0000\u0000\u0000\u0000\u0000\n\u0000\u0000\u0000EndpointId\f+\u0000\u0000\u0000uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f\u0000\u0000\u000b\u0000\u0000\u0000PublisherId\f+\u0000\u0000\u0000uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f\u0000\u0000\u000f\u0000\u0000\u0000DataSetWriterId\f+\u0000\u0000\u0000uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "enqueuedTime": "2020-03-24T23:33:30.978Z",
  "properties": {
    "iothub-creation-time-utc": "2020-03-24T23:33:30.7710485Z",
    "$$ContentType": "application/x-monitored-item-uabinary-v1",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "03/24/20 11:33:30 PM"
  },
  "systemProperties": {
    "iothub-connection-device-id": "DataSetWriterV2_uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
    "iothub-connection-auth-method": "{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
    "iothub-connection-auth-generation-id": "637204283934176220",
    "iothub-enqueuedtime": 1585092810743,
    "iothub-message-source": "Telemetry",
    "x-opt-sequence-number": 502705,
    "x-opt-offset": "94502792056",
    "x-opt-enqueued-time": 1585092810978
  }
}

OPC UA Pub/Sub Mode

Json Encoding

{
  "body": {
    "MessageId": "18",
    "MessageType": "ua-data",
    "PublisherId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
    "DataSetClassId": "78c4e91c-82cb-444e-a8e0-6bbacc9a946d",
    "Messages": [
      {
        "DataSetWriterId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
        "SequenceNumber": 18,
        "MetaDataVersion": {
          "MajorVersion": 1,
          "MinorVersion": 1
        },
        "Timestamp": "2020-03-24T23:30:56.9597112Z",
        "Status": null,
        "Payload": {
          "http://test.org/UA/Data/#i=10845": {
            "Value": 99,
            "SourceTimestamp": "2020-03-24T23:30:55.9891469Z",
            "ServerTimestamp": "2020-03-24T23:30:55.9891469Z"
          },
          "http://test.org/UA/Data/#i=10846": {
            "Value": 251,
            "SourceTimestamp": "2020-03-24T23:30:55.9891469Z",
            "ServerTimestamp": "2020-03-24T23:30:55.9891469Z"
          }
        }
      }
    ]
  },
  "enqueuedTime": "2020-03-24T23:30:57.130Z",
  "properties": {
    "iothub-creation-time-utc": "2020-03-24T23:30:56.9612338Z",
    "$$ContentType": "application/x-network-message-json-v1",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "03/24/20 11:30:56 PM"
  },
  "systemProperties": {
    "iothub-connection-device-id": "DataSetWriterV2_uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
    "iothub-connection-auth-method": "{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
    "iothub-connection-auth-generation-id": "637204283934176220",
    "iothub-enqueuedtime": 1585092656941,
    "iothub-message-source": "Telemetry",
    "x-opt-sequence-number": 502469,
    "x-opt-offset": "94502523208",
    "x-opt-enqueued-time": 1585092657130
  }
}

Binary Encoding:

{
  "body": "u\u0002\u0000\u0000\u0002\u0000\u0000\u000029\u0007\u0000\u0000\u0000ua-data+\u0000\u0000\u0000uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f$\u0000\u0000\u000078c4e91c-82cb-444e-a8e0-6bbacc9a946d\u0001\u0000\u0000\u0000=\u0000\u0000\u0000+\u0000\u0000\u0000uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f\u001d\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000[}\u001055\u0002V\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000 \u0000\u0000\u0000http://test.org/UA/Data/#i=10846\r\u0003\n|\u000f\u001755\u0002V\u0001|\u000f\u001755\u0002V\u0001 \u0000\u0000\u0000http://test.org/UA/Data/#i=10845\r\u0002*|\u000f\u001755\u0002V\u0001|\u000f\u001755\u0002V\u0001",
  "enqueuedTime": "2020-03-24T23:37:41.298Z",
  "properties": {
    "iothub-creation-time-utc": "2020-03-24T23:37:40.9194946Z",
    "$$ContentType": "application/x-network-message-uadp-v1",
    "$$CreationTimeUtc": "03/24/20 11:37:40 PM"
  },
  "systemProperties": {
    "iothub-connection-device-id": "DataSetWriterV2_uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
    "iothub-connection-auth-method": "{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
    "iothub-connection-auth-generation-id": "637204283934176220",
    "iothub-enqueuedtime": 1585093061235,
    "iothub-message-source": "Telemetry",
    "x-opt-sequence-number": 503200,
    "x-opt-offset": "94503278664",
    "x-opt-enqueued-time": 1585093061298
  }
}

Standalone Publisher mode - Legacy

Full featured message sample

Enhanced compatibility with new version of the IIoT Platform's telemetry processors. Publisher to be started in standalone mode with --fm=true argument

{
  "body": {
    "NodeId": "http://test.org/UA/Data/#i=10845",
    "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
    "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
    "Timestamp": "2020-04-28T11:46:31.8062202Z",
    "Value": {
      "Value": 111,
      "SourceTimestamp": "2020-04-28T11:46:31.5911136Z",
      "ServerTimestamp": "2020-04-28T11:46:31.5911136Z"
    },
    "SequenceNumber": 5,
    "ExtensionFields": {
      "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
      "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
    }
  },
  "enqueuedTime": "2020-04-28T11:46:31.935Z",
  "properties": {
    "iothub-creation-time-utc": "2020-04-28T11:46:31.8078405Z",
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/opcua+uajson",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "04/28/20 11:46:31 AM"
  }
}


{
  "body": {
    "NodeId": "http://opcfoundation.org/Quickstarts/ReferenceApplications#s=%2fStatic%2fAll+Profiles%2fScalar%2fAccessLevel_CurrentRead_NotUser",
    "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
    "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
    "Timestamp": "2020-04-28T11:47:54.8324454Z",
    "Value": {
      "StatusCode": {
        "Symbol": "BadUserAccessDenied",
        "Code": 2149515264
      },
      "ServerTimestamp": "2020-04-28T11:46:26.8543789Z"
    },
    "SequenceNumber": 84,
    "ExtensionFields": {
      "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
      "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
    }
  },
  "enqueuedTime": "2020-04-28T11:47:55.882Z",
  "properties": {
    "iothub-creation-time-utc": "2020-04-28T11:47:55.6085898Z",
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/opcua+uajson",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "04/28/20 11:47:55 AM"
  }
}

Message example with batching/bulk mode enabled Publisher to be started in standalone mode with --bs=5 argument, where 5 is the number of datachanges to be batched.

{
  "body": [
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Timestamp": "2020-04-28T11:57:09.0454051Z",
      "Value": {
        "Value": 44,
        "SourceTimestamp": "2020-04-28T11:57:08.5422702Z",
        "ServerTimestamp": "2020-04-28T11:57:08.5422702Z"
      },
      "SequenceNumber": 261,
      "ExtensionFields": {
        "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
        "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Timestamp": "2020-04-28T11:57:09.9594358Z",
      "Value": {
        "Value": -106,
        "SourceTimestamp": "2020-04-28T11:57:09.5435278Z",
        "ServerTimestamp": "2020-04-28T11:57:09.5435278Z"
      },
      "SequenceNumber": 262,
      "ExtensionFields": {
        "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
        "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Timestamp": "2020-04-28T11:57:10.9769455Z",
      "Value": {
        "Value": 46,
        "SourceTimestamp": "2020-04-28T11:57:10.5454371Z",
        "ServerTimestamp": "2020-04-28T11:57:10.5454371Z"
      },
      "SequenceNumber": 263,
      "ExtensionFields": {
        "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
        "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Timestamp": "2020-04-28T11:57:11.9602092Z",
      "Value": {
        "Value": 58,
        "SourceTimestamp": "2020-04-28T11:57:11.5456693Z",
        "ServerTimestamp": "2020-04-28T11:57:11.5456693Z"
      },
      "SequenceNumber": 264,
      "ExtensionFields": {
        "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
        "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Timestamp": "2020-04-28T11:57:13.0102308Z",
      "Value": {
        "Value": 38,
        "SourceTimestamp": "2020-04-28T11:57:12.5488694Z",
        "ServerTimestamp": "2020-04-28T11:57:12.5488694Z"
      },
      "SequenceNumber": 265,
      "ExtensionFields": {
        "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
        "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10218",
      "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Timestamp": "2020-04-28T11:57:13.0102308Z",
      "Value": {
        "Value": 185,
        "SourceTimestamp": "2020-04-28T08:00:12.3519286Z",
        "ServerTimestamp": "2020-04-28T11:52:45.9710681Z"
      },
      "SequenceNumber": 265,
      "ExtensionFields": {
        "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
        "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
      }
    },
    {
      "NodeId": "http://opcfoundation.org/Quickstarts/ReferenceApplications#s=%2fStatic%2fAll+Profiles%2fScalar%2fAccessLevel_CurrentRead_NotUser",
      "EndpointUrl": "opc.tcp://172.17.126.1:51210/UA/Server",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Timestamp": "2020-04-28T11:57:13.0102308Z",
      "Value": {
        "StatusCode": {
          "Symbol": "BadUserAccessDenied",
          "Code": 2149515264
        },
        "ServerTimestamp": "2020-04-28T11:52:45.9710681Z"
      },
      "SequenceNumber": 265,
      "ExtensionFields": {
        "PublisherId": "LegacyPublisher_IndustrialHost01_opcpublisher",
        "DataSetWriterId": "opc.tcp://172.17.126.1:51210/UA/Server"
      }
    }
  ],
  "enqueuedTime": "2020-04-28T11:57:13.178Z",
  "properties": {
    "iothub-creation-time-utc": "2020-04-28T11:57:13.0189396Z",
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/ua+json",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "04/28/20 11:57:13 AM"
  }
}

Legacy compatibibility mode (reduced) message sample

Compatible with the Legacy IIoT Platform respective Connected Factory 1.0.Publisher to be started in standalone mode with --fm=false argument

{
  "body": {
    "NodeId": "http://test.org/UA/Data/#i=10846",
    "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
    "Value": {
      "Value": 116,
      "SourceTimestamp": "2020-04-28T11:41:32.3259078Z"
    }
  },
  "enqueuedTime": "2020-04-28T11:41:33.318Z",
  "properties": {
    "iothub-creation-time-utc": "2020-04-28T11:41:33.0261813Z",
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/opcua+uajson",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "04/28/20 11:41:33 AM"
  }
}


{
  "body": {
    "NodeId": "http://opcfoundation.org/Quickstarts/ReferenceApplications#s=%2fStatic%2fAll+Profiles%2fScalar%2fAccessLevel_CurrentRead_NotUser",
    "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
    "Value": {
      "StatusCode": {
        "Symbol": "BadUserAccessDenied",
        "Code": 2149515264
      },
      "SourceTimestamp": "2020-04-28T11:41:31.7725401Z"
    }
  },
  "enqueuedTime": "2020-04-28T11:41:32.896Z",
  "properties": {
    "iothub-creation-time-utc": "2020-04-28T11:41:32.5830272Z",
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/opcua+uajson",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "04/28/20 11:41:32 AM"
  }
}

Message example with batching/bulk mode enabled Publisher to be started in standalone mode with --bs=5 argument, where 5 is the number of data-changes to be batched.

{
  "body": [
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Value": {
        "Value": -41,
        "SourceTimestamp": "2020-04-28T12:06:56.292833Z"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Value": {
        "Value": -48,
        "SourceTimestamp": "2020-04-28T12:06:57.2936057Z"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Value": {
        "Value": 73,
        "SourceTimestamp": "2020-04-28T12:06:58.293828Z"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Value": {
        "Value": 113,
        "SourceTimestamp": "2020-04-28T12:06:59.2945039Z"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10218",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Value": {
        "Value": 185,
        "SourceTimestamp": "2020-04-28T12:07:00.255784Z"
      }
    },
    {
      "NodeId": "http://opcfoundation.org/Quickstarts/ReferenceApplications#s=%2fStatic%2fAll+Profiles%2fScalar%2fAccessLevel_CurrentRead_NotUser",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Value": {
        "StatusCode": {
          "Symbol": "BadUserAccessDenied",
          "Code": 2149515264
        },
        "SourceTimestamp": "2020-04-28T12:07:00.255784Z"
      }
    },
    {
      "NodeId": "http://test.org/UA/Data/#i=10845",
      "ApplicationUri": "urn:IndustrialHost01:OpcUaServer",
      "Value": {
        "Value": 119,
        "SourceTimestamp": "2020-04-28T12:07:00.3068881Z"
      }
    }
  ],
  "enqueuedTime": "2020-04-28T12:07:01.347Z",
  "properties": {
    "iothub-creation-time-utc": "2020-04-28T12:07:01.2390837Z",
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/ua+json",
    "$$ContentEncoding": "utf-8",
    "$$CreationTimeUtc": "04/28/20 12:07:01 PM"
  }
}

From Event Hub - Generated by the Telemetry Processor

Samples Mode

Message body is

{
  "publisherId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "dataSetClassId": "http://test.org/UA/Data/#i=10845",
  "dataSetWriterId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "sequenceNumber": 0,
  "metaDataVersion": "1.0",
  "status": "Good",
  "timestamp": "2020-03-24T23:54:23.4955724Z",
  "payload": {
    "http://test.org/UA/Data/#i=10845": {
      "value": 27,
      "sourceTimestamp": "2020-03-24T23:54:23.1307846Z",
      "serverTimestamp": "2020-03-24T23:54:23.1307846Z"
    }
  }
}

OPC UA Pub/Sub Mode

Message body is

{
  "messageId": "21",
  "publisherId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "dataSetClassId": "78c4e91c-82cb-444e-a8e0-6bbacc9a946d",
  "dataSetWriterId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "sequenceNumber": 21,
  "metaDataVersion": "1.1",
  "status": "Good",
  "timestamp": "2020-03-25T00:00:28.5713393Z",
  "payload": {
    "http://test.org/UA/Data/#i=10845": {
      "value": -91,
      "sourceTimestamp": "2020-03-25T00:00:28.0498921Z",
      "serverTimestamp": "2020-03-25T00:00:28.0498921Z"
    },
    "http://test.org/UA/Data/#i=10846": {
      "value": 89,
      "sourceTimestamp": "2020-03-25T00:00:28.0498921Z",
      "serverTimestamp": "2020-03-25T00:00:28.0498921Z"
    }
  }
}