XRay.Client.
get_sampling_targets
(**kwargs)¶Requests a sampling quota for rules that the service is using to sample requests.
See also: AWS API Documentation
Request Syntax
response = client.get_sampling_targets(
SamplingStatisticsDocuments=[
{
'RuleName': 'string',
'ClientID': 'string',
'Timestamp': datetime(2015, 1, 1),
'RequestCount': 123,
'SampledCount': 123,
'BorrowCount': 123
},
]
)
[REQUIRED]
Information about rules that the service is using to sample requests.
Request sampling results for a single rule from a service. Results are for the last 10 seconds unless the service has been assigned a longer reporting interval after a previous call to GetSamplingTargets.
The name of the sampling rule.
A unique identifier for the service in hexadecimal.
The current time.
The number of requests that matched the rule.
The number of requests recorded.
The number of requests recorded with borrowed reservoir quota.
{
'SamplingTargetDocuments': [
{
'RuleName': 'string',
'FixedRate': 123.0,
'ReservoirQuota': 123,
'ReservoirQuotaTTL': datetime(2015, 1, 1),
'Interval': 123
},
],
'LastRuleModification': datetime(2015, 1, 1),
'UnprocessedStatistics': [
{
'RuleName': 'string',
'ErrorCode': 'string',
'Message': 'string'
},
]
}
Response Structure
Updated rules that the service should use to sample requests.
Temporary changes to a sampling rule configuration. To meet the global sampling target for a rule, X-Ray calculates a new reservoir for each service based on the recent sampling results of all services that called GetSamplingTargets.
The name of the sampling rule.
The percentage of matching requests to instrument, after the reservoir is exhausted.
The number of requests per second that X-Ray allocated for this service.
When the reservoir quota expires.
The number of seconds for the service to wait before getting sampling targets again.
The last time a user changed the sampling rule configuration. If the sampling rule configuration changed since the service last retrieved it, the service should call GetSamplingRules to get the latest version.
Information about SamplingStatisticsDocument that X-Ray could not process.
Sampling statistics from a call to GetSamplingTargets that X-Ray could not process.
The name of the sampling rule.
The error code.
The error message.
Exceptions
XRay.Client.exceptions.InvalidRequestException
XRay.Client.exceptions.ThrottledException