Get hourly usage attribution

GET {{baseUrl}}/api/v1/usage/hourly-attribution?start_hr=1992-04-06T18:39:52.088Z&end_hr=1992-04-06T18:39:52.088Z&usage_type=mobile_app_testing_usage&next_record_id=exercitation consequat&tag_breakdown_keys=exercitation consequat&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

KeyDatatypeRequiredDescription
start_hrstring(Required) Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.
end_hrstringDatetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending
before this hour.
usage_typestring(Required) Usage type to retrieve.
next_record_idstringList following results with a next_record_id provided in the previous query.
tag_breakdown_keysstringComma 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

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{"metadata":{"pagination":{"next_record_id":"cupidatat ullamco veniam deserunt est"}},"usage":[{"hour":"1995-08-16T13:37:15.431Z","org_name":"exerc","public_id":"exercitation","region":"sed","tag_config_source":"Excepteur elit nulla labore incididunt","tags":{"consectetur_4":["datadog-integrations-lab","datadog-integrations-lab"],"sunt_4c":["datadog-integrations-lab","datadog-integrations-lab"],"ea977":["datadog-integrations-lab","datadog-integrations-lab"],"anim_07_":["datadog-integrations-lab","datadog-integrations-lab"]},"total_usage_sum":95420425.2134088,"updated_at":"cupidatat Excepteur ad commodo","usage_type":"estimated_indexed_logs_usage"},{"hour":"1964-05-06T16:42:59.351Z","org_name":"proident Lorem veniam in in","public_id":"in incididunt","region":"dolore","tag_config_source":"min","tags":{"aute_f2":["datadog-integrations-lab","datadog-integrations-lab"],"et0":["datadog-integrations-lab","datadog-integrations-lab"],"ullamco_4d":["datadog-integrations-lab","datadog-integrations-lab"]},"total_usage_sum":17546598.908168003,"updated_at":"do ad culpa ipsum","usage_type":"custom_timeseries_usage"}]}