# backend-conventions

> Claude/Codex skill by [@getsentry](https://omgskills.com/library/getsentry/index.md) · 46k stars · Updated 2026-10-28

Sentry backend conventions for logging, tracing/spans, span/tag attribute naming, metrics tags, and the options system. Use when adding or editing Python in src/ that logs (logger.info/exception), records metrics (metrics.incr/timing with tags), instruments spans/transactions, calls sentry\_sdk.set\_tag/set\_attribute or set\_span\_tag/set\_span\_data, or reads registered options with options.get(). Trigger on "add logging", "log an error", "add a metric", "add a span", "instrument tracing", "set an attribute", "add a tag", "read an option", "LOG005", "LOG011", or metrics tag cardinality questions.

Tags: apm, crash-reporting, crash-reports, csp-report, devops, django, error-logging, error-monitoring, fair-source, hacktoberfest, monitor, monitoring, python, sentry, tag-production

## Install

```sh
git clone https://github.com/getsentry/sentry /tmp/sentry && ln -s /tmp/sentry/.agents/skills/backend-conventions ~/.claude/skills/backend-conventions
```

## From README

Backend Conventions: Logging, Tracing, Metrics, Options Options System Sentry uses a centralized options system where all options are registered in src/sentry/options/defaults.py with required default values. Important: Never add a default value to options.get() calls. All options are registered via register() in defaults.py which requires a default value. The options system always returns the registered default if no value is set, making a second default parameter redundant and potentially inconsistent. Logging Pattern Span / Tag Attribute Names Before inventing a key for sentrysdk.settag/setattribute, setspantag, or setspandata, check whether OTel or Sentry already has a standard name for it in sentryconventions.attributes.ATTRIBUTENAMES. Reusing a convention name keeps the attribute queryable and consistent with what other producers (SDKs, Relay) already emit for the same concept — a bespoke name fragments the same data across two keys.

## Links

- HTML page: https://omgskills.com/library/getsentry/sentry/dot-agents/skills/backend-conventions/
- GitHub: https://github.com/getsentry/sentry
- Author: [@getsentry](https://omgskills.com/library/getsentry/index.md)

## More from this repo

- [design-system](https://omgskills.com/library/getsentry/sentry/design-system/index.md) — Guide for using Sentry's layout and text primitives.
   - [@getsentry](https://omgskills.com/library/getsentry/index.md) · 46k stars
- [feature-flags](https://omgskills.com/library/getsentry/sentry/dot-agents/skills/feature-flags/index.md) — Gate a Sentry feature behind a FlagPole feature flag.
   - [@getsentry](https://omgskills.com/library/getsentry/index.md) · 46k stars
- [generate-frontend-forms](https://omgskills.com/library/getsentry/sentry/generate-frontend-forms/index.md) — Guide for creating forms using Sentry's new form system.
   - [@getsentry](https://omgskills.com/library/getsentry/index.md) · 46k stars
