Skip to content

Support OpenTelemetry logs SDK constructor changes#156

Merged
petyosi merged 1 commit into
mainfrom
petyosi/otel-logs-sdk-compat
Jul 3, 2026
Merged

Support OpenTelemetry logs SDK constructor changes#156
petyosi merged 1 commit into
mainfrom
petyosi/otel-logs-sdk-compat

Conversation

@petyosi

@petyosi petyosi commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Support both BatchLogRecordProcessor constructor shapes from @opentelemetry/sdk-logs.

OpenTelemetry SDK logs 0.220.0 changed the processor constructor from the legacy (exporter, config?) form to an options object containing exporter. @pydantic/logfire-node already allows a broad experimental SDK logs peer range, so this keeps current 0.219.x installs working while allowing consumers to resolve 0.220.x once it clears the minimum release age policy.

Changes

  • Add a small constructor compatibility helper for Logfire's logs exporter processor.
  • Add tests covering both the options-object and legacy constructor shapes.
  • Add a patch changeset for @pydantic/logfire-node.

Validation

  • vp run @pydantic/logfire-node#test
  • vp run @pydantic/logfire-node#typecheck
  • pnpm run format-check
  • Push hook package build/test suite

devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4afe2449-84f2-484b-a721-9ce6f2f4d0f6

📥 Commits

Reviewing files that changed from the base of the PR and between 16eec86 and 4262faa.

📒 Files selected for processing (3)
  • .changeset/soft-clouds-logs-sdk.md
  • packages/logfire-node/src/__test__/logsExporter.test.ts
  • packages/logfire-node/src/logsExporter.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • pydantic/logfire (manual)
  • pydantic/pydantic-ai (manual)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/soft-clouds-logs-sdk.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/logfire-node/src/test/logsExporter.test.ts

📝 Walkthrough

Walkthrough

Changes

This change adds makeBatchLogRecordProcessor in logsExporter.ts to construct BatchLogRecordProcessor through the newer options-object form and fall back to the legacy positional form when needed. logfireLogRecordProcessor() now uses that helper. Tests mock @opentelemetry/sdk-logs to verify both constructor shapes, and a changeset records a patch release for @pydantic/logfire-node.

Sequence Diagram(s)

Included above in the hidden review stack artifact.

Estimated code review effort: 2/5

Related issues: None specified.

Related PRs: None specified.

Suggested labels: patch, compatibility, logfire-node

Suggested reviewers: Maintainers of packages/logfire-node

Poem:
A log processor met two forms one day,
An options object, or the old display.
It checked, then chose the path to take,
With tests and changeset in its wake.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: supporting OpenTelemetry logs SDK constructor changes.
Description check ✅ Passed The description is directly related to the changeset and matches the implemented compatibility helper, tests, and changeset entry.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch petyosi/otel-logs-sdk-compat

Comment @coderabbitai help to get the list of available commands.

@petyosi petyosi force-pushed the petyosi/otel-logs-sdk-compat branch from 16eec86 to 4262faa Compare July 3, 2026 11:35
@petyosi petyosi merged commit ce8c66f into main Jul 3, 2026
4 checks passed
@petyosi petyosi deleted the petyosi/otel-logs-sdk-compat branch July 3, 2026 13:27
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