aws_xray_sdk.core.sampling.sampling_rule

Module Contents

class SamplingRule(name, priority, rate, reservoir_size, host=None, method=None, path=None, service=None, service_type=None)

Bases:object

Data model for a single centralized sampling rule definition.

rate
name
priority
reservoir
can_borrow
request_count
borrow_count
sampled_count
match(self, sampling_req)

Determines whether or not this sampling rule applies to the incoming request based on some of the request’s parameters. Any None parameter provided will be considered an implicit match.

is_default(self)
snapshot_statistics(self)

Take a snapshot of request/borrow/sampled count for reporting back to X-Ray back-end by TargetPoller and reset those counters.

merge(self, rule)

Migrate all stateful attributes from the old rule

ever_matched(self)

Returns True if this sample rule has ever been matched with an incoming request within the reporting interval.

time_to_report(self)

Returns True if it is time to report sampling statistics of this rule to refresh quota information for its reservoir.

increment_request_count(self)
increment_borrow_count(self)
increment_sampled_count(self)
_reset_statistics(self)