Skip to content

Trace middleware in Fastapi #4397

@Meemaw

Description

@Meemaw

Summary of problem

It seems middlewares are not traced in fastapi.

Moreover, trying to use tracer.get_log_correlation_context() within a middleware will not return any active context, which means we can't operate with traceId (e.g to enrich response/logs within a middleware).

https://fastapi.tiangolo.com/tutorial/middleware/

Which version of dd-trace-py are you using?

1.5.2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions