Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
How QueryAlertSummary work in ThingWorx? Where does these data coming from? DB or memory?
Solved! Go to Solution.
Hi,
You are right, even if you purge the Alert History Stream still you will be able to see the Alert summary. Data will not come in Alert history as you have purged it but still, data will come for that Thing/property once you execute QueryAlertSummary or navigate to monitoring->AlertSummary. What's your use case here? Do you want to remove alerts from the summary page? If that's the only thing you want I would suggest you use DeleteAlertFromSummary snippet which we have provided in "AlertFunctions" resource. This will let you remove the alert from the summary. I hope this is the only reason why you wanted to know the source of Alert Summary.
Thank for reaching out to us. Alert summary and Alert history are stream based storage in ThingWorx. Once alert trigger it creates an entry in to associated stream. For ex: you can check AlertHistoryStream under Streams after enabling system objects.
These streams by default use ThingWorx Persistence provider. Ideally when you query you can the result from ThingWorx memory itself.
Refer this article: Link
Hope this help. Regards,
Mohit
Hi Mohit,
I deleted all rows in Stream. QueryAlertHistory return no record. However, QueryAlertSummary still return data. In my opinion, QueryAlertSummary, the scource not coming form Stream table. Could you please help to check where did these data coming from? Many thanks in advance.
As per my understanding there is no separate stream for Alert Summary. When we query alert Summary, data comes from alert history stream only.
Actually inside alert history stream there is a column with name event name. If value of event name= Alert then it will get trigger under Alert summary service. else if event name= AlertACK then it will get trigger under alert history service.
Below are result of my Postgres DB for stream table, check the bold character. First one trigger under summary and second will trigger under history.
"{"name": "anomaly", "message": "Anomaly occurred", "priority": 1, "alertType": "Anomaly", "eventName": "Alert", "description": "", "sourceProperty": "Channel1_Device2_temp"}";"0.0,0.0,0.0"
"{"name": "anomaly", "message": "[Administrator]", "priority": 1, "alertType": "Anomaly", "eventName": "AlertAck", "description": "", "sourceProperty": "Channel1_Device2_temp"}"
In the end everything is getting stored in Alert history only. Hope this make sense.
Regards,
Mohit
Hi,
You are right, even if you purge the Alert History Stream still you will be able to see the Alert summary. Data will not come in Alert history as you have purged it but still, data will come for that Thing/property once you execute QueryAlertSummary or navigate to monitoring->AlertSummary. What's your use case here? Do you want to remove alerts from the summary page? If that's the only thing you want I would suggest you use DeleteAlertFromSummary snippet which we have provided in "AlertFunctions" resource. This will let you remove the alert from the summary. I hope this is the only reason why you wanted to know the source of Alert Summary.
I agree with you. I believe that these kind of alert data was saved in property_vtp table, the value with binary data column high likely content these content.
Hi @OliviaLiu110.
If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon