I need to send attributes in the northbound direction containing metadata to the CrateDB time series. Sample of the attribute format:
{
"object_id": "AGV_Error",
"name": "AGV_Error",
"type": "Integer",
"value": 0,
"metadata": {
"avg": {
"value": 25.6,
"type": "Number"
},
"accuracy": {
"value": 98.7,
"type": "Number"
}
}
}
Although the attribute value is successfully stored in CrateDB, I am still unable to store the metadata. I have tried to check if it is possible to add the metadata inside the subscriptions, but I have not found relevant documentation.
Any suggestions?
Update
Following Filtering out attributes and metadata recommendation, I have included the metadata variable as part of the notifications. E.g.:
"notification": {
"http": {"url": "http://quantumleap:'$QUANTUMLEAP_PORT'/v2/notify"},
"attrs": [
....
"AGV_Error",
"avg_AGV_Error",
...
Then, I attempted to insert the metadata without results. E.g.:
curl -s -o /dev/null -X PUT \
'http://XXXX:1026/v2/entities/urn:ngsi-ld:Agv:002/attrs/AGV_Error' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /northbound' \
-d '{
"value": 86,
"type": "Number",
"metadata": {
"avg_AGV_Error": {
"value": 25.6,
"type": "Number"
},
"accuracy_AGV_Error": {
"value": 98.7,
"type": "Number"
}
}
}'
AGV_Error
value is successfully updated in CrateDB, but not the metadata. Consider that the information in Mongo DB has not been updated either. This is the orion log:
time=2023-05-18T12:22:47.313Z | lvl=INFO | corr=b2cd8bb6-f576-11ed-9554-0242ac12010b | trans=1684405275-107-00000001503 | from=X.X.X.X | srv=openiot | subsrv=/northbound | comp=Orion | op=logTracing.cpp[148]:logInfoRequestWithPayload | msg=Request received: PUT /v2/entities/urn:ngsi-ld:Agv:002/attrs/AGV_Error, request payload (212 bytes): {
"value": 86,
"type": "Number",
"metadata": {
"avg_AGV_Error": {
"value": 125.6,
"type": "Number"
},
"accuracy_AGV_Error": {
"value": 108.7,
"type": "Number"
}
}
}, response code: 204