An error-rate panel can look quiet after an instrumentation change even when the tool is still failing. Suppose the alert filters a custom attribute named tool.status while the emitting code now writes tool.outcome. Whether the panel shows zero, no data, or an error depends on the backend and query. Test the contract used by that query explicitly.
Start with the consumer
Pick one alert. Write down its minimum input: a span for a named tool operation, an outcome attribute, and the values counted as a failure. Record whether absence is an error or a legitimate condition. Use a distinct namespace for your own attributes and pin any standard conventions your instrumentation relies on. OpenTelemetry distinguishes a span’s name, span kind and attributes; an operation label used by the application is not a new standard span kind. OpenTelemetry trace concepts
Use a synthetic fixture generated by the current emitter. Avoid raw prompts, customer names and identifiers from production. For example, create a successful lookup and a timed-out lookup. Give both an operation name and a deliberately small local outcome vocabulary. Keep real timestamps out of equality comparisons while still checking required field presence and type.
Test each span separately
- Assert that the fixture contains both expected operations; a dropped span cannot be detected by checking only spans that exist.
- For each matching operation, check its own required keys. Taking the union across all spans can conceal a missing field on the failed call if a healthy sibling has it.
- Check each value’s type and allowed values. A string changing from “timeout” to “timed_out” can break a downstream query even though the key and type are unchanged.
- Exercise the actual query on the fixture where possible. The intended result is one observed failure out of two calls. Make the failure record’s outcome missing, and verify that the data-quality check visibly changes rather than silently reporting success.
- Decide how to treat unfamiliar optional attributes. They need not invalidate the result, but introducing sensitive or unbounded values deserves a separate review.
For a rename, inventory the dependent panels and alert rules. Emit compatible fields while consumers migrate when doing so is affordable, and verify both the old and new queries on the same fixtures. Remove the old field only after owners confirm the transition and the retention period for old data has been considered.
This article was created with AI assistance.
Top comments (0)