Rotate the Ingest Key
Replace a traces ingest key without losing traces.
Rotate by running two keys side by side for a few minutes: create a second key, roll it out, wait until nothing uses the old key, then revoke it.
Do not use Rotate for a planned rotation
The panel's Rotate action issues a replacement and revokes the current key in the same step. Every agent that still holds the old key is refused until it reads the new one (about a minute on Kubernetes), and the traces of that minute are lost. Keep Rotate for a key that leaked, where stopping the old key at once matters more.
Steps
Rotating replaces the traces ingest key your agents use with a new one, for example before the old key expires. Follow these steps for a planned rotation:
-
Create a second traces key in the panel (Services & APM → Credentials → Create credential).
-
Put the new key everywhere the old one is. On Kubernetes, update the Secret in every traced namespace:
printf 'New traces key (paste it once, then press Enter): ' && read -rs LOGDROP_TRACE_KEY && echo if [[ $LOGDROP_TRACE_KEY == ldtk_* && ${#LOGDROP_TRACE_KEY} -eq 71 ]]; then for ns in <namespace> <namespace>; do kubectl -n "$ns" create secret generic logdrop-trace-ingest-key \ --from-literal=trace-ingest-key="$LOGDROP_TRACE_KEY" --dry-run=client -o yaml | kubectl apply -f - done else echo 'That is not one traces key (it starts with ldtk_ and has 71 characters). Paste it once.' fi unset LOGDROP_TRACE_KEYRunning pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the agent re-reads the file every 10 seconds.
Services that pass the key in
LOGDROP_INGEST_KEYinstead of the file need a restart. -
Wait until the new key is in use everywhere: the panel shows its Last used time (updated at most every 5 minutes), and no agent logs
LogDrop rejected the ingest key. Allow at least 10 minutes. -
Revoke the old key.
Things to know
These points describe how agents react when a key changes or is revoked.
- An agent whose key is refused reads the key file again before its next request, so after a revoke it recovers as soon as its file holds a valid key.
- If you mount the Secret yourself instead of through the injector, do not use
subPath: asubPathmount never sees Secret updates. - A running service can also switch keys in code with
LogDropTracing.UpdateIngestCredential(key)fromLogDrop.Api; see Custom spans. - Revoking a key cannot be undone.
.png)