Get hourly usage attribution
GET {{baseUrl}}/api/v1/usage/hourly-attribution?start_hr=2007-08-06T13:18:56.043Z&end_hr=2007-08-06T13:18:56.043Z&usage_type=profiled_container_usage&next_record_id=c&tag_breakdown_keys=c&include_descendants=true
Get hourly usage attribution. Multi-region data is available starting March 1, 2023.
This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id
is
set in the response. If it is, make another request and pass next_record_id
as a parameter.
Pseudo code example:
response := GetHourlyUsageAttribution(start_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
sleep(5 seconds) # Avoid running into rate limit
response := GetHourlyUsageAttribution(start_month, next_record_id=cursor)
cursor := response.metadata.pagination.next_record_id
END
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
start_hr | string | (Required) Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. | |
end_hr | string | Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending | |
before this hour. | |||
usage_type | string | (Required) Usage type to retrieve. | |
next_record_id | string | List following results with a next_record_id provided in the previous query. | |
tag_breakdown_keys | string | Comma separated list of tags used to group usage. If no value is provided the usage will not be broken down by tags. |
To see which tags are available, look for the value of tag_config_source
in the API response. |
| include_descendants
| boolean | | Include child org usage in the response. Defaults to true
. |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"metadata":{"pagination":{"next_record_id":"reprehenderit proident nostrud sin"}},"usage":[{"hour":"1946-08-21T09:29:32.742Z","org_name":"dolor aliquip Lore","public_id":"enim non magna Excepteur","region":"dolor dolor enim magna et","tag_config_source":"incididunt elit reprehenderit la","tags":{"et3":["datadog-integrations-lab","datadog-integrations-lab"]},"total_usage_sum":-20304147.244460896,"updated_at":"veniam velit dolore eu","usage_type":"logs_indexed_custom_retention_usage"},{"hour":"1995-05-29T23:29:14.363Z","org_name":"nostru","public_id":"aliquip irure in do","region":"irure nisi pariatur","tag_config_source":"nostrud id ullamco laborum","tags":{"nostrud_b":["datadog-integrations-lab","datadog-integrations-lab"]},"total_usage_sum":53754787.27684349,"updated_at":"ullamco ipsum sint commodo","usage_type":"universal_service_monitoring_usage"}]}