Skip to content

Tracing a Resource While Staying in Resource #194

Description

@ChristopherDavenport

So here is an approach I found that was able to get correct resource timing.

https://github.com/ChristopherDavenport/natchez-http4s-otel/blob/otel2/core/src/main/scala/io/chrisdavenport/natchezhttp4sotel/ClientMiddleware.scala#L76-L87

I was wondering how I was supposed to trace for the lifetime of a resource while staying in Resource?

Client are Request[F] => Resource[F, Response[F]] so we dont want to directly use the resource in line.

I assumed I would use wrapResource on spanBuilder, but the use seems to still collapse to F rather than maintaining the resource that's necessary to preserve the live tcp connection.

Hoping that someone might have an approach to how to best preserve the resource while tracing a resource?

Metadata

Metadata

Assignees

No one assigned

    Labels

    tracingImprovements to tracing module

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions