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