Skip to content

fix(config): skip api. prefix for on-call domains in DD_SITE - #71

Merged
platinummonkey merged 1 commit into
mainfrom
fix/66-custom-api-url
Feb 17, 2026
Merged

fix(config): skip api. prefix for on-call domains in DD_SITE#71
platinummonkey merged 1 commit into
mainfrom
fix/66-custom-api-url

Conversation

@platinummonkey

Copy link
Copy Markdown
Collaborator

Summary

  • On-call domains like navy.oncall.datadoghq.com are already fully-qualified API endpoints
  • Previously, pup always prepended api. to DD_SITE, resulting in invalid URLs like api.navy.oncall.datadoghq.com
  • Now, when DD_SITE contains oncall, the domain is used as-is

Changes

  • Added IsOnCallSite() to detect on-call domains (pkg/config/config.go:48)
  • Added GetAPIHost() that returns the correct host — skipping api. for on-call sites (pkg/config/config.go:60)
  • Updated GetAPIURL() to delegate to GetAPIHost() (pkg/config/config.go:54)
  • Updated client.go to use cfg.GetAPIHost() instead of hardcoded api.{site} (pkg/client/client.go:108,178)
  • Added tests for IsOnCallSite, GetAPIHost, and on-call domain handling in GetAPIURL and Load

Testing

  • All existing tests pass (no regressions for standard sites)
  • New tests verify on-call domains are used as-is
  • New tests verify standard sites still get api. prefix

Closes #66


🤖 Generated with Claude Code

On-call domains like navy.oncall.datadoghq.com are already
fully-qualified API endpoints. Previously, pup always prepended "api."
to DD_SITE, resulting in invalid URLs like
api.navy.oncall.datadoghq.com.

Now, when DD_SITE contains "oncall", the domain is used as-is for both
the API client host and RawRequest URLs.

Closes #66

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@platinummonkey
platinummonkey requested a review from a team as a code owner February 17, 2026 00:54
@platinummonkey
platinummonkey merged commit 9aa734e into main Feb 17, 2026
5 checks passed
@platinummonkey
platinummonkey deleted the fix/66-custom-api-url branch February 17, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] On-Call requests fail due to invalid domain

1 participant