Question Krista Koljonen · Dec 4, 2023

Custom Application Metric

I made a custom application metric, imported it to the USER namespace and used:

set status = ##class(SYS.Monitor.SAM.Config).Add.ApplicationClass("historymonitor.errorSensor", "USER")

to add it. When I do 'w status' it returns 1 so it is added but I still can't see the custom metric in the api/monitor/metrics endpoint. Even though I added %DB_USER in the application roles for api/monitor.

Does anyone know where the problem might be that the metrics endpoint still doesn't show my metric?

Comments

Sean McKenna · Dec 4, 2023

Hi Krista,

In System Management Portal, I would look at System Operation > System Logs > System Monitor Log, I have seen errors pop up in there, but that is usually the <Protect> error when you don't have %DB_USER (which you have).

I would also comment out the code in GetSensors to only setting the sensor to a hard coded value, just to make sure the connections are all correct. 

Good Luck!

0
Ashok Kumar Thangavel  May 28 to Sean McKenna

Hi @Sean McKenna  Even though my user has been granted the %DB_NAMESPACE (%DB_HIB) role and ##class(SYS.Monitor.SAM.Config).AddApplicationClass() successfully returns 1, I am still encountering a error and cannot view the metrics.

0