Abstract class to provide Sensor metrics for the SAM (System Alerting and Monitoring) application and Prometheus API. More...
Public Member Functions | |
_.Library.Integer | SetSensor (_.Library.String Sensor, _.Library.String Value, _.Library.String Item) |
Override Dashboard sensors which are persistent, and System sensors which get passed to Subscribers. More... | |
_.Library.Integer | SetSensorLabels (_.Library.String Sensor, _.Library.String Value, _.Library.String Labels) |
Extension of SetSensor which allows for multiple Prometheus 'labels' for a metric. More... | |
![]() | |
_.Library.Integer | ClearNotifications () |
USER DOES NOT IMPLEMENT THIS METHOD. More... | |
_.Library.Integer | ClearSensors () |
USER DOES NOT IMPLEMENT THIS METHOD. More... | |
_.Library.Status | GetSensors () |
USER MUST IMPLEMENT THIS METHOD. More... | |
_.Library.Status | LogCon (_.Library.String Msg, _.Library.Integer Severity) |
USER DOES NOT IMPLEMENT THIS METHOD. More... | |
_.Library.Status | LogMsg (_.Library.String msg) |
USER DOES NOT IMPLEMENT THIS METHOD. More... | |
_.Library.Integer | Notify (_.Library.String Sensor, _.Library.Integer Severity, _.Library.String Msg) |
USER DOES NOT IMPLEMENT THIS METHOD. More... | |
_.Library.Status | OpenLog () |
USER DOES NOT IMPLEMENT THIS METHOD. More... | |
_.Library.Status | Start () |
USER MAY IMPLEMENT THIS METHOD. More... | |
Static Public Attributes | |
PRODUCT = None | |
Fill in the Product name here, which will be appended to all metric names. More... | |
Additional Inherited Members | |
![]() | |
Notifications | |
More... | |
State | |
Runtime state. More... | |
Abstract class to provide Sensor metrics for the SAM (System Alerting and Monitoring) application and Prometheus API.
All classes which define SAM metrics should inherit from this class. Users may inherit from this class to create application metrics. The application classes may then be registered using SYS.Monitor.SAM.Config.AddApplicationClass(), and they will be added to the system metrics.
Note that this will be called directly by the SAM REST service, and not by the System Monitor. The main SAM polling API will call GetSensors(), which should create the array of:
SAMValues(key)=value or SAMValues(key,item)=value.
Users may call SetSensor(Sensor, Value, Item) or directly set ..SAMValues for each metric.
All 'values' MUST BE NUMERIC values to be used for SAM and/or Prometheus.
Since this will be called directly by the SAM REST service, users should be careful to not introduce any hangs, pauses, or any coding excesses here, as this may be called at intervals of only a few seconds.
_.Library.Integer SetSensor | ( | _.Library.String | Sensor, |
_.Library.String | Value, | ||
_.Library.String | Item | ||
) |
Override Dashboard sensors which are persistent, and System sensors which get passed to Subscribers.
Just store all Sensors in the local SAMValues array.
Reimplemented from AbstractSensor.
_.Library.Integer SetSensorLabels | ( | _.Library.String | Sensor, |
_.Library.String | Value, | ||
_.Library.String | Labels | ||
) |
Extension of SetSensor which allows for multiple Prometheus 'labels' for a metric.
Labels are passed as an array of label/value pairs, e.g. for a database metric we might use
Labels("id")="USER"
Labels("dir")="c:\\intersystems\\iris\\mgr\\user"
By convention, metrics with a single label value use the "id" key. So, for consistency, multiple labels should always include an "id" label which identifies that metric instance. Other labels can be used to add further information about the metric.
|
static |
Fill in the Product name here, which will be appended to all metric names.
This should be a short, lower-case prefix to indicate the company or application. InterSystems IRIS will use "iris" for system metrics.