Skip to content

Conversation

@alexmojaki
Copy link
Contributor

Followup to #371

@alexmojaki alexmojaki requested a review from Copilot January 14, 2026 16:18
@cloudflare-workers-and-pages
Copy link

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5f1d7d9
Status: ✅  Deploy successful!
Preview URL: https://2c5bdc2e.logfire-docs.pages.dev
Branch Preview URL: https://alex-asgi-tracer-level.logfire-docs.pages.dev

View logs

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the handling of ASGI send/receive span customization by moving the logic from the span processor (which runs after span creation) to the tracer (which runs during span creation). When record_send_receive=True, spans are now created with debug log level attributes directly, rather than modifying them in post-processing.

Changes:

  • Moved ASGI send/receive span log level setting from span processor to tracer creation
  • Removed the on_start override and helper function from MainSpanProcessorWrapper
  • Extended tracer wrapper to handle both filtering and log level setting based on record_send_receive flag

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
logfire/_internal/integrations/asgi.py Enhanced tracer wrapper to set debug log level at span creation time for send/receive spans when recording is enabled
logfire/_internal/exporters/processor_wrapper.py Removed on_start method and _set_log_level_on_asgi_send_receive_spans function as this logic moved to tracer
.claude/settings.local.json Added Claude AI configuration file for test execution permissions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexmojaki alexmojaki merged commit ccda603 into main Jan 14, 2026
20 checks passed
@alexmojaki alexmojaki deleted the alex/asgi-tracer-level branch January 14, 2026 18:48
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