Bug: Runtime values are used as structured log event names or field keys
#22196 opened on May 10, 2026
Description
Describe the bug
Bug: Runtime values are used as structured log event names or field keys
Anti-pattern
This report identifies logging calls where dynamic runtime data is used as the log event name or as a structured field key. In structured logging, event names and field keys should be stable schema elements. Runtime-specific data such as IDs, URLs, object names, errors, query labels, or caller-controlled keys should be emitted as field values under stable keys instead of changing the event or key surface.
Impact on observability platforms
When event names or field keys vary with runtime data, observability backends can see unnecessary cardinality growth in log streams, indexes, facets, labels, and dashboards. This makes queries harder to write, splits one logical event across many names or fields, increases storage and indexing cost, and can reduce the usefulness of alerts and aggregations. When opaque identifiers or shifted key/value pairs become field names, the resulting records are also harder for humans to scan and interpret.
Affected entrypoints
Commit: c6b5869b488b07ddd598d1f8066d3d054ae806c0
Found 10 affected entrypoint(s): 7 message-name entrypoint(s), 3 structured-key entrypoint(s).
keyauthentik/sources/kerberos/sync.py:74keyauthentik/sources/ldap/sync/groups.py:127keyauthentik/sources/ldap/sync/users.py:88msgauthentik/blueprints/v1/importer.py:372msgauthentik/events/logs.py:40msgauthentik/providers/saml/processors/authn_request_parser.py:71msgauthentik/tasks/models.py:143msgauthentik/tasks/models.py:146msgauthentik/tasks/models.py:149msgauthentik/tasks/schedules/scheduler.py:26
How to reproduce
Trigger any affected entrypoint listed below and inspect the emitted structured log record.
Expected behavior
Log event names and structured field keys should remain stable across executions. Runtime-specific data should be emitted as structured field values under fixed, descriptive keys.
Screenshots
No response
Additional context
No response
Deployment Method
Docker
Version
c6b5869b488b07ddd598d1f8066d3d054ae806c0
Relevant log output