| 1 | import type * as xray from "@distilled.cloud/aws/xray"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface GetTraceSegmentDestinationRequest |
| 6 | extends xray.GetTraceSegmentDestinationRequest {} |
| 7 | |
| 8 | /** |
| 9 | * Retrieve the current destination (X-Ray or CloudWatch Logs) of data |
| 10 | * sent to `PutTraceSegments` and the OTLP endpoint. Transaction Search |
| 11 | * trace retrieval requires a CloudWatch Logs destination. |
| 12 | * |
| 13 | * Bind the operation in the function's init phase to get a runtime callable; |
| 14 | * provide the implementation with `Effect.provide(XRay.GetTraceSegmentDestinationHttp)`. |
| 15 | * The action is account-scoped: X-Ray does not support resource-level |
| 16 | * permissions for `xray:GetTraceSegmentDestination`, so the binding grants it on `*`. |
| 17 | * ### Transaction Search |
| 18 | * **Example:** Check the trace segment destination |
| 19 | * ```typescript |
| 20 | * import * as XRay from "alchemy/AWS/XRay"; |
| 21 | * |
| 22 | * // init — grants xray:GetTraceSegmentDestination |
| 23 | * const getTraceSegmentDestination = |
| 24 | * yield* XRay.GetTraceSegmentDestination(); |
| 25 | * |
| 26 | * // runtime |
| 27 | * const destination = yield* getTraceSegmentDestination(); |
| 28 | * const isTransactionSearch = destination.Destination === "CloudWatchLogs"; |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GetTraceSegmentDestination extends Binding.Service< |
| 34 | GetTraceSegmentDestination, |
| 35 | "AWS.XRay.GetTraceSegmentDestination", |
| 36 | () => Effect.Effect< |
| 37 | ( |
| 38 | request?: GetTraceSegmentDestinationRequest, |
| 39 | ) => Effect.Effect< |
| 40 | xray.GetTraceSegmentDestinationResult, |
| 41 | xray.GetTraceSegmentDestinationError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | export const GetTraceSegmentDestination = |
| 46 | Binding.Service<GetTraceSegmentDestination>( |
| 47 | "AWS.XRay.GetTraceSegmentDestination", |
| 48 | ); |