Skip to content

Langfuse tracing customization #2665

@limon8884

Description

@limon8884

Question

Hi guys, I want to use pydantic-ai with langfuse
I setup Angent.instrument_all(), provided langfuse credentials, and the tracing works fine!

However, I need more customization. In particular, I want to provide the existing trace-id (or parent id) where to write traces for pydantic-ai (for example, in this format https://www.w3.org/TR/trace-context/#examples-of-http-traceparent-headers)
I can do this directly in langfuse: https://langfuse.com/docs/observability/features/trace-ids-and-distributed-tracing#:~:text=trace_context%3D%7B%22trace_id%22%3A%20trace_id%7D

So, I am wondering if it is possible to do the same configuration in pydantic-ai?

Additional Context

Versions:
pydantic-ai==0.7.1
Python 3.12.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions