Skip to content

SamplingContext Should be available for testing #4439

@kylannjohnson

Description

@kylannjohnson

Problem Statement

Recently, SamplingContext's constructor was marked as Deprecated (probably in 8.x) simply because "only the SDK should call it". However, I use it directly for testing. In unit tests, for example, i have an abridged version of ITransaction that allows me to assert that a type started a transaction. In order to incorporate my sampling rate, I inject my sampling callback (via dagger) into the type so that the same callback is used everywhere.

Solution Brainstorm

I would like this constructor to not go away so that I can continue testing. If Sentry has any plans for a testing framework, I can share the ways in which i test with sentry enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions