goauthentik/authentik

Bug: Runtime values are used as structured log event names or field keys

Open

#22196 opened on May 10, 2026

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Python (4,050 stars) (319 forks)batch import
bugbug/confirmedgood first issue

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).

  • key authentik/sources/kerberos/sync.py:74
  • key authentik/sources/ldap/sync/groups.py:127
  • key authentik/sources/ldap/sync/users.py:88
  • msg authentik/blueprints/v1/importer.py:372
  • msg authentik/events/logs.py:40
  • msg authentik/providers/saml/processors/authn_request_parser.py:71
  • msg authentik/tasks/models.py:143
  • msg authentik/tasks/models.py:146
  • msg authentik/tasks/models.py:149
  • msg authentik/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

Contributor guide