AWS X-Ray
AWS X-Ray (xray) on fakecloud: a complete 38-operation surface (100% conformance) with a real in-memory trace data plane — segment ingestion, service-graph derivation, sampling rules, and groups. restJson1.
fakecloud implements AWS X-Ray as a restJson1 service. All 38 operations ship with 100% conformance against AWS's own Smithy model, backed by account-partitioned state that persists across restarts in persistent mode. X-Ray signs SigV4 with the xray scope; every operation is a fixed POST /<UriPath> (e.g. POST /TraceSegments, POST /ServiceGraph), routed by its @http URI path.
Unlike a pure control plane, X-Ray on fakecloud has a real trace data plane modelled deterministically in memory — not stubbed. Trace segment documents you send are parsed and stored, and the reads that assemble traces and derive the service graph compute over that real ingested data.
Data plane: trace ingestion and the service graph
PutTraceSegmentsingests a batch of X-Ray segment documents (JSON strings). Each document is parsed for itstrace_id,id,name,start_time,end_time,parent_id,origin, thehttprequest/response (method, URL, status), theerror/fault/throttleflags, and its nestedsubsegments(walkingnamespace: "remote"subsegments as downstream service calls). Segments are stored keyed by trace id; a malformed document comes back inUnprocessedTraceSegmentswith an error code. The raw document is retained verbatim.BatchGetTracesreassembles stored traces for the requested trace ids, returning eachTracewith itsDurationand itsSegments(each segment'sIdplus its originalDocument). Unknown ids come back inUnprocessedTraceIds.GetTraceSummariesreturns aTraceSummaryfor every stored trace whose start time falls in[StartTime, EndTime], withDuration,ResponseTime, theHasFault/HasError/HasThrottleflags, the entry-pointHttpinfo, and theServiceIdsin the trace.GetServiceGraphandGetTraceGraphderive the X-Ray service graph from the stored segments: a node per service (named by the segmentname, typed by itsorigin), an edge pernamespace: "remote"downstream call, and per-node / per-edgeSummaryStatistics(OkCount,ErrorStatistics,FaultStatistics,TotalCount,TotalResponseTime). Entry nodes are flaggedRoot.GetServiceGraphderives from a time range;GetTraceGraphfrom an explicit set of trace ids.GetTimeSeriesServiceStatisticsbuckets the window byPeriodand aggregates the same service statistics per bucket.
Control plane
Sampling rules -
CreateSamplingRule/GetSamplingRules/UpdateSamplingRule/DeleteSamplingRule, plusGetSamplingTargetsandGetSamplingStatisticSummaries. Every account is seeded with the built-inDefaultsampling rule (priority 10000, 1 req/s reservoir + 5% of the rest), whichGetSamplingRulesreturns and which cannot be deleted.Groups -
CreateGroup/GetGroup/GetGroups/UpdateGroup/DeleteGroup, each carrying aGroupName, anarn:aws:xray:<region>:<account>:group/<name>/<id>ARN, aFilterExpression, and anInsightsConfiguration.Encryption config -
GetEncryptionConfigreturns the account config (defaulting toType: NONE,Status: ACTIVE);PutEncryptionConfigsetsNONEor aKMSkey.Resource policies -
PutResourcePolicy/DeleteResourcePolicy/ListResourcePolicies.Indexing rule + trace-segment destination -
GetIndexingRules/UpdateIndexingRule, andGetTraceSegmentDestination/UpdateTraceSegmentDestination(XRayorCloudWatchLogs).Tags - ARN-keyed
TagResource/UntagResource/ListTagsForResourceover groups and sampling rules, returningResourceNotFoundExceptionfor an unknown ARN.Telemetry -
PutTelemetryRecordsaccepts the X-Ray daemon's internal telemetry batch.
Every operation applies model-derived validation (required members, string @length, integer @range, and enum sets), returning the error code each operation declares — InvalidRequestException universally, plus ResourceNotFoundException, RuleLimitExceededException, and TooManyTagsException where declared.
Known limitations
Filter expressions -
GetTraceSummariesimplements a documented subset of the X-Ray filter-expression language: an empty expression matches every trace; the boolean keywordsfault,error, andthrottlematch traces carrying that flag; andservice("name")matches traces containing that service node. Any richer expression is treated leniently as a match (it never silently drops data) rather than fully parsed.Insights - X-Ray insights are generated by AWS from anomaly detection over ingested traces. fakecloud does not run anomaly detection, so
GetInsight/GetInsightEvents/GetInsightImpactGraphreport a nonexistent insight andGetInsightSummariesreturns an empty page.Transaction Search retrieval -
StartTraceRetrieval/ListRetrievedTraces/GetRetrievedTracesGraph/CancelTraceRetrievaltrack retrieval tokens and derive the retrieved-traces service graph from the stored segments, but return the retrieved trace spans as metadata only.