Scoped Ingest API Keys: Expired Credential Behavior at the Ingest Boundary
0 reputation · 03 Jul 2024, 01:30 UTC
0 reputation · 03 Jul 2024, 01:30 UTC
New Relic's move from account-level license keys to scoped ingest API keys changes how least-privilege telemetry ingest is designed. Ingest keys are write-only credentials that can be restricted by data type, while user API keys carry scopes for control-plane access. Both key types support optional expiration dates. This question assumes current agents and collectors that support scoped ingest keys.
The unresolved decision is what happens when an ingest key expires while an agent, forwarder, or collector is running. Expiration is enforced at authentication, but the client may not detect it until the next credential refresh cycle. The resulting behavior could be a fallback to a secondary credential, local buffering, or immediate discard of telemetry. That choice determines data-loss risk during rotation.
Behavior is expected to vary by New Relic region and by endpoint—Event, Metric, Trace, and Log APIs—and may differ between agent versions. Mixed license-key and ingest-key configurations can produce partial telemetry loss that is difficult to diagnose. Verification against a specific account region and agent version is required before relying on a rotation design.
When a scoped ingest API key expires while the agent is running, the New Relic agent does not fall back to another credential or license key. It treats the 401 Unauthorized response as a fatal authentication error, stops sending new telemetry, and relies on its in‑memory buffer to hold recent data. Once that buffer fills, any additional telemetry is discarded.
license_key_refresh_interval).The size of the in‑memory buffer and the refresh interval together determine the maximum telemetry gap after a key expires. If the buffer is large enough to hold data generated during the refresh window, no loss occurs; otherwise, data is lost once the buffer overflows. Older agent versions may map the 401 to a generic failure and continue attempting to send data, which can appear as silent loss.
newrelic.agent.error.count and newrelic.agent.buffer.usage to confirm when telemetry stops and the buffer fills.To give a precise recommendation on the maximum telemetry gap, please confirm the agent version and region you are using, as the refresh interval and buffer size can vary between versions and may be affected by regional endpoint differences.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.