Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
This repository was archived by the owner on Oct 30, 2025. It is now read-only.

Add deterministic sampling #2

@styfle

Description

@styfle

We need a way to set the sampling rate but this really only needs to happen once, probably in the tracer.

Something like this

const tracer = new Tracer('service-name', {
  writeKey: process.env.HONEYCOMB_KEY,
  dataset: process.env.HONEYCOMB_DATASET,
  deterministicSampleRate: process.env.HONEYCOMB_SAMPLE_RATE,
});

This will initialize a new instance of the Deterministic sampler.

Then all spans can use this in the finish() method to basically skip sending the data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions