Skip to content

Transform OpenTelemetry log event names before export - #2827

Merged
alexmojaki merged 4 commits into
mainfrom
codex/transform-otel-log-event-name
Nov 18, 2026
Merged

alexmojaki merged 4 commits into
mainfrom
codex/transform-otel-log-event-name

Conversation

@alexmojaki

Copy link
Copy Markdown
Contributor

Summary

  • Apply transform_string to the top-level OpenTelemetry log-record event_name in the same processor as logfire.msg.
  • Give the field its own ('otel_log_event_name',) callback path; retain the input if the callback raises.
  • Cover exported records, console fallback text, and the distinct event.name attribute path.

Validation

  • pytest -q tests/test_secret_scrubbing.py tests/test_otel_logs.py tests/test_console_exporter.py tests/test_stdlib_logging.py (226 passed)
  • Focused pyright, Ruff, and Ruff format checks passed.

This addresses only top-level OpenTelemetry log-record event-name transformation from pydantic/platform#38102.

@veria-ai

veria-ai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Confidence score: 5/5

  • The transform_string docstring in logfire/_internal/scrubbing.py omits top-level log record event names, which are transformed at ('otel_log_event_name',). Update the docstring to include them.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="logfire-sdk/logfire/_internal/scrubbing.py">

<violation number="1" location="logfire-sdk/logfire/_internal/scrubbing.py:271">
P3: The `transform_string` docstring still lists only span names, status descriptions, and event names. Add that top-level log record event names are also transformed, with path `('otel_log_event_name',)`, so callback authors know to handle that path.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  logfire-sdk/logfire/_internal
  scrubbing.py
  logfire-sdk/logfire/_internal/exporters
  logs.py
Project Total  

This report was generated by python-coverage-comment-action


Span names, status descriptions, and event names are also transformed, without pattern matching.
Span names, status descriptions, span event names, and OpenTelemetry log-record event names are also transformed,
without pattern matching. Log-record event names use the path `('otel_log_event_name',)`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop the last sentence

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(AI) Addressed in fdfcf5b.

@alexmojaki
alexmojaki enabled auto-merge November 18, 2026 14:00
@alexmojaki
alexmojaki added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 8c6f41e Nov 18, 2026
32 checks passed
@alexmojaki
alexmojaki deleted the codex/transform-otel-log-event-name branch November 18, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant