Using creation time for graphs in IOT Central Dashboard

Kokul Jose 321 Reputation points
2021-04-26T17:10:01.283+00:00

I have passes creation time from device to hub by adding the property as follows:

 msg.properties.add('iothub-creation-time-utc', current.toISOString());

And I can see the values in the Raw Values table at IOT Central. But the dashboard/views uses timestamp (time when the IOT Central get the values) which is not relevant in our usecase since there may be offline scenarios.

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
377 questions
{count} votes

Accepted answer
  1. QuantumCache 20,366 Reputation points Moderator
    2021-05-04T15:31:17.18+00:00

    Hello anonymous user, Below is the response from our team, I hope this helps with your initial query.

    If we are setting the header iothub-creation-time-utc header on the message payload (important for the timestamp to be in UTC with NO timezone information, any timezone information will be dropped) then the telemetry tiles will show the data rendered according to the iothub-creation-time-utc

    The naming of this header is not consistent across SDK's, so depending on which SDK we are using, will get a different answer.
    On the dotnet sdk its called CreationTimeUTC IIRC.

    If you are not seeing this behavior, please file a support ticket with Microsoft so we can debug it further.

    *One more thing worth verifying is to please check the creation time actually being sent by the devices.

    Instructions on how to do this can be found here: Troubleshoot device connections to Azure IoT Central | Microsoft Learn

    Likely to pass the params talked about in the docs here, and additionally the --props all flags

    **We should see something like this in the output, the highlighted line below is what is important:

     {    "event": {  
            "origin": "fastsim-iiot-scale-test-ab-1-fastmodel-58",  
            "module": "",  
            "interface": "",  
            "component": "",  
            "properties": {  
                "system": {  
                    "correlation_id": "de2353ac-3e75-df36-f366-f76e326d3053",  
                    "message_id": "c26d9fb0-3a69-2609-ac37-8152c7a438e8"  
                },  
                "application": {  
                    "iothub-connection-device-id": "fastsim-iiot-scale-test-ab-1-fastmodel-58",  
                   //--->"iothub-creation-time-utc": "2021-05-03T20:36:18",<----//  
                    "iothub-interface-id": "",  
                    "iotc-hub-name": "iotc-01cc5318-4ec9-4c46-92df-a1862d8b032f",  
                    "iotc-app-id": "95524991-7449-4bdd-86cf-357f789437cc"  
                }  
            },  
            "annotations": {  
                "iothub-connection-device-id": "fastsim-iiot-scale-test-ab-1-fastmodel-58",  
                "iothub-connection-auth-method": "{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",  
                "iothub-connection-auth-generation-id": "637520526664613270",  
                "iothub-enqueuedtime": 1620074178457,  
                "iothub-message-source": "Telemetry",  
                "x-opt-sequence-number": 427722454,  
                "x-opt-offset": "292568884579272",  
                "x-opt-enqueued-time": 1620074178566  
            },  
    

    Please comment in the below section to get further help in this matter.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.