Skip to content

Update DDOGTracer to work with AsyncDriver #1236

@rwhitten577

Description

@rwhitten577

Is your feature request related to a problem? Please describe.
The current DDOGTracer with AsyncDriver creates a span for each Hamilton function/node when it creates a coroutine, but doesn't track when the function actually runs. It would be great to have it track timing of the actual function body execution for more accurate metrics.

Also when using Hamilton in a FastAPI app, the FastAPI middleware tracer is not correlating the Hamilton trace as a child, i.e. 2 separate traces appear in DataDog. Ideally the Hamilton trace uses the current FastAPI request trace as its parent.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
Open to using the OTel adapter instead of DDog if it's any easier to implement these changes.

Additional context
Slack thread: https://hamilton-opensource.slack.com/archives/C03M33QB4M8/p1731597046007369

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions