Skip to content

[BUG] Datadog plugin: billable-summary rejected with 400 'month must be in the format YYYY-MM' — no costs retrievable #85

Description

@scottt732

Describe the bug
The Datadog plugin can no longer retrieve any costs: every window fails with

error getting dd pricing: error getting usage billable usage summary: 400 Bad Request

The root cause is that GetDDUnitPrices calls GET /api/v1/usage/billable-summary via datadog-api-client-go, which serializes the month query parameter as a full RFC3339 timestamp (e.g. month=2026-07-01T00:00:00Z). The Datadog API now enforces a stricter format and rejects the request:

{"errors":[{"status":"400","title":"Bad Request","detail":"month must be in the format YYYY-MM"}]}

Calling the same endpoint with month=2026-07 (same credentials) succeeds. The API key/app key are valid (/api/v1/validate returns 200), so this is not an auth issue. The current master of datadog-api-client-go still serializes time.Time params as RFC3339, so bumping the client dependency does not help.

Since GetDDUnitPrices has no fallback pricing path, this makes the plugin return zero costs for every window — the plugin is currently unusable.

To Reproduce

  1. Configure the datadog plugin with valid credentials (observed on site us5.datadoghq.com, 2026-07-31)
  2. Trigger any custom-cost ingestion window
  3. Every window logs error getting usage billable usage summary: 400 Bad Request
  4. Reproduce outside the plugin: curl "https://api.us5.datadoghq.com/api/v1/usage/billable-summary?month=2026-07-01T00%3A00%3A00Z" -H "DD-API-KEY: ..." -H "DD-APPLICATION-KEY: ..." → 400 with the error above; change to month=2026-07 → succeeds

Expected behavior
The billable-summary request uses a month format the API accepts, and unit pricing loads.

Which version of OpenCost Plugins are you using?
v0.0.16 (latest; also affects main, which is identical to v0.0.16 for the datadog plugin)

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions