Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add DeterministicSampler for easier sampling #67

Closed
JamieDanielson opened this issue Feb 12, 2024 · 0 comments · Fixed by #70
Closed

[feat] Add DeterministicSampler for easier sampling #67

JamieDanielson opened this issue Feb 12, 2024 · 0 comments · Fixed by #70
Assignees
Labels
type: enhancement New feature or request
Milestone

Comments

@JamieDanielson
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Add a DeterministicSampler to use in the web SDK, similar to what exists today in the Node Distro, for easier sampling and to add sample rate to allow proper weighted view in Honeycomb.

Describe the solution you'd like

#13 specifically references using a shared package extracted out from the Node Distro and packaged separately to use in both places. For now we're going to essentially copy the functionality into here, and separate the shared dependency later.

@JamieDanielson JamieDanielson added the type: enhancement New feature or request label Feb 12, 2024
@JamieDanielson JamieDanielson added this to the Beta milestone Feb 12, 2024
@JamieDanielson JamieDanielson self-assigned this Feb 12, 2024
JamieDanielson added a commit that referenced this issue Feb 13, 2024
## Which problem is this PR solving?

- Closes #67 

## Short description of the changes

- add Deterministic Sampler
- add sampleRate info to debug
- add unit tests and update smoke test

## How to verify that this has the expected result

```js
  const sdk = new HoneycombWebSDK({
    apiKey: HONEYCOMB_API_KEY,
    serviceName: 'web-distro',
    debug: true,
    sampleRate: 2,
    instrumentations: [getWebAutoInstrumentations()], // add auto-instrumentation
  });
```

With a sampleRate higher than one you may have to generate a few traces
before it shows up in Honeycomb! But with debug enabled at least you can
see the config logged, and also see the "Non recording span" if it's not
going to send because it's being dropped with sampling.

---------

Co-authored-by: Kent Quirk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant