LogDrop
Backend TracingRust

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 service 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 ingest key your services send with, for example before it expires. Both keys work until you revoke the old one in step 4, so no traces are lost.

  1. Create a second traces key in the panel (Services & APM → Credentials → Create credential).

  2. 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_KEY

    Running pods pick the new key up without a restart: the kubelet refreshes the mounted Secret within about a minute, and the crate re-reads the file every 10 seconds.

    Outside Kubernetes, replace the content of the key file (LOGDROP_INGEST_KEY_FILE); the crate picks it up within 10 seconds. Services that pass the key in LOGDROP_INGEST_KEY instead of a file need a restart.

  3. Wait until the new key is in use everywhere: the panel shows its Last used time (updated at most every 5 minutes), and no service logs LogDrop rejected the ingest key. Allow at least 10 minutes.

  4. Revoke the old key.

Things to know

These points describe how running services pick up a new key, and what cannot be undone.

  • A service 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: a subPath mount never sees Secret updates.
  • A running service can also switch keys in code with logdrop::update_ingest_credential(key); see Custom spans.
  • Revoking a key cannot be undone.

On this page