Skip to content

contrib/starlette: take into account body reading time #1970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

xrmx
Copy link
Member

@xrmx xrmx commented Feb 15, 2024

What does this pull request do?

Create the transaction always before the body is read to avoid discrepancies between cases where the capture_body config on or off.

Related issues

Closes #1948

@github-actions github-actions bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Feb 15, 2024
@xrmx
Copy link
Member Author

xrmx commented Feb 15, 2024

note to self: unit tests does not seem to tests this path

@xrmx xrmx marked this pull request as draft February 15, 2024 14:14
@xrmx
Copy link
Member Author

xrmx commented Feb 15, 2024

note to self: unit tests does not seem to tests this path

tests are there, they just don't run without starlette installed :)

@xrmx xrmx marked this pull request as ready for review February 15, 2024 14:39
Create the transaction always before the body is read to avoid
discrepancies between cases where the capture_body config on or off.

Fix elastic#1948
Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

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

Excellent!

@xrmx xrmx merged commit a1bde22 into elastic:main Feb 16, 2024
xrmx added a commit that referenced this pull request Mar 20, 2024
Create the transaction always before the body is read to avoid
discrepancies between cases where the capture_body config on or off.

Fix #1948
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Starlette/FastAPI body streaming time not included in transaction
2 participants