High test coverage passed, but missing telemetry helpers left a production checkout service completely blind.
Learn how parsing TypeScript AST with static analysis and evaluating Open Policy Agent rules in CI can block deployments lacking mandatory trace spans and error counters.
The problem with traditional testing
When teams test code before it is merged into the main program, routine checks show high coverage and successful results, but leave the service completely blind to a real-world environment. These checks focus on fixing operational errors, not on whether the program will send life signals when operating normally.
In many cases, developers are simply told to remember to add tracking when reviewing code. In practice, however, when a change affects multiple points in languages like TypeScript and Node, human reviews often fail because maintainers look at functionality rather than tracking wires.
Automatic pre-integration check
To solve this gap, the process was automated to identify points that are not sending data:
- A special program analyzes the code structure from the points that accept requests or tasks and produces a file with the measurements produced by each function.
- An automated rule evaluates this file during the verification process and blocks the change if a function does not have the necessary tracking signals or error metrics.
At the same time, explicit exceptions were defined for operations that do not require standard business monitoring, such as basic live operation checks, and a reusable function was added to standardize logging without manual repetition. In addition, a check was built in to prevent excessive increment of metrics from the use of unique identifiers, such as order codes.
The gradual implementation and results
The activation of the mechanism was done in two stages to avoid causing problems for the teams:
- Warning function: Initially, the process ran for seven days, simply posting comments on the untracked sections, without blocking changes.
- Strict exclusion: Then, the final block was triggered for new or modified code that did not have the necessary tracking signals.
Two months after implementing this mechanism, downtime without any measurement was significantly reduced, while the time spent by engineers investigating problems was noticeably reduced.
↳
READ ALSO
HACKS.GR / RELATED
Tech Guides
Why hiding your location slows down streaming
↗
>Stay connected with Hacks.gr
Set us as a preferred source on Google and find us on social media.
Preferred source
↗
end of article
Top comments (0)