Skip to content

feat: SLS-389: add batch ID to log messages - #562

Open
jhcipar wants to merge 2 commits into
mainfrom
jhcipar/SLS-389/batch-log-filter
Open

feat: SLS-389: add batch ID to log messages#562
jhcipar wants to merge 2 commits into
mainfrom
jhcipar/SLS-389/batch-log-filter

Conversation

@jhcipar

@jhcipar jhcipar commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

When batchId is set on a particular job, this threads batch id through and sets it via a context var for workers so that jobs associated with a particular batch include the batch id in log statements.

  • scope batch IDs to each concurrently executing job with ContextVar
  • prefix RunPodLogger messages with [batchId=...]
  • reset batch context after the existing job cleanup flow

Motivation

The existing Tinybird log pipeline preserves message text but drops additional structured fields. Adding the batch token to the message enables filtering without a Tinybird schema migration.

Verification

  • Python module compilation
  • git diff --check
  • independent code review passed with no blocking findings

Related

@jhcipar
jhcipar marked this pull request as ready for review August 4, 2026 17:58
@jhcipar
jhcipar requested review from KAJdev and deanq August 4, 2026 18:00
@jhcipar jhcipar changed the title feat(serverless): add batch ID to log messages feat: SLS-389: add batch ID to log messages Aug 4, 2026
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