feat(metricprovider): support per-metric accountId override for New Relic #5031
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 296 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.341
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5031"
general
weight: 0.35
kostis-codefresh
Summary
Adds an optional
accountIdfield to the New Relic metric provider spec. When set, it overrides theaccount-idfrom the profile secret, allowing a single credential/profile to query different New Relic accounts across rollouts. When omitted, theaccount-idfrom the profile secret is used — so the change is fully backward compatible.Motivation
Today the New Relic provider is hard-bound to the account id stored in a single profile secret (
Nrdb.Query(n.AccountID, ...)), and there is no way to target a different account per query. In multi-tenant setups where each team's telemetry lives in its own New Relic account, this forces either one profile secret per account (secret sprawl) or relocating APM data into a central account.The Datadog provider already gained multi-account support in #3787 via a
secretRef. This PR provides the equivalent capability for New Relic, but decouples only the non-secret account id rather than distributing credentials: one shared profile secret continues to hold the API key (a New Relic user key can query multiple accounts), and the account to query is selected per-metric.Changes
NewRelicMetric.AccountID(optional, proto field 4).metric.Provider.NewRelic.AccountIDwhen set; otherwise falls back to the profile secret'saccount-id(unchanged behavior).Backward compatibility
omitempty, new proto tag 4) — existing manifests and controllers are unaffected.account-idremains the default and is still required when no override is set; the runtime requirement (apiKey != "" && accountID != "") is unchanged.Example
Testing
metricproviders/newrelic/newrelic_test.gofor: override takes precedence over the secret, override works when the secret has noaccount-id, and a non-integer override errors.go buildandgo test ./metricproviders/newrelic/...pass.