· 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?

Discussion (1)2
Log in or sign up to continue

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!