| 1 | import type * as appsignals from "@distilled.cloud/aws/application-signals"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { InstrumentationConfiguration } from "./InstrumentationConfiguration.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `GetInstrumentationConfigurationStatus` request with the configuration's |
| 8 | * identity (`InstrumentationType`/`Service`/`Environment`/`SignalType`/ |
| 9 | * `LocationIdentifier`) injected from the bound |
| 10 | * {@link InstrumentationConfiguration}. |
| 11 | */ |
| 12 | export interface GetInstrumentationConfigurationStatusRequest extends Omit< |
| 13 | appsignals.GetInstrumentationConfigurationStatusRequest, |
| 14 | | "InstrumentationType" |
| 15 | | "Service" |
| 16 | | "Environment" |
| 17 | | "SignalType" |
| 18 | | "LocationIdentifier" |
| 19 | > {} |
| 20 | |
| 21 | /** |
| 22 | * Runtime binding for |
| 23 | * `application-signals:GetInstrumentationConfigurationStatus`, scoped to |
| 24 | * one {@link InstrumentationConfiguration}. |
| 25 | * |
| 26 | * Returns the status history (`READY`/`ERROR`/`ACTIVE`/`DISABLED`) that |
| 27 | * instrumented SDK agents reported for the bound configuration during a |
| 28 | * time range. Provide the implementation with |
| 29 | * `Effect.provide(AWS.ApplicationSignals.GetInstrumentationConfigurationStatusHttp)`. |
| 30 | * ### Monitoring Instrumentation |
| 31 | * **Example:** Check Whether the Probe Applied |
| 32 | * ```typescript |
| 33 | * // init — bind the operation to the configuration |
| 34 | * const getStatus = |
| 35 | * yield* AWS.ApplicationSignals.GetInstrumentationConfigurationStatus(probe); |
| 36 | * |
| 37 | * // runtime — the configuration's identity is injected automatically |
| 38 | * const result = yield* getStatus({ Status: "ACTIVE" }); |
| 39 | * yield* Effect.log(`${result.Events.length} ACTIVE events`); |
| 40 | * ``` |
| 41 | * |
| 42 | * @binding |
| 43 | */ |
| 44 | export interface GetInstrumentationConfigurationStatus extends Binding.Service< |
| 45 | GetInstrumentationConfigurationStatus, |
| 46 | "AWS.ApplicationSignals.GetInstrumentationConfigurationStatus", |
| 47 | ( |
| 48 | configuration: InstrumentationConfiguration, |
| 49 | ) => Effect.Effect< |
| 50 | ( |
| 51 | request?: GetInstrumentationConfigurationStatusRequest, |
| 52 | ) => Effect.Effect< |
| 53 | appsignals.GetInstrumentationConfigurationStatusResponse, |
| 54 | appsignals.GetInstrumentationConfigurationStatusError |
| 55 | > |
| 56 | > |
| 57 | > {} |
| 58 | |
| 59 | export const GetInstrumentationConfigurationStatus = |
| 60 | Binding.Service<GetInstrumentationConfigurationStatus>( |
| 61 | "AWS.ApplicationSignals.GetInstrumentationConfigurationStatus", |
| 62 | ); |