Skip to content

beginSegment() should perform sampling if the caller haven't done any sampling decision #74

@yogiraj07

Description

@yogiraj07

Problem

The beginSegment() method doesn't perform sampling if the caller of this method hasn't done any sampling decision.

Background

Currently sampling for a given incoming request is performed by shouldTrace(). By default, this method starts pollers in the background to fetch sampling rules from the X-Ray console and sampling is performed based on fetched sampling rules.

Usecase

Currently, shouldTrace() is only called by AWSXRayServerFilter middleware. In the scenario where a user doesn't want to use AWSXRayServletFilter middleware and instrument application using just beginSegment() and endSegment(), no sampling would be performed. This is due to limitation of beginSegment not performing sampling, if the caller of this method has not performed sampling decision. As a result, all the segments are sampled and sampling rules configured through X-Ray console doesn't have any effect.

Proposed solution

beginSegment should do sampling if the caller hasn't done any sampling.

Reference

AWS X-Ray SDK for .NET/Core has necessary implementation.

Note :

  1. This should be backwards compatible change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions