Skip to content

Add a testing provider for downstream packages to consume #13

@atheriel

Description

@atheriel

Following up on conversation in r-lib/httr2#729: it's hard to write unit tests that confirm that telemetry is working right now.

Some of the existing otelsdk tests use a pattern of writing spans to disk and then parsing them back to confirm that spans are created correctly:

tmp <- tempfile(fileext = "otel")
on.exit(unlink(tmp), add = TRUE)
trc_prv <- tracer_provider_stdstream_new(tmp)

However, I think we should have an in-memory tracer provider specifically for testing in otel. This is a fairly common pattern in the ecosystem -- see e.g. Logfire, which has a nice API that we could emulate. I noticed the Go SDK has a testing provider as well.

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