Skip to content

feat(region): add GOV/FedRAMP region support - #1866

Merged
pranav-new-relic merged 1 commit into
mainfrom
feature/jp-region-tests
Jul 17, 2026
Merged

feat(region): add GOV/FedRAMP region support#1866
pranav-new-relic merged 1 commit into
mainfrom
feature/jp-region-tests

Conversation

@pranav-new-relic

Copy link
Copy Markdown
Member

Summary

  • Accepts both GOV and FEDRAMP as valid values for NEW_RELIC_REGION — via environment variable, newrelic profile add --region, and newrelic config set
  • Bumps newrelic-client-go to v2.91.0 which introduces the GOV region with FedRAMP-compliant endpoints
  • Updates all user-facing strings (error messages, help flags) to list both GOV and FEDRAMP
  • Adds an explicit GOV/FEDRAMP branch in platform_link_generator; falls back to one.newrelic.com since no public GOV platform hostname exists

FEDRAMP is a user-facing alias for GOV. Both flow through nrRegion.Parse() which normalises either to region.GOV, ensuring consistent FedRAMP-compliant endpoint selection regardless of spelling.

Changes

File What changed
go.mod newrelic-client-go v2.86.1 → v2.91.0 (drops local replace directive)
internal/config/config.go Added "FEDRAMP" to StringInStrings allowed list (case-insensitive)
internal/install/command.go Error message lists "GOV" and "FEDRAMP"
internal/profile/command.go Valid values slice and --region flag description include FEDRAMP
internal/install/execution/platform_link_generator.go Explicit GOV/FEDRAMP case with US fallback and comment

Endpoint summary (from v2.91.0 Go client)

Field GOV URL Status
NerdGraph gov-api.newrelic.com/graphql ✅ confirmed 200
Infrastructure gov-infra-api.newrelic.com/v2 ✅ infra agent reports successfully
Insights/Event API gov-insights-collector.newrelic.com/v1 ✅ confirmed 200; US endpoint 403s
Logs gov-log-api.newrelic.com/log/v1 ✅ per FedRAMP docs
Metrics gov-metric-api.newrelic.com/metric/v1 ✅ per FedRAMP docs
REST gov-api.newrelic.com/v2 Same host as NerdGraph
Synthetics / InsightsKeys / Blob US fallback No GOV variants exist (DNS 000)

Test plan

  • newrelic profile add --region GOV — accepted, stored as gov
  • newrelic profile add --region FEDRAMP — accepted (new), stored as fedramp
  • NEW_RELIC_REGION=GOV newrelic install -n ebpf-agent-installer — all requests route to gov-api.newrelic.com and gov-insights-collector.newrelic.com; install completes successfully on Ubuntu 22.04 EC2
  • NEW_RELIC_REGION=FEDRAMP via env var — accepted, Parse("fedramp") returns region.GOV
  • US insights-collector 403s with GOV license key; GOV insights-collector 200s — confirms correct cell routing

Known gaps (separate work items)

  1. eBPF agent (Kapil's team): v1.4.5 maps region=GOV to otlp.nr-data.net (US OTLP) instead of gov-otlp.nr-data.net → 403 on all OTLP exports. Fix is in env.cc of the eBPF binary.
  2. Infra recipe (open-install-library): infrastructure-agent-installer recipe does not write fedramp: true to /etc/newrelic-infra.yml when the region is GOV. Without it the infra agent 401s against the US ingest endpoint.

🤖 Generated with Claude Code

@pranav-new-relic
pranav-new-relic force-pushed the feature/jp-region-tests branch 2 times, most recently from 72c8866 to c9635c0 Compare July 16, 2026 17:55
- Accept both 'GOV' and 'FEDRAMP' as valid values for NEW_RELIC_REGION
  via env var, newrelic profile add --region, and config set
- Bump newrelic-client-go to v2.91.0 which defines the GOV region with
  FedRAMP-compliant endpoints (gov-api, gov-infra-api, gov-insights-
  collector, gov-log-api, gov-metric-api)
- Update error message to list both GOV and FEDRAMP
- Add explicit GOV/FEDRAMP branch in platform_link_generator; falls back
  to one.newrelic.com since no public GOV platform hostname exists

FEDRAMP is treated as an alias for GOV throughout: the Go client's
Parse() normalises both to region.GOV ensuring consistent endpoint
resolution regardless of which spelling the user provides.
@pranav-new-relic

Copy link
Copy Markdown
Member Author

Note on failing Windows E2E checks

The three failing checks (EU-windows2019.json, JP-windows2019.json, infra-win2016.json) are a pre-existing infrastructure flakiness issue unrelated to the changes in this PR.

Evidence: PR #1854 (an unrelated profile fix, open for weeks) has the exact same three Windows failures — #1854

Root cause: The Windows E2E tests install the infra agent via MSI on t3.micro EC2 instances in EU/JP AWS regions. The MSI installation occasionally exceeds the 234-second Ansible timeout under degraded EC2 performance. The failure message is always Failed to validate that Infrastructure Agent\s+\(installed\) is in output — meaning the install started but didn't complete in time.

Our changes only touch:

  • internal/config/config.go — adds FEDRAMP to allowed region values
  • internal/install/command.go — updates an error message string
  • internal/install/execution/platform_link_generator.go — adds a URL branch for GOV/FEDRAMP
  • internal/profile/command.go — adds FEDRAMP to valid values list
  • go.mod / go.sum — bumps newrelic-client-go v2.86.1 → v2.91.0

None of these touch the Windows install path. All other checks (Linux infra, compile, lint, unit tests, integration tests) pass cleanly.

Requesting reviewer override on the Windows checks. Happy to provide any additional evidence.

@pranav-new-relic

Copy link
Copy Markdown
Member Author

good for a temporary addition; let's harden this in upcoming PRs

@pranav-new-relic
pranav-new-relic merged commit 591d407 into main Jul 17, 2026
97 of 109 checks passed
@pranav-new-relic
pranav-new-relic deleted the feature/jp-region-tests branch July 17, 2026 02:47
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.

2 participants