datadog-api-client-python icon indicating copy to clipboard operation
datadog-api-client-python copied to clipboard

UsageMeteringApi.get_monthly_usage_attribution fails on ApiValueError since Nov 5th

Open cherkaskyb opened this issue 2 months ago • 0 comments

Describe the bug

The get-monthly-usage-attribution endpoint is returning a YYYY-MM formatted string under the usage[].month field. This is the validation that fails as the month field is defined as datetime in the MonthlyUsageAttributionBody

Label the issue properly.

  • Add severity/ - this is a breaking change on a stable public api, so considered quite severe.

To Reproduce

This snipped fails:

from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi
from datadog_api_client import ApiClient, Configuration

request = {
    "start_month": datetime(2025, 11, 4),
    "end_month": datetime(2025, 11, 5),
    "tag_breakdown_keys": "team",
    "fields": "*",
    "include_descendants": True
}

config = Configuration(
    host=host,
    api_key={"apiKeyAuth": api_key, "appKeyAuth": app_key},
)
with ApiClient(config) as client:
    api_instance = UsageMeteringApi(client)
    r = api_instance.get_monthly_usage_attribution(**request)

Expected behavior

for the sdk not to fail, and for the api to process correctly the response coming back from the dd-api.

Screenshots If applicable, add screenshots to help explain your problem.

Environment and Versions (please complete the following information): tested on 2.30.0 and 2.45.0. both failed with the same error

Additional context This started failing at Nov 5'th and worked well up until this point.

cherkaskyb avatar Nov 05 '25 09:11 cherkaskyb