About the Push Metrics REST API
Last updated on 09 September, 2024You can use the LogicMonitor Push Metrics REST API to programmatically push metrics for multiple instances associated with a single resource and DataSource. You can also manage some aspects of the associated resource and DataSource.
Base URL: https://{ACCOUNTNAME}
.logicmonitor.com/rest
Where ACCOUNTNAME
is replaced with your LogicMonitor account name.
Authentication
The Push Metrics REST API requires API token authentication. LogicMonitor REST API uses the same API token authentication. For more information, see Using LogicMonitor’s REST API.
Note: At a minimum, the role associated with the API-only user account must have permissions to manage resources and manage LogicModules. For more information on creating roles and API-only user accounts, see Roles and Users respectively.
Aggregation Interval
The Push Metrics REST API pushes datapoint metrics to instances once per minute. If data is sent frequently (sub-minute intervals), the values are cached, then aggregated using the aggregation method specified. The aggregated value is stored as the datapoint value.
LogicMonitor supports the following aggregation methods:
- Average
- Sum
- Min
- Max
- Percentile
- None (This is the latest value)
The behavior of each aggregation method when data is pushed at sub-minute intervals is exemplified in the following table.
Sub-minute Collection Time/Data Set | Stored Value for Each Aggregation Method | |||||
Average | Sum | Min | Max | Percentile | None | |
12:00:05 = 101 12:00:25 = 101 12:00:45 = 128 | 110 | 330 | 101 | 128 | Dependent on the percentileValue specified* | 128 |
12:01:05 = 125 12:01:25 = 107 12:01:45 = 101 | 111 | 333 | 101 | 125 | Dependent on the percentileValue specified* | 101 |
12:02:05 = 100 12:02:25 = 101 12:02:45 = 105 | 102 | 306 | 100 | 105 | Dependent on the percentileValue specified* | 105 |
For the gauge metric, these values will be stored as-is. For the counter metric, since it is calculating rate per second, the rate is based on the time difference between the prior and current timestamps.
The aggregation method is determined by the dataPointAggregationType field specified in the API request. For more information, see Ingesting Metrics with the Push Metrics REST API.
Metric data time limit can be up to ten minutes in the past to one minute in the future between the API caller and LogicMonitor. Data with timestamps outside this window are ignored. In addition, you cannot send data for an instance with a timestamp previous to any data already ingested by that instance.
Endpoints
The Push Metrics REST API consists of three endpoints:
- https://{ACCOUNTNAME}.logicmonitor.com/rest/metric/ingest. This endpoint ingests multiple metrics for multiple instances associated with a single resource and DataSource. See Ingesting Metrics with the Push Metrics REST API.
- https://{ACCOUNTNAME}.logicmonitor.com/rest/resource_property/ingest. This endpoint updates or adds new properties for existing resources. See Updating Resource Properties with the Push Metrics REST API.
- https://{ACCOUNTNAME}.logicmonitor.com/rest/instance_property/ingest. This endpoint updates or adds new properties for existing instances. See Updating Instance Properties with the Push Metrics REST API.
Status Codes
The status codes returned by the Push Metrics REST API are detailed in About REST API v2.