GetSamplingTargets
Source:
src/AWS/XRay/GetSamplingTargets.ts
Report sampling statistics and receive updated sampling quotas — the second half of the sampling protocol implemented by X-Ray SDK samplers.
Bind the operation in the function’s init phase to get a runtime callable;
provide the implementation with Effect.provide(XRay.GetSamplingTargetsHttp).
The action is account-scoped: X-Ray does not support resource-level
permissions for xray:GetSamplingTargets, so the binding grants it on *.
Sampling
Section titled “Sampling”import * as XRay from "alchemy/AWS/XRay";
// init — grants xray:GetSamplingTargetsconst getSamplingTargets = yield* XRay.GetSamplingTargets();
// runtime — report what this client sampled and receive new quotasconst targets = yield* getSamplingTargets({ SamplingStatisticsDocuments: [ { RuleName: "my-rule", ClientID: "0123456789abcdef01234567", Timestamp: new Date(), RequestCount: 100, SampledCount: 5, }, ],});const documents = targets.SamplingTargetDocuments ?? [];