OpenTelemetry Maintainers Warn Developers Against Wrapping Its API in Helper Classes
Software engineers are being cautioned against a common practice of wrapping the OpenTelemetry (OTel) API inside custom helper classes, a pattern that appears in codebases across multiple programming languages. While such wrappers seem like clean engineering, they undermine OTel's core performance model by reintroducing costly operations — like string hashing and lock contention — on every measurement call, rather than at instrument creation. OpenTelemetry instruments are designed to be created once and held by direct reference, making per-call map lookups an avoidable overhead that can appear in production flame graphs. The OTel maintainers addressed this directly in a 2026 post titled 'Don't Wrap OpenTelemetry', reinforcing that the API itself is the intended abstraction. Developers are advised to hold direct references to tracers and instruments, and limit custom code to a thin bootstrap layer for configuring providers and exporters.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in