Coverage for scripts / live_release_validation / actions / tracing.py: 100.00%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-10-28 16:19 +0000

1"""tracing: the deployed API services' OpenTelemetry spans reach Transaction Search.""" 

2 

3from __future__ import annotations 

4 

5from typing import Any 

6 

7from ..checks.tracing import effective_tracing_config, verify_region_tracing 

8from ..models import RunContext 

9 

10 

11def action_tracing(ctx: RunContext) -> dict[str, Any]: 

12 """Require every traced GCO service's spans in each Region's Transaction Search. 

13 

14 For every deployed Region: the X-Ray trace segment destination must be 

15 ``CloudWatchLogs`` and ``ACTIVE``; authenticated API traffic then reaches 

16 the health monitor, the manifest processor, and (with cost monitoring on) 

17 ``/api/v1/cost/status``, and a bounded CloudWatch Logs Insights poll of 

18 the ``aws/spans`` log group must find spans for each expected 

19 ``service.name`` plus at least one trace in which a cost-monitor span 

20 joins the manifest-processor trace that called it. The inference proxy is 

21 expected where this run's ``inference`` action sent requests through it and 

22 is skipped with the reason elsewhere. Evidence is counts only. 

23 

24 With ``tracing.enabled: false`` in cdk.json nothing exports spans, and the 

25 action passes with a note. 

26 """ 

27 config = effective_tracing_config(ctx) 

28 if not config["enabled"]: 

29 return { 

30 "tracing": config, 

31 "note": "tracing.enabled is false in cdk.json; no service exports spans", 

32 "regions": {}, 

33 } 

34 return { 

35 "tracing": config, 

36 "regions": { 

37 region: verify_region_tracing(ctx, region, config) for region in ctx.deployment_regions 

38 }, 

39 }