<#9012 feat: Add `run_id` key to all logs for `mel...
# meltano-repo-activity
g
#9012 feat: Add
run_id
key to all logs for
meltano run
and
meltano el
Pull request opened by edgarrmondragon ## Description Binds the
run_id
to the global logging context. Here's the final event in
meltano run
showing the new key-value pair: { "set_number": 0, "block_type": "ExtractLoadBlocks", "success": true, "err": null, "event": "Block run completed.", "job_name": "dev:tap-getpocket-to-target-jsonl", + "run_id": "7e9dac82-bd61-4da7-b602-772fd49008fc", "level": "info", "timestamp": "2025-01-13T193754.734129Z", "pathname": "/meltano/meltano/src/meltano/cli/run.py", "lineno": 239, "func_name": "_run_blocks" } ## Related Issues • Closes #9005 ## Summary by Sourcery Bind a unique run_id to the global logging context at the start of meltano run and meltano el commands and update structlog configuration to merge context variables so that run_id automatically appears in all log records New Features: • Include run_id in all logs emitted during meltano run and meltano el executions Enhancements: • Add structlog.contextvars.merge_contextvars processor to logging setup for context propagation • Unify logger instantiation in elt.py to use structlog.stdlib.get_logger • Remove manual run_id injection in extract_load event payload in favor of context-based binding meltano/meltano