usage_top_avg_metrics
Creates, updates, deletes, gets or lists a usage_top_avg_metrics resource.
Overview
| Name | usage_top_avg_metrics |
| Type | Resource |
| Id | datadog.organization.usage_top_avg_metrics |
Fields
The following fields are returned by SELECT queries:
- get_usage_top_avg_metrics
| Name | Datatype | Description |
|---|---|---|
metric_name | string | Contains the custom metric name. |
avg_metric_hour | integer (int64) | Average number of timeseries per hour in which the metric occurs. |
max_metric_hour | integer (int64) | Maximum number of timeseries per hour in which the metric occurs. |
metric_category | string | Contains the metric category. (standard, custom) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_usage_top_avg_metrics | select | month, day, names, limit, next_record_id | Get all [custom metrics](https://docs.datadoghq.com/developers/metrics/custom_metrics/) by hourly average. Use the month parameter to get a month-to-date data resolution or use the day parameter to get a daily resolution. One of the two is required, and only one of the two is allowed. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
day | string (date-time) | Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD] for usage beginning at this hour. (Either month or day should be specified, but not both) |
limit | integer (int32) | Maximum number of results to return (between 1 and 5000) - defaults to 500 results if limit not specified. |
month | string (date-time) | Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour. (Either month or day should be specified, but not both) |
names | array | Comma-separated list of metric names. |
next_record_id | string | List following results with a next_record_id provided in the previous query. |
SELECT examples
- get_usage_top_avg_metrics
Get all custom metrics by hourly average. Use the month parameter to get a month-to-date data resolution or use the day parameter to get a daily resolution. One of the two is required, and only one of the two is allowed.
SELECT
metric_name,
avg_metric_hour,
max_metric_hour,
metric_category
FROM datadog.organization.usage_top_avg_metrics
WHERE month = '{{ month }}'
AND day = '{{ day }}'
AND names = '{{ names }}'
AND limit = '{{ limit }}'
AND next_record_id = '{{ next_record_id }}'
;