Metrics
Published 04 April 2024
The Metrics endpoints allow you to retrieve metric types and metric samples for a certain date range. Additional documentation for this endpoint can be found by navigating to http://your-web-server:port/api-docs.
Metric Types
/api/v1/metrics/types
The metric types endpoint provides a list of metric types in Redgate monitor that are required to query metric samples using the metrics endpoint.
Note: Each monitored entity supports different metrics types, for a list of metric types supported by each monitored entity please refer to metric type to monitored entity mapping
Attributes
| id | The unique identifier for the metric type |
|---|---|
| name | Name of the metric type |
| category | Category of the metric eg: Machine, SqlServer |
Limitation
| Rate limit | Defaults to 100 API requests per minute, you can refer rate limiting to change these default values. |
|---|
Metrics
/api/v1/metrics
The metrics endpoint provides a list of metrics per monitored entity for a given metric type
This endpoint consists of a large amount of Data, It is recommended that you use the query parameters where possible to limit the amount of data returned by the endpoints.
Parameters
| Name | Mandatory/Optional | Type | Default | Description |
|---|---|---|---|---|
| MetricTypeId | Mandatory | String | None | Metric type ID which can be retrieved from the metric types endpoint |
| MonitoredEntityId | Optional | String | None | Monitored entity ID which can be retrieved from the monitored entities endpoint, can be used to restrict the result to a single monitored entity |
| Start | Optional | DateTime | current DateTime - 1hour | The date and time used to filter the metrics on the time the metric was collected, can be used to retrieve metric samples collected after the specified date and time. |
| End | Optional | DateTime | current DateTime | The date and time used to filter the metrics on the time the metric was collected, can be used to retrieve metric samples collected before the specified date and time. |
| MaxSampleCount | Optional | Number | 100 | The maximum number of samples retrieved per entity for the specified metric type, this value retrieves a single sample for a block of time by dividing the time between the start and end values into equal blocks. |
Attributes
| metricType | The id and name of the metric type |
|---|---|
| monitoredEntity | id and name of the monitored entity the alert was raised on. |
| targetName | The name of the target entity the metric samples are collected against value can be Machine name, Database name etc. |
| data | DateTime and value of the metric sample |
Limitation
| Date Range | Maximum range of 31 Days |
|---|---|
| MaxSampleCount | Cannot exceed 500 and minimum value is 50 |
| Rate limit | Defaults to 100 API requests per minute, you can refer rate limiting to change these default values. |