Get metric timeseries
/serviceapi/entityModel/uds/metrics
Retrieves Metric data in a given time series.
The defined time series can be either raw data points, aggregated data over a time interval, or split intervals defined by the number of periods in seconds.
Time series follow the format: YYYY-MM-DDTHH:MM:SS.SSSZ
Supported functions:
- STDDEV
- MAX
- MEDIAN
- MIN
- PERCENTILE_DISC
- LAST_VALUE
- FIRST_VALUE
- AVG
Request
- application/json
- dimension(optional): array
-
endTime: string
the end time
-
entityName: string
the entity name
-
entityType: string
the entity type
-
function(optional): string
the aggregate function
-
limit(optional): integer(int32)
the number of entries in the result to be returend in one REST callDefault Value:
2000
-
metric: string
the metric
-
metricGroup(optional): string
the metric group
-
offset(optional): integer(int32)
the offset into the result list when doing a query with limitDefault Value:
0
-
period(optional): string
the period for aggregation in seconds
-
startTime: string
the start time
Response
- application/json
200 Response
object
Describes a metric Timeseries.
-
dataPoints:
array dataPoints
The data points of the metric query
-
dimension(optional):
object dimension
Additional Properties Allowed: additionalPropertiesThe dimension
-
endTime:
string
The end timeExample:
2018-06-23T18:44:30
-
entityName:
string
The entity nameExample:
my_entity_name
-
entityType:
string
The entity typeExample:
my_entity_type
-
function(optional):
string
Allowed Values:
[ "MAX", "MIN", "AVG", "MEDIAN", "STDDEV" ]
The aggregate functionExample:MIN
-
metric:
string
The metricExample:
my_metric
-
metricGroup(optional):
string
The metric groupExample:
my_metric_group
-
period(optional):
integer(int64)
The aggregate time period in secondsExample:
30
-
startTime:
string
The start timeExample:
2018-06-23T17:35:00
object
Examples
There are multiple possibilities to retrieve metric data by time series. In all cases the result is a list of time points in the following format:
{ "entityType": "myHostType", "entityName": "myHostEntity", "metric": "cpuUser", "dimension": { "cpuId": "0" }, "startTime": "2018-10-11T01:00:00.000Z", "endTime": "2018-10-12T12:00:00.000Z", "dataPoints": [ [ "2018-10-11T13:14:15.001Z", 20 ] ], "function": "AVG", "period": 300 }
In the above function, period and dimension are only returned if these options are used. See the following example use cases:
Get all time points from a single entity:
curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/entityModel/uds/metrics?entityType=myHostType&entityName=myHostEntity&startTime=2018-10-11T01:00:00.000Z&endTime=2018-10-12T12:00:00.000Z&metric=cpuUser"
The output shows two results:
{ "entityType": "myHostType", "entityName": "myHostEntity", "metric": "cpuUser", "startTime": "2018-10-11T01:00:00.000Z", "endTime": "2018-10-12T12:00:00.000Z", "dataPoints": [ [ "2018-10-11T13:14:15.001Z", 20 ], [ "2018-10-11T13:14:15.001Z", 10 ] ] }
Get all time points for a given dimension cpuId=0:
curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/entityModel/uds/metrics?entityType=myHostType&entityName=myHostEntity&startTime=2018-10-11T01:00:00.000Z&endTime=2018-10-12T12:00:00.000Z&metric=cpuUser&dimension=cpuId=0"
The result shows the dimension and a single data point:
{ "entityType": "myHostType", "entityName": "myHostEntity", "metric": "cpuUser", "dimension": { "cpuId": "0" }, "startTime": "2018-10-11T01:00:00.000Z", "endTime": "2018-10-12T12:00:00.000Z", "dataPoints": [ [ "2018-10-11T13:14:15.001Z", 20 ] ] }
Get the aggregated average in dimension cpuId=0 in a one day interval:
curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/entityModel/uds/metrics?entityType=myHostType&entityName=myHostEntity&startTime=2018-10-11T01:00:00.000Z&endTime=2018-10-12T12:00:00.000Z&metric=cpuUser&dimension=cpuId=0&function=AVG"
The result shows the dimension and the function used:
{ "entityType": "myHostType", "entityName": "myHostEntity", "metric": "cpuUser", "dimension": { "cpuId": "0" }, "startTime": "2018-10-11T01:00:00.000Z", "endTime": "2018-10-12T12:00:00.000Z", "dataPoints": [ [ "2018-10-11T13:14:15.001Z", 20 ] ], "function": "AVG" }
Get the aggregated average in intervals of 600 seconds:
curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/entityModel/uds/metrics?entityType=myHostType&entityName=myHostEntity&startTime=2018-10-11T01:00:00.000Z&endTime=2018-10-12T12:00:00.000Z&metric=cpuUser&dimension=cpuId=0&function=AVG&period=600"
The result shows that there are two data points, one at 13:15:00 and the other at 13:20:00:
{ "entityType": "myHostType", "entityName": "myHostEntity", "metric": "cpuUser", "dimension": { "cpuId": "0" }, "startTime": "2018-10-11T01:00:00.000Z", "endTime": "2018-10-12T12:00:00.000Z", "dataPoints": [ [ "2018-10-11T13:15:00.000Z", 23 ], [ "2018-10-11T13:20:00.000Z", 44 ] ], "function": "AVG", "period": 300 }Back to Top