OpenMetrics Monitoring
Last updated on 09 September, 2024LogicMonitor has created a monitoring package template that allows you to gather metrics from systems, like Telegraf, that expose metrics in OpenMetrics, an open source metrics exposition format. Previously known as Prometheus, OpenMetrics has been adopted by the Cloud Native Computing foundation, and is in use by a large number of projects.
Because OpenMetrics data can represent any number of metrics from any number of resources, you’ll need to customize both the template DataSource(s) LogicMonitor provides as well as add custom properties to the resource(s) that are exposing the OpenMetrics metrics.
Compatibility
LogicMonitor’s OpenMetrics monitoring package is compatible with any system that exposes metrics in the OpenMetrics format.
Setup Requirements
Import LogicModules
From the LogicMonitor repository, import the appropriate OpenMetrics LogicModule(s). LogicMonitor offers two versions of its OpenMetrics DataSource template:
- OpenMetrics Template. This is the single-instance version. Use this DataSource template if the datapoints do not apply to more than one entity on the same host (e.g. memory usage on the host).
- OpenMetrics Template MultiInstance. This is the multi-instance version. Use this DataSource template if the datapoints do apply to more than one entity on the same host (e.g. core utilization monitoring on a multi-core system).
Clone and Customize LogicModules
Once the OpenMetrics LogicModule(s) have been imported, clone and rename to something more descriptive. For more information on cloning LogicModules, see Cloning a LogicModule.
Edit and/or create datapoints that reflect the data you are looking to capture. Working off the sample datapoints provided in the DataSource template, this process primarily consists of cloning, renaming, and updating the datapoints(s) to reflect the key of the metric to be collected. For more information on configuring datapoints, see Datapoint Overview.
Note: The suggested logic for the AppliesTo field is commented out. In most cases, you’ll want to make this logic active so that the DataSource applies to any hosts with the openmetrics.host property configured (as discussed in a following section) and remove the false() designation. However, if you create multiple clones of the DataSource and you require each clone to apply to unique hosts, then you’ll need to customize the logic in the AppliesTo field in a manner that suits your use case.
Add Hosts Into Monitoring
Add your OpenMetrics host(s) into monitoring if they are not currently present. For more information on adding resources into monitoring, see Adding Devices.
Set Properties on Host
Set the following custom properties on the OpenMetrics host(s) within LogicMonitor. For more information on setting properties, see Resource and Instance Properties.
cpu_usage_guest {"cpu-total",host="telegraf" } 25.3719
cpu_usage_guest {"cpu1",host="telegraf" } 23.1476
cpu_usage_guest {"cpu2",host="telegraf" } 27.4582
cpu_usage_guest {"cpu-total",host="sqlserver" } 40.5491
cpu_usage_guest {"cpu1",host="sqlserver" } 32.1539
cpu_usage_guest {"cpu2",host="sqlserver" } 45.9334
LogicModules in Package
LogicMonitor’s package for OpenMetrics consists of the following LogicModules.
This package does not include predefined datapoint thresholds (i.e. no alerts will trigger based on collected data). This is because the DataSources are provided as templates and designed to be highly customized. In order to receive alerts for collected data, you’ll need to manually create thresholds, as discussed in Tuning Static Thresholds for Datapoints.