# Telemetry and use cases

> Traces and errors in Sypnia Telemetry with the deploy on them, and which use cases each deploy changed.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://run.docs.sypnia.com/observe/telemetry-and-use-cases/

For agents: Run + Sypnia Telemetry: telemetry = true or run telemetry connect adds project key and SYPNIA_RELEASE, wires @sypnia/telemetry/next for Next.js, uploads/removes source maps, forwards logs, release markers per release (used by release.auto_rollback). Use cases: with use_cases (sypnorm or map file) each build records the use-case map; deploy shows added/removed/changed use cases vs production with files and commits; Telemetry traces tagged per use case; diff in preview PR comments.

## Sypnia Telemetry

With `telemetry = true` (or `run telemetry connect`), Run links the app to a [Sypnia Telemetry](https://telemetry.sypnia.com) project:

- it adds the Telemetry project key and `SYPNIA_RELEASE` (the deploy id) to the app's environment;
- for Next.js it wires `@sypnia/telemetry/next` at build time, and for other frameworks it prints the two lines to add;
- it uploads the build's source maps to Telemetry and removes them from the deployed files;
- it forwards request logs and app logs of functions and containers, so a problem in Telemetry links to the deploy and to the log lines around it.

Every release is sent to Telemetry as a release marker, so its charts show where a deploy started and a rise in errors points at the deploy that caused it. [Automatic rollback](https://run.docs.sypnia.com/deploys/promote-and-rollback#automatic-rollback) uses these numbers.

## Use cases

When the app has a use-case map (the `cases/` folder of [Sypnia Cases](https://cases.docs.sypnia.com/), or [Sypnorm](https://cases.docs.sypnia.com/sypnorm/) with `use_cases = "sypnorm"`), each build records the map and the files behind every use case. The deploy then shows:

- which use cases were **added**, **removed** or **changed** compared with the deploy production points to;
- for each changed use case, the files and the commits that touched it;
- in Telemetry, every run of a case Run runs is a span with `sypnia.case` and `sypnia.case.outcome`, so «Order for tomorrow got slower after dpl_7h3k» is one view ([Use cases and places](https://telemetry.docs.sypnia.com/concepts/use-cases-and-places)). Events carry the trace from one case to the next, so a chain of cases is one trace.

Reviewers see the use-case diff in the pull request comment of a [preview](https://run.docs.sypnia.com/deploys/previews), next to the code diff.
