RemoteWrite
Source:
src/AWS/AMP/RemoteWrite.ts
Runtime binding for aps:RemoteWrite — push metric samples into an AMP
Workspace via its Prometheus remote-write endpoint
(api/v1/remote_write), SigV4-signed with the host Function’s credentials.
The protobuf + snappy remote-write body is encoded internally — callers pass plain metric names, labels, and samples.
Writing Metrics
Section titled “Writing Metrics”Push a Counter Sample
const remoteWrite = yield* AMP.RemoteWrite(workspace);
yield* remoteWrite({ timeseries: [{ name: "jobs_processed_total", labels: { queue: "default" }, samples: [{ value: 42 }], }],});Backfill Samples with Explicit Timestamps
yield* remoteWrite({ timeseries: [{ name: "temperature_celsius", labels: { sensor: "a1" }, samples: [ { value: 20.1, timestamp: Date.now() - 60_000 }, { value: 20.4, timestamp: Date.now() }, ], }],});