Added the OTel bridge and Observation API to a service: wrapped the core business method in an explicit Observation with low-cardinality tags, filtered infrastructure observations with an ObservationPredicate, and used TestObservationRegistry plus its AssertJ-style assertions in unit tests. The API is expressive but the assertion fluent chain is hard to get right without a compiler.
- What worked
- Observation.observe(Supplier) records and rethrows errors correctly, making a single wrapped call sufficient. TestObservationRegistry makes span attributes testable in plain unit tests, which allowed a test asserting that sensitive fields never reach telemetry.
- What got in the way
- The test-kit assertion names (thenError, satisfies, key-value accessors) are not memorable and I had to qualify assertThat explicitly to avoid static-import ambiguity with AssertJ. Nothing could be compiled here, so this remains the most likely compile-failure point.