Skip to main content

fakecloud_xray/
lib.rs

1//! AWS X-Ray (`xray`) restJson1 control plane + in-memory trace data plane for
2//! fakecloud.
3//!
4//! The full 38-operation AWS X-Ray Smithy model. X-Ray signs SigV4 with the
5//! `xray` scope and speaks restJson1; every operation is a `POST /<UriPath>`
6//! (e.g. `POST /TraceSegments`, `POST /Traces`, `POST /ServiceGraph`), so
7//! requests are routed by their `@http` URI path.
8//!
9//! This is real, persisted, account-partitioned state, not a set of stubs:
10//!
11//! * **Data plane.** `PutTraceSegments` ingests X-Ray trace segment documents
12//!   (JSON), parsing each document's `trace_id` / `id` / `name` / `start_time` /
13//!   `end_time` / `http` / `error`/`fault`/`throttle` flags and its nested
14//!   `subsegments` (including `namespace: "remote"` downstream calls). Segments
15//!   are stored keyed by trace id. `BatchGetTraces` reassembles stored traces,
16//!   `GetTraceSummaries` filters them by time range (plus a documented
17//!   filter-expression subset), and `GetServiceGraph` / `GetTraceGraph` /
18//!   `GetTimeSeriesServiceStatistics` derive a service graph (nodes + edges with
19//!   Ok/Error/Fault statistics and response time) computed deterministically
20//!   from the ingested segments. See [`graph`] and [`segment`].
21//! * **Control plane.** Sampling rules (with the built-in, undeletable `Default`
22//!   rule seeded per account), groups, the account encryption config, resource
23//!   policies, the indexing rule, the trace-segment destination, and ARN-keyed
24//!   resource tagging are straightforward CRUD, persisted via snapshot/restore.
25//!
26//! Model-driven validation rejects contract violations with the error codes each
27//! operation declares (`InvalidRequestException` universally,
28//! `ResourceNotFoundException` on the ops that declare it, plus
29//! `RuleLimitExceededException` / `TooManyTagsException`).
30
31pub mod graph;
32pub mod persistence;
33pub mod segment;
34pub mod service;
35pub mod state;
36mod validate;
37
38pub use service::{XrayService, XRAY_ACTIONS};
39pub use state::{SharedXrayState, XrayData, XraySnapshot, XRAY_SNAPSHOT_SCHEMA_VERSION};