Skip to content

feat(otel): forward loguru extras to OTLP logs - #115

Merged
olivermeyer merged 1 commit into
mainfrom
feat/VPTHP-75-forward-loguru-extras-otlp
Aug 20, 2026
Merged

feat(otel): forward loguru extras to OTLP logs#115
olivermeyer merged 1 commit into
mainfrom
feat/VPTHP-75-forward-loguru-extras-otlp

Conversation

@olivermeyer

Copy link
Copy Markdown
Collaborator

Why?
foundry-core's OTLP log bridge dropped loguru's bound extra fields, so cutting pviz's logs over to OTLP (VPTHP-75) would silently lose every logger.bind() field — job_id, integration_type, queue, step. This foundry-core enhancement is Part A of that ticket and must ship before the pviz log cutover can land without regressing structured logging.

How?
_make_otel_log_sink now flattens each record["extra"] field onto the constructed stdlib LogRecord.__dict__, so OTel's LoggingHandler maps every bound field to its own top-level OTLP log attribute rather than a nested dict; keys colliding with reserved LogRecord attributes are skipped so a bound field can never corrupt a record's standard fields.

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
src/aignostics_foundry_core/otel.py 100.00% <100.00%> (ø)

@olivermeyer
olivermeyer force-pushed the feat/VPTHP-75-forward-loguru-extras-otlp branch from 3928bbf to cfef7e8 Compare August 20, 2026 14:16
@olivermeyer
olivermeyer marked this pull request as ready for review August 20, 2026 14:16
@olivermeyer
olivermeyer requested a review from a team as a code owner August 20, 2026 14:16
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@olivermeyer
olivermeyer force-pushed the feat/VPTHP-75-forward-loguru-extras-otlp branch from cfef7e8 to 2ad5b8e Compare August 20, 2026 14:44
@sonarqubecloud

Copy link
Copy Markdown

@olivermeyer
olivermeyer merged commit 907b0cd into main Aug 20, 2026
12 checks passed
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.

2 participants