SentryLukas StrackeExplainer
Naming is hard, semantics are hard(er): Inside Sentry Conventions
Summary
Sentry’s ~100 SDKs historically sent divergent attribute names and semantics, causing users to miss data when querying across SDK versions. To solve this, Sentry created Sentry Conventions, a superset of OpenTelemetry Semantic Conventions that standardizes attribute names, types, deprecation rules, data scrubbing policies, span operations, and metric specifications. The conventions are published as NPM and PyPI packages and Rust code, and surfaced via a searchable website. SDKs use the packages to set attribute names and span ops, Relay uses them for data scrubbing and inferring span names/descriptions, and the backend uses them to coalesce deprecated and current attributes so queries return results regardless of which version an SDK sent. Over the past year, Sentry grew its conventions from roughly 300 to more than 900 attributes by backfilling existing SDK attributes and aligning on single versions.
Context
Sentry’s ~100 SDKs historically sent divergent attribute names and semantics, causing users to miss data when querying across SDK versions. OpenTelemetry Semantic Conventions provided a starting point, but Sentry needed Sentry-specific attributes (e.g., span ops) and additional metadata like data scrubbing policies and deprecation rules. Over the past year, Sentry grew its conventions from roughly 300 to more than 900 attributes by backfilling existing SDK attributes and aligning on single versions.
Approach / What changed
Sentry Conventions is a superset of OpenTelemetry Semantic Conventions that standardizes attribute names, types, deprecation rules, data scrubbing policies, span operations, and metric specifications across Sentry’s SDKs, ingestion pipeline, and product. The conventions are published as NPM and PyPI packages and Rust code, and surfaced via a searchable website. SDKs use the packages to set attribute names and span ops, Relay uses them for data scrubbing and inferring span names/descriptions, and the backend uses them to coalesce deprecated and current attributes so queries return results regardless of which version an SDK sent.
Takeaways
Sentry Conventions are a superset of OpenTelemetry Semantic Conventions, adding Sentry-specific attributes like span ops and metadata such as data scrubbing policies and deprecation rules.
The conventions are published as NPM and PyPI packages and Rust code, allowing SDKs to avoid typos and handle deprecations automatically by switching to new attributes in the next major version.
The backend coalesces deprecated and current attributes so that querying either the old or new name returns the same results, enabling deprecation-safe features.
FAQ
How do Sentry Conventions relate to OpenTelemetry?
Sentry Conventions are a superset of OpenTelemetry Semantic Conventions. They extend OTel's database with Sentry- or instrumentation-specific attributes and concepts, such as span ops, that would not make sense to bring into OTel. Other observability vendors follow a similar approach.
How does Sentry handle deprecated attributes in queries?
When you query an attribute, the backend coalesces deprecated and current attributes so that querying either the old or new name returns the same results. For example, querying http.request.method also finds data that older SDKs sent as http.method. This works in both directions.
What is Sentry's process for introducing new attributes?
Sentry first adds new attributes to conventions, waits for agreement on naming and semantics, and only then ships them in SDKs. This 'specify first, ship second' approach saves back-and-forth later. Deprecations are part of the spec, listing a replacement and migration strategy so ingestion, querying, and the product can handle both old and new attributes.
Source and freshness
- Source
- blog.sentry.io
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.