Skip to content

Conversation

jj22ee
Copy link
Contributor

@jj22ee jj22ee commented Oct 3, 2024

Issue #, if available:

This PR fixes aws-observability/aws-otel-js-instrumentation#79, but in Python
This fixes the bug where:

  • While the subcomponents of XRay Sampler uses ParentBased logic to short-circuit the Parent's Sampling Decision, the XRay Sampling Statistics recording logic is not skipped when a Parent's Sampling Decision is found. This causes XRay Sampler to produce Sampling Statistics based on number of Spans (regardless of Parent's Sampling Decision), while XRay Sampler should produce Sampling Statistics based on number of Traces (aka the number of root Spans that makes the Sampling Decision)

Description of changes:

  1. Wrap entire XRay Sampler Internal Logic under a single ParentBased Sampler
    a. This will reduce lock contention and not over-count sampling statistics.
  2. Remove use of redundant ParentBased Sampler logic for internal subcomponents for XRay Sampler.

Testing:

  1. Added unit tests to verify ParentBased sampling decisions
  2. Original Sampler functionality tested locally using Sampler Test Bed

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jj22ee jj22ee requested a review from a team as a code owner October 3, 2024 21:00
@jj22ee jj22ee force-pushed the xray-sampler-parent-based-stats branch from 2b520c0 to de8b270 Compare October 4, 2024 21:10
@jj22ee jj22ee merged commit 0a936d5 into main Oct 7, 2024
12 checks passed
@jj22ee jj22ee deleted the xray-sampler-parent-based-stats branch October 7, 2024 21:45
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.

[XRay Sampler] - XRay Sampler Statistics reports much higher RequestCount/SampleCount than expected for Sampling Rules
2 participants