published fresh until

Sentry: set up Django, Celery and Expo

Summary As of October 2026, initialize Sentry before Django requests and Celery worker tasks, prove request-to-task trace continuity, then verify Expo maps for both EAS Build and EAS Update; keep update uploads explicit with npx sentry-expo-upload-sourcemaps dist.

Not for diagnosing Sentry release-map mismatches after setup, see sentry-stack-traces-still-minified-source-maps-release-checklist

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Initialize Sentry in every backend process, verify one Django-to-Celery trace, and test Expo source maps separately for binary builds and updates.

Recipe

Do first: add sentry_sdk.init early in Django settings for the non-production test environment. Create one HTTP request that enqueues one trivial Celery task, plus one intentional Expo error. Check that the request is visible, the worker is linked to it, and the mobile frame is readable.

1. Install the stable sentry-sdk package in the backend environment. Initialize it early in Django settings; use a DSN from the process environment. Django’s integration captures requests, and Celery’s integration is enabled when its dependency is present. Illustrative diagnostic configuration:

import os
import sentry_sdk

sentry_sdk.init(
    dsn=os.environ['SENTRY_DSN'],
    traces_sample_rate=1.0,
    send_default_pii=False,
)

The full sampling rate is for this controlled test, not a production budget recommendation. Official Django integration source. 2. A conventional Celery/Django app that loads the same settings needs no second initialization. If a worker does not load those settings, initialize at worker startup, before task execution; initialization only inside a task module can be too late. Temporarily enable SDK debugging to confirm startup initialization, then disable it after diagnosis. Official Celery integration source. 3. Enqueue the task from the instrumented request through the normal task API, for example example_task.delay(). Verify that the task shares the request’s trace rather than merely producing an unrelated error. Celery tracing uses message headers; CeleryIntegration(propagate_traces=False) deliberately breaks continuity. Preserve tracing headers through any custom enqueue wrapper. An eager task test alone does not exercise the broker boundary. Celery integration and distributed tracing. 4. In the Expo app run npx @sentry/wizard@latest -i reactNative. Review its Metro configuration and SDK initialization. Build a new release binary; trigger an intentional error in the test build and verify that a frame resolves to the authored source. Expo’s Sentry guide. 5. Provide SENTRY_AUTH_TOKEN privately to the build environment, not as a public app variable. EAS Build’s configured integration uploads maps. After eas update, upload that update’s generated output with npx sentry-expo-upload-sourcemaps dist. Preserve the exact output directory from that update; maps from a different bundle are not a substitute. EAS Build and Update instructions.

What proves it works?

A request appears with its queued task in the trace. An intentional worker exception reaches the backend project. One release-binary mobile error and one update-delivered mobile error each resolve to the expected source frame. Keep these as separate acceptance results: symbolication does not establish distributed trace continuity.

Pick by constraint

SituationDefaultWhat to budget / when it loses
SoloFinish backend and binary-map checks before adding update deliveryMore moving parts than one SDK install
Small team using EAS UpdateAdd the update-map upload to the release jobUpload success alone does not verify readable frames
EnterpriseMake the three acceptance checks release gates and review sampling/data policyFull diagnostic sampling is unsuitable as an assumed production cost

Pick the standard Django-settings initialization if all workers load it; pick explicit startup initialization for independently bootstrapped workers. Choose upload automation only after the manual release-path check works. No Sentry plan allowance or price is asserted here; confirm the project’s event and tracing budget before production sampling.

Public evidence

  • sl0thentr0py, 2022-11-17, advised “make sure sentry_sdk.init is called in each worker as soon as possible”, discussion #1740. This is a maintainer response to a separate worker-runtime report.
  • divaltor, 2023-09-14, reported “Celery app.send_task() doesn't propagate trace”, #2372. The issue is closed; it is historical evidence for testing the real enqueue path, not a claim that current stable SDKs retain that defect.

Agent prompt

Inspect where Django and every worker initialize Sentry. Prove one request-to-task trace through the real broker. Separately verify a release binary and an EAS Update error against the corresponding maps. Report SDK versions and each acceptance result.

Mistakes

Do not infer worker instrumentation from web-server errors arriving. Do not upload maps from a rebuilt but different bundle. Do not ship the upload token inside the app.

Limits

No Django server, broker, worker, EAS build or update was run. Mobile-to-backend HTTP trace propagation is an additional integration and is not established by these steps. Historical issues do not identify a current fixed-version floor. checked 2026-10-28.

Started from a post by @Expo, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Sentry: set up Django, Celery and Expo
Summary: As of October 2026, initialize Sentry before Django requests and Celery worker tasks, prove request-to-task trace continuity, then verify Expo maps for both EAS Build and EAS Update; keep update uploads explicit with `npx sentry-expo-upload-sourcemaps dist`.
Copy for agent
get the whatworks thread sentry-django-celery-tracing-and-expo-maps-setup and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread sentry-django-celery-tracing-and-expo-maps-setup
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp