Skip to content

Remove extra FastAPI spans by default - #1268

Merged
alexmojaki merged 4 commits into
mainfrom
alex/fastapi-spans-off
Jul 22, 2025
Merged

alexmojaki merged 4 commits into
mainfrom
alex/fastapi-spans-off

Conversation

@alexmojaki

@alexmojaki alexmojaki commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor

Changes the default of extra_spans (introduced in #1258) in logfire.instrument_fastapi from True to False, and updates docs.

This is a breaking change that will trigger a major version release.

@hyperlint-ai-deprecated

Copy link
Copy Markdown
Contributor

PR Change Summary

Updated the default behavior of extra_spans in logfire.instrument_fastapi from True to False, reflecting a breaking change that will trigger a major version release.

  • Changed the default setting of extra_spans in FastAPI instrumentation to False.
  • Updated documentation to reflect changes in span attributes and their customization.
  • Clarified the behavior of spans for argument parsing and endpoint execution.

Modified Files

  • docs/integrations/web-frameworks/fastapi.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@alexmojaki
alexmojaki requested a review from Copilot July 22, 2025 12:19
@alexmojaki
alexmojaki marked this pull request as ready for review July 22, 2025 12:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 changes the default value of the extra_spans parameter in logfire.instrument_fastapi from True to False, constituting a breaking change that will trigger a major version release. The change aims to reduce span verbosity by default while still providing timing information through span attributes.

  • Changed default extra_spans parameter from True to False in FastAPI instrumentation
  • Updated documentation to reflect new behavior and explain the relationship between attributes and optional spans
  • Clarified that extra spans are now primarily for backwards compatibility and grouping child operations

Reviewed Changes

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

File Description
logfire/_internal/main.py Updates default value of extra_spans parameter to False
logfire/_internal/integrations/fastapi.py Updates default value of extra_spans parameter to False
docs/integrations/web-frameworks/fastapi.md Restructures documentation to emphasize attributes over spans and explains new behavior

@alexmojaki
alexmojaki enabled auto-merge (squash) July 22, 2025 14:54
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 387d7e3
Status: ✅  Deploy successful!
Preview URL: https://ed1997a4.logfire-docs.pages.dev
Branch Preview URL: https://alex-fastapi-spans-off.logfire-docs.pages.dev

View logs

@alexmojaki
alexmojaki merged commit f255281 into main Jul 22, 2025
@alexmojaki
alexmojaki deleted the alex/fastapi-spans-off branch July 22, 2025 14:57
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