Skip to content

Conversation

@bantonsson
Copy link
Collaborator

What does this PR do?

This PR currently hides all the OTel specific things in the sampling code behind traits, so the sampling logic can be moved to a separate crate.

Motivation

Make the sampling code more generic and move it into a separate crate so it can be reused.

Additional Notes

The benchmarks are on par with the original code. Some improvements and a few minor regressions. There will be additional changes that move the code out.

pub struct TraceRootSamplingInfo {
mechanism: SamplingMechanism,
rate: f64,
rl_effective_rate: Option<i32>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rl_effective_rate: Option<i32>,
rl_effective_rate: Option<f32>,

? don't we need the rate limiter rate to be a float between 0 and 1?

| mechanism::LOCAL_USER_TRACE_SAMPLING_RULE
| mechanism::REMOTE_USER_TRACE_SAMPLING_RULE
| mechanism::REMOTE_DYNAMIC_TRACE_SAMPLING_RULE
| mechanism::APPSEC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Python we set appsec to AUTO_KEEP/AUTO_REJECT and not user, is USER_PAIR correct here for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants