From 573e174d0cf7daf7d5b869fcebe85502c25e4f4e Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Wed, 12 Nov 2025 17:10:43 +0000 Subject: [PATCH 01/16] feat(dev): App reference Spotlight specs for SDKs --- .../sdk/expected-features/spotlight.mdx | 414 ++++++++++++++++++ scripts/generate-md-exports.mjs | 2 +- 2 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 develop-docs/sdk/expected-features/spotlight.mdx diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx new file mode 100644 index 0000000000000..119c3cc92b43f --- /dev/null +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -0,0 +1,414 @@ +--- +title: Spotlight +sidebar_order: 5 +--- + +[Sentry Spotlight](https://spotlightjs.com/) is a local development tool that provides real-time observability for errors, traces, logs, and performance data during development. SDKs should implement support for Spotlight to enable developers to see their Sentry data locally without sending it to Sentry's servers. + +## Configuration Options + +SDKs should support Spotlight configuration through one of two approaches: + +### Single Attribute Approach (Recommended) + +The SDK accepts a single `spotlight` configuration attribute that can be: + +- `false` or `undefined`/`null`: Spotlight is disabled +- `true`: Spotlight is enabled using the default URL (`http://localhost:8969/stream`) +- `string`: Spotlight is enabled using the provided URL + +**Example:** + +```python +# Disabled +spotlight: False + +# Enabled with default URL +spotlight: True + +# Enabled with custom URL +spotlight: "http://localhost:3000/stream" +``` + +### Two-Attribute Approach (Alternative) + +The SDK accepts two separate configuration attributes: + +- `spotlight: Optional[boolean]`: Enable or disable Spotlight +- `spotlightUrl: Optional[string]`: Specify the Spotlight backend URL + +**Important:** If `spotlightUrl` is set to any truthy string value, it implies `spotlight: true` unless `spotlight` is explicitly set to `false`. + +**Example:** + +```python +# Disabled +spotlight: False + +# Enabled with default URL +spotlight: True + +# Enabled with custom URL (spotlightUrl implies spotlight: true) +spotlightUrl: "http://localhost:3000/stream" + +# Explicitly disabled even with spotlightUrl set +spotlight: False +spotlightUrl: "http://localhost:3000/stream" # Ignored +``` + +## Environment Variable Handling + +SDKs must support the `SENTRY_SPOTLIGHT` environment variable. The value should be parsed according to the following rules: + +### Truthy Values + +The following values should be treated as `spotlight: true` (enabling Spotlight with the default URL): + +- `"true"` +- `"t"` +- `"y"` +- `"yes"` +- `"on"` +- `"1"` + +### Falsy Values + +The following values should be treated as `spotlight: false` (disabling Spotlight): + +- `"false"` +- `"f"` +- `"n"` +- `"no"` +- `"off"` +- `"0"` + +### URL String Values + +Any other string value should be treated as a Spotlight backend URL, enabling Spotlight with that URL. + +**Example parsing logic (Python reference):** + +```python +def parse_spotlight_env(env_value): + if not env_value: + return None + + env_value_lower = env_value.lower().strip() + + # Truthy values + if env_value_lower in ("true", "t", "y", "yes", "on", "1"): + return True + + # Falsy values + if env_value_lower in ("false", "f", "n", "no", "off", "0"): + return False + + # Any other value is treated as a URL + return env_value +``` + +## Precedence Rules + +The interaction between configuration options and environment variables follows these precedence rules: + +1. **Config option takes precedence over env var**, except: + - If `spotlight: true` (boolean, no URL specified) AND `SENTRY_SPOTLIGHT` is set to a URL string → use the env var URL + - This allows developers to enable Spotlight via config but override the URL via environment variable + +2. **If `spotlight` is set to a string URL** → it overrides the env var completely + +3. **If using two-attribute approach:** + - If `spotlightUrl` config and env var are both set → prefer config value (`spotlightUrl`) + - If `spotlight: false` is explicitly set → ignore `spotlightUrl` value and the env var + +4. **If `spotlight: false` explicitly set** → ignore env var and any URL configuration + +**Precedence Examples:** + +```python +# Example 1: Config boolean true + env var URL → use env var URL +# Config: spotlight: True +# Env: SENTRY_SPOTLIGHT=http://custom:3000/stream +# Result: Enabled with http://custom:3000/stream + +# Example 2: Config URL string → always use config URL +# Config: spotlight: "http://config:3000/stream" +# Env: SENTRY_SPOTLIGHT=http://env:3000/stream +# Result: Enabled with http://config:3000/stream + +# Example 3: Config false → disable regardless of env var +# Config: spotlight: False +# Env: SENTRY_SPOTLIGHT=http://localhost:8969/stream +# Result: Disabled + +# Example 4: Two-attribute approach with spotlightUrl +# Config: spotlightUrl: "http://config:3000/stream" +# Env: SENTRY_SPOTLIGHT=http://env:3000/stream +# Result: Enabled with http://config:3000/stream (config takes precedence) +``` + +## Data Collection Behavior + +When Spotlight is enabled, SDKs must implement the following data collection behavior: + +### Envelope Transmission + +- Send a copy of **every envelope** to the Spotlight server +- This includes errors, transactions, sessions, profiles, replays, and all other envelope types + +### Sampling + +- Enable **100% sample rate** for the Spotlight pipeline +- This should **not affect** the upstream Sentry sample rates +- The ideal implementation uses a **separate pipeline** that ignores sampling settings +- Fallback: If separate pipeline is not feasible, enable sampling manually if no DSN is configured in development mode + +### PII Data Collection + +- Enable **all PII data collection** for Spotlight (equivalent to `sendDefaultPii: true`) +- This should **not affect** upstream Sentry PII settings +- Spotlight is intended for local development, so full data visibility is expected + +### Profiling and Logs + +- Enable profiling data transmission to Spotlight +- Enable log data transmission to Spotlight +- These should be sent regardless of upstream Sentry configuration + +### Pipeline Architecture + +**Ideal Implementation:** + +```python +# Separate pipeline that bypasses sampling +def send_to_spotlight(envelope): + # Clone envelope to avoid affecting upstream + spotlight_envelope = clone_envelope(envelope) + + # Override sampling - ensure 100% sample rate + spotlight_envelope.sample_rate = 1.0 + + # Enable all PII + spotlight_envelope.send_default_pii = True + + # Send to Spotlight server + spotlight_transport.send(spotlight_envelope) +``` + +**Fallback Implementation:** + +If separate pipeline is not feasible: + +```python +# Enable sampling if no DSN in development +if not dsn and is_development_mode(): + sample_rate = 1.0 + send_default_pii = True +``` + +## Default Values + +### Default Spotlight URL + +The default Spotlight backend URL is: + +``` +http://localhost:8969/stream +``` + +This URL should be used when: +- `spotlight: true` is set (boolean, no URL specified) +- `SENTRY_SPOTLIGHT` is set to a truthy value (not a URL string) + +### Default Behavior + +- Spotlight is **disabled by default** +- SDKs should only enable Spotlight when explicitly configured or when the environment variable is set + +## Error Handling + +SDKs must handle Spotlight server connectivity issues gracefully: + +### Unreachable Server + +- If the Spotlight server is unreachable, SDKs should: + - Log an error message (ideally once, not per-envelope) + - Implement exponential backoff retry logic + - Continue normal Sentry operation without interruption + +### Retry Logic + +**Recommended retry strategy:** + +```python +import time +import logging + +logger = logging.getLogger(__name__) + +class SpotlightTransport: + def __init__(self, url): + self.url = url + self.retry_delay = 1.0 # Start with 1 second + self.max_retry_delay = 60.0 # Max 60 seconds + self.error_logged = False + + def send(self, envelope): + try: + # Attempt to send + self._send_envelope(envelope) + # Reset retry delay on success + self.retry_delay = 1.0 + self.error_logged = False + except ConnectionError as e: + # Exponential backoff + if not self.error_logged: + logger.error(f"Spotlight server unreachable at {self.url}: {e}") + self.error_logged = True + + # Wait before retry + time.sleep(self.retry_delay) + self.retry_delay = min(self.retry_delay * 2, self.max_retry_delay) + + # Retry once, then give up for this envelope + try: + self._send_envelope(envelope) + self.retry_delay = 1.0 + except ConnectionError: + # Silently drop envelope after retry + pass +``` + +### Logging + +- Log errors at the appropriate level (typically `ERROR` or `WARNING`) +- Avoid logging errors for every failed envelope to prevent log spam +- Consider logging once per connection failure, then periodically if failures persist + +### Non-Blocking Behavior + +- Spotlight transmission must **never block** normal Sentry operation +- If Spotlight is unavailable, the SDK should continue sending data to Sentry normally +- Spotlight failures should not affect event capture, transaction recording, or any other SDK functionality + +## Implementation Examples + +### Python SDK Reference + +The Python SDK implementation serves as a reference. Key implementation details: + +- Single attribute approach: `spotlight: Optional[Union[str, bool]]` +- Environment variable: `SENTRY_SPOTLIGHT` +- Default URL: `http://localhost:8969/stream` +- Separate transport pipeline for Spotlight + +**Configuration Example:** + +```python +import sentry_sdk + +sentry_sdk.init( + dsn="https://...@sentry.io/...", + spotlight=True, # Enable with default URL + # or + spotlight="http://localhost:3000/stream", # Custom URL +) +``` + +### JavaScript/TypeScript SDK Pattern + +```typescript +interface SpotlightOptions { + spotlight?: boolean | string; + // or alternative: + // spotlight?: boolean; + // spotlightUrl?: string; +} + +function init(options: SpotlightOptions) { + const spotlightEnabled = resolveSpotlightConfig(options); + + if (spotlightEnabled) { + const spotlightUrl = typeof spotlightEnabled === 'string' + ? spotlightEnabled + : 'http://localhost:8969/stream'; + + setupSpotlightTransport(spotlightUrl); + } +} + +function resolveSpotlightConfig(options: SpotlightOptions): boolean | string | null { + // Config takes precedence + if (options.spotlight === false) { + return null; + } + + if (options.spotlight === true) { + // Check env var for URL override + const envValue = process.env.SENTRY_SPOTLIGHT; + if (envValue && !isTruthyFalsy(envValue)) { + return envValue; // Use env var URL + } + return true; // Use default URL + } + + if (typeof options.spotlight === 'string') { + return options.spotlight; // Config URL takes precedence + } + + // Check env var + const envValue = process.env.SENTRY_SPOTLIGHT; + if (envValue) { + return parseSpotlightEnv(envValue); + } + + return null; +} +``` + +### Java SDK Pattern + +```java +public class SpotlightConfig { + private Boolean enabled; + private String url; + + public static SpotlightConfig fromOptions(Options options, String envVar) { + SpotlightConfig config = new SpotlightConfig(); + + // Config takes precedence + if (options.getSpotlight() != null) { + if (options.getSpotlight() instanceof Boolean) { + config.enabled = (Boolean) options.getSpotlight(); + if (config.enabled && envVar != null && !isTruthyFalsy(envVar)) { + config.url = envVar; // Env var URL override + } + } else if (options.getSpotlight() instanceof String) { + config.enabled = true; + config.url = (String) options.getSpotlight(); + } + } else if (envVar != null) { + Object parsed = parseSpotlightEnv(envVar); + if (parsed instanceof Boolean) { + config.enabled = (Boolean) parsed; + } else if (parsed instanceof String) { + config.enabled = true; + config.url = (String) parsed; + } + } + + if (config.enabled == null || !config.enabled) { + return null; // Spotlight disabled + } + + config.url = config.url != null ? config.url : "http://localhost:8969/stream"; + return config; + } +} +``` + +## References + +- [Sentry Spotlight Documentation](https://spotlightjs.com/) +- [Sentry Spotlight GitHub Repository](https://github.com/getsentry/spotlight) +- [Python SDK Implementation Reference](https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/utils.py) diff --git a/scripts/generate-md-exports.mjs b/scripts/generate-md-exports.mjs index 229a700691e29..df1cb46d3607f 100644 --- a/scripts/generate-md-exports.mjs +++ b/scripts/generate-md-exports.mjs @@ -256,7 +256,7 @@ async function genMDFromHTML(source, target, {cacheDir, noCache}) { value: node.children[0].value, }, ], - }), + }),f }, }) .use(RemarkLinkRewrite, { From bcb30a9fc73f4f8ebbc36eeb7aab1e1b0764e455 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 17:11:37 +0000 Subject: [PATCH 02/16] [getsentry/action-github-commit] Auto commit --- scripts/generate-md-exports.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/generate-md-exports.mjs b/scripts/generate-md-exports.mjs index df1cb46d3607f..592e3e248919f 100644 --- a/scripts/generate-md-exports.mjs +++ b/scripts/generate-md-exports.mjs @@ -256,7 +256,8 @@ async function genMDFromHTML(source, target, {cacheDir, noCache}) { value: node.children[0].value, }, ], - }),f + }), + f, }, }) .use(RemarkLinkRewrite, { From 54a89d97a6319fe7d052dd3a2099e7eaeb5f1496 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 12 Nov 2025 15:58:33 +0100 Subject: [PATCH 03/16] ref(develop): Clarify telemetry data > scope attribute precedence (#15482) --- develop-docs/sdk/telemetry/scopes.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/develop-docs/sdk/telemetry/scopes.mdx b/develop-docs/sdk/telemetry/scopes.mdx index 1a32ccd2f26f6..a236394393ba3 100644 --- a/develop-docs/sdk/telemetry/scopes.mdx +++ b/develop-docs/sdk/telemetry/scopes.mdx @@ -100,6 +100,7 @@ The method SHOULD accept a dictionary/map/object where: - Attributes set on the isolation scope MUST be applied to all logs and metrics in that execution context - Attributes set on the current scope MUST be applied only to the current log and current metric - When the same attribute key exists in multiple scopes, the more specific scope's value takes precedence (current > isolation > global) +- When the same attribute key exists on the current log or metric, it MUST take precedence over an attribute with the same key set on any scope (log/metric > current > isolation > global) See [Span Protocol - Common Attribute Keys](/sdk/telemetry/spans/span-protocol/#common-attribute-keys) for a list of standard attributes and [Sentry Conventions](https://github.com/getsentry/sentry-conventions/) for the complete attribute registry. From 3998f7a373d4a2e0cd6c55f785102a80980aada3 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Wed, 12 Nov 2025 16:15:09 +0100 Subject: [PATCH 04/16] feat(docs): Bump min version for metrics (#15490) --- platform-includes/metrics/requirements/javascript.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/metrics/requirements/javascript.mdx b/platform-includes/metrics/requirements/javascript.mdx index 196f7fbe09905..6a659ea841c77 100644 --- a/platform-includes/metrics/requirements/javascript.mdx +++ b/platform-includes/metrics/requirements/javascript.mdx @@ -1 +1 @@ -Metrics are supported in all Sentry JavaScript SDKs version `10.24.0` and above. +Metrics are supported in all Sentry JavaScript SDKs version `10.25.0` and above. From f6a09666347332227c65607791a9b71c3fa9d1c1 Mon Sep 17 00:00:00 2001 From: Stefan Jandl Date: Wed, 12 Nov 2025 17:13:13 +0100 Subject: [PATCH 05/16] fix(Unity): Expanded on known limitations when targeting WebGL (#15485) --- docs/platforms/unity/troubleshooting/known-limitations.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/platforms/unity/troubleshooting/known-limitations.mdx b/docs/platforms/unity/troubleshooting/known-limitations.mdx index 4fa209a3a451f..35e9a3ced2dae 100644 --- a/docs/platforms/unity/troubleshooting/known-limitations.mdx +++ b/docs/platforms/unity/troubleshooting/known-limitations.mdx @@ -113,3 +113,8 @@ When targeting WebGL, you have the option of setting the `PlayerSettings.WebGL.e - Setting it to `WebGLExceptionSupport.None` is not supported by the SDK. - For the SDK to be able provide stack traces, the support needs to be set to `WebGLExceptionSupport.FullWithStacktrace`. - The SDK is currently not able to provide line numbers due to the IL2CPP backend not being available. +- **Native crash detection is not available on WebGL.** The SDK cannot determine if the browser or tab crashed, which affects session tracking: + - Sessions with captured exceptions are marked as `Unhandled` + - Sessions where the tab/browser closes without a clean shutdown are marked as `Abnormal` + - The Crash Free Session Rate will show 100% since native `Crashed` status is unavailable + - Monitor both `Unhandled` and `Abnormal` session rates to track stability issues From 7b4a90ef1f747b8cbd1c2196f403233ab6629b7a Mon Sep 17 00:00:00 2001 From: Shannon Anahata Date: Wed, 12 Nov 2025 08:30:17 -0800 Subject: [PATCH 06/16] Updated the latest periods and language for our retention stuffs (#15341) ## DESCRIBE YOUR PR November 12th we update our retention periods. This updates the doc to match that change. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): - [x] Other deadline: November 12 - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Shannon Anahata --- .../security/data-retention-periods.mdx | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/docs/security-legal-pii/security/data-retention-periods.mdx b/docs/security-legal-pii/security/data-retention-periods.mdx index 53d14bf58145b..de3e9b0b513cd 100644 --- a/docs/security-legal-pii/security/data-retention-periods.mdx +++ b/docs/security-legal-pii/security/data-retention-periods.mdx @@ -6,33 +6,30 @@ description: "Learn about Sentry's data retention periods for different data typ ## Overview -Sentry retains different types of data for varying periods based on your plan tier and the specific data type. The below table outlines the retention periods for data types across our Developer, Team, and Business plans. +Sentry retains different types of data for varying periods based on your plan tier and the specific data type. The below table outlines the retention periods for data types across our Developer, Team, Business, and Enterprise plans. -By default, new account trials are granted Team plan retention. If you are trialing from a paid plan type, you will have the same retention as that plan for any data ingested during the trial. +By default, new account trials have Team plan retention. If you are trialing from a paid plan type, you will have the same retention as that plan for any data ingested during the trial. ## Default Data Retention by Plan -| Data Type | Developer | Team | Business | +| Data Type | Developer | Team | Business / Enterprise | |-----------|-----------|------|----------| -| [Errors](/concepts/key-terms/enrich-data/) | 30 days | 90 days | 90 days | -| [Logs](/product/explore/logs/) | 30 days | 30 days | 30 days | -| [Spans/Transactions](/concepts/key-terms/tracing/distributed-tracing/) | 30 days | 90 days | 90 days + 13 months sampled | -| [Session Replays](/product/explore/session-replay/web/) | 30 days | 90 days | 90 days | -| [User Feedback](/product/user-feedback/) | 30 days | 90 days | 90 days | -| [Profiles](/product/explore/profiling/) | 30 days | 90 days | 90 days | -| [Crons](/product/crons/) | 30 days | 30 days | 30 days | -| [Uptime](/product/uptime-monitoring/) | 30 days | 90 days | 90 days | -| [Attachments](/product/issues/issue-details/#attachments) | 30 days | 90 days | 90 days | +| Errors | 30 days | 90 days | 90 days | +| Logs | 30 days | 30 days | 30 days | +| Spans/Transactions | 30 days | 30 days* | 30 days + 13 months sampled* | +| Session Replays | 30 days | 90 days | 90 days | +| Profiles | 30 days | 30 days | 30 days | +| Crons | 30 days | 30 days | 30 days | +| Uptime | 30 days | 90 days | 90 days | +| Attachments | 30 days | 90 days | 90 days | - -Starting November 2025, Team and Business plans will move from the current 90 day retention period for spans, transactions, and profiles to 30 days. **Exception:** If you are on a [Team or Business plan](https://sentry.io/settings/billing/overview/) that uses transaction-based billing, transaction retention will stay at 90 days, and sampled retention of spans data will not apply. - +**Exception\*:** If you are on a[Team or Business plan](https://sentry.io/settings/billing/overview/) that uses [transaction-based billing](https://docs.sentry.io/pricing/), transactions retention will be 90 days and sampled retention of spans data will not apply. -## Sampled Retention for Business Plans +## Sampled Retention for Business and Enterprise Plans -Business plan customers receive extended retention for spans data through our sampled retention feature. This provides up to: +Business and Enterprise plan customers receive extended retention for spans data through our sampled retention feature. This provides up to: -- **Full fidelity data**: 90 days of complete span data +- **Full fidelity data**: 30 days of complete span data - **Sampled data**: 13 months of downsampled span data 13 month downsampled data is a percentage of span data. Sampled retention is currently only available for span data. @@ -41,7 +38,7 @@ Business plan customers receive extended retention for spans data through our sa ### When Retention is Applied -Retention periods are applied at the time data is ingested, based on the then-current plan. This means plan upgrades or downgrades affect retention for new data only; existing data retains its original retention period. +Retention periods are set at the time data is ingested, based on the then-current plan. This means plan upgrades or downgrades affect retention for new data only; existing data retains its original retention period. ## Extended Retention From 74b456bc248948c9bc110ad448d9bf386bde8b8d Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 12 Nov 2025 12:18:00 -0500 Subject: [PATCH 07/16] chore: Remove logs warning (#15488) we shipped this for users during logs GA, spec is locked in now ## DESCRIBE YOUR PR *Tell us what you're changing and why. If your PR **resolves an issue**, please link it so it closes automatically.* ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [x] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --- develop-docs/sdk/telemetry/logs.mdx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/develop-docs/sdk/telemetry/logs.mdx b/develop-docs/sdk/telemetry/logs.mdx index f31dfc8446df2..40a8a06fc7505 100644 --- a/develop-docs/sdk/telemetry/logs.mdx +++ b/develop-docs/sdk/telemetry/logs.mdx @@ -3,12 +3,6 @@ title: Logs sidebar_order: 3 --- - - -The Sentry Logs feature is under active development. The information in this document is subject to change. - - - This document defines the format used by Sentry to ingest logs, as well as the SDK API and behavior that create and send logs to Sentry. ## Logs Protocol From 5b167db85482b49b22a2db778570667ce704b238 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Wed, 12 Nov 2025 17:32:06 +0000 Subject: [PATCH 08/16] revert silly changes --- scripts/generate-md-exports.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/generate-md-exports.mjs b/scripts/generate-md-exports.mjs index 592e3e248919f..229a700691e29 100644 --- a/scripts/generate-md-exports.mjs +++ b/scripts/generate-md-exports.mjs @@ -257,7 +257,6 @@ async function genMDFromHTML(source, target, {cacheDir, noCache}) { }, ], }), - f, }, }) .use(RemarkLinkRewrite, { From b38e3b307f900665a348f855559ac1d1c58914cc Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Wed, 12 Nov 2025 20:10:03 +0000 Subject: [PATCH 09/16] tighten things up a bit --- develop-docs/sdk/expected-features/spotlight.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx index 119c3cc92b43f..79edb9f58cac3 100644 --- a/develop-docs/sdk/expected-features/spotlight.mdx +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -3,7 +3,7 @@ title: Spotlight sidebar_order: 5 --- -[Sentry Spotlight](https://spotlightjs.com/) is a local development tool that provides real-time observability for errors, traces, logs, and performance data during development. SDKs should implement support for Spotlight to enable developers to see their Sentry data locally without sending it to Sentry's servers. +[Sentry Spotlight](https://spotlightjs.com/) is a local development tool that provides real-time observability for errors, traces, logs, and performance data during development. SDKs should implement support for Spotlight to unlock the power of Sentry for local development. ## Configuration Options @@ -11,6 +11,8 @@ SDKs should support Spotlight configuration through one of two approaches: ### Single Attribute Approach (Recommended) +This approach MUST be used if the SDK language allows for a single configuration attribute to have 2 different types (`boolean` and `string`). + The SDK accepts a single `spotlight` configuration attribute that can be: - `false` or `undefined`/`null`: Spotlight is disabled @@ -155,6 +157,7 @@ When Spotlight is enabled, SDKs must implement the following data collection beh - Send a copy of **every envelope** to the Spotlight server - This includes errors, transactions, sessions, profiles, replays, and all other envelope types +- The Spotlight server HTTP semantics are the same as the Sentry server HTTP semantics (e.g. use POST to send envelopes) ### Sampling @@ -320,9 +323,6 @@ sentry_sdk.init( ```typescript interface SpotlightOptions { spotlight?: boolean | string; - // or alternative: - // spotlight?: boolean; - // spotlightUrl?: string; } function init(options: SpotlightOptions) { From 8748525024d2c66f1e463d38829582cac32e9d74 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 13 Nov 2025 21:57:03 +0000 Subject: [PATCH 10/16] Apply suggestion from @philipphofmann Co-authored-by: Philipp Hofmann --- develop-docs/sdk/expected-features/spotlight.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx index 79edb9f58cac3..c09480c01234f 100644 --- a/develop-docs/sdk/expected-features/spotlight.mdx +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -162,7 +162,7 @@ When Spotlight is enabled, SDKs must implement the following data collection beh ### Sampling - Enable **100% sample rate** for the Spotlight pipeline -- This should **not affect** the upstream Sentry sample rates +- This **MUST NOT affect** the upstream Sentry sample rates - The ideal implementation uses a **separate pipeline** that ignores sampling settings - Fallback: If separate pipeline is not feasible, enable sampling manually if no DSN is configured in development mode From 37fd74d770afb1f9b8c5544941aa8cecc2ef0ca2 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 13 Nov 2025 21:59:14 +0000 Subject: [PATCH 11/16] Apply suggestion from @philipphofmann Co-authored-by: Philipp Hofmann --- develop-docs/sdk/expected-features/spotlight.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx index c09480c01234f..43091cd9b7274 100644 --- a/develop-docs/sdk/expected-features/spotlight.mdx +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -226,7 +226,7 @@ This URL should be used when: ### Default Behavior - Spotlight is **disabled by default** -- SDKs should only enable Spotlight when explicitly configured or when the environment variable is set +- SDKs MUST only enable Spotlight when explicitly configured or when the environment variable is set. ## Error Handling From 01c2d401ced75be21bdc71252dfcf80bf0884826 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 13 Nov 2025 22:19:56 +0000 Subject: [PATCH 12/16] tidy up language according to RFC 2119 --- .../sdk/expected-features/spotlight.mdx | 91 +++++++++---------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx index 43091cd9b7274..3a67ce004beb8 100644 --- a/develop-docs/sdk/expected-features/spotlight.mdx +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -3,17 +3,19 @@ title: Spotlight sidebar_order: 5 --- -[Sentry Spotlight](https://spotlightjs.com/) is a local development tool that provides real-time observability for errors, traces, logs, and performance data during development. SDKs should implement support for Spotlight to unlock the power of Sentry for local development. +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://ietf.org/rfc/rfc2119.txt). + +[Sentry Spotlight](https://spotlightjs.com/) is a local development tool that provides real-time observability for errors, traces, logs, and performance data during development. SDKs SHOULD implement support for Spotlight to unlock the power of Sentry for local development. ## Configuration Options -SDKs should support Spotlight configuration through one of two approaches: +SDKs MUST support Spotlight configuration through one of two approaches: ### Single Attribute Approach (Recommended) This approach MUST be used if the SDK language allows for a single configuration attribute to have 2 different types (`boolean` and `string`). -The SDK accepts a single `spotlight` configuration attribute that can be: +The SDK MUST accept a single `spotlight` configuration attribute that can be: - `false` or `undefined`/`null`: Spotlight is disabled - `true`: Spotlight is enabled using the default URL (`http://localhost:8969/stream`) @@ -34,12 +36,12 @@ spotlight: "http://localhost:3000/stream" ### Two-Attribute Approach (Alternative) -The SDK accepts two separate configuration attributes: +The SDK MUST accept two separate configuration attributes: - `spotlight: Optional[boolean]`: Enable or disable Spotlight - `spotlightUrl: Optional[string]`: Specify the Spotlight backend URL -**Important:** If `spotlightUrl` is set to any truthy string value, it implies `spotlight: true` unless `spotlight` is explicitly set to `false`. +**Important:** If `spotlightUrl` is set to any truthy string value, it MUST imply `spotlight: true` unless `spotlight` is explicitly set to `false`. **Example:** @@ -60,11 +62,11 @@ spotlightUrl: "http://localhost:3000/stream" # Ignored ## Environment Variable Handling -SDKs must support the `SENTRY_SPOTLIGHT` environment variable. The value should be parsed according to the following rules: +SDKs MUST support the `SENTRY_SPOTLIGHT` environment variable. The value MUST be parsed according to the following rules: ### Truthy Values -The following values should be treated as `spotlight: true` (enabling Spotlight with the default URL): +The following values MUST be treated as `spotlight: true` (enabling Spotlight with the default URL): - `"true"` - `"t"` @@ -75,7 +77,7 @@ The following values should be treated as `spotlight: true` (enabling Spotlight ### Falsy Values -The following values should be treated as `spotlight: false` (disabling Spotlight): +The following values MUST be treated as `spotlight: false` (disabling Spotlight): - `"false"` - `"f"` @@ -86,7 +88,7 @@ The following values should be treated as `spotlight: false` (disabling Spotligh ### URL String Values -Any other string value should be treated as a Spotlight backend URL, enabling Spotlight with that URL. +Any other string value MUST be treated as a Spotlight backend URL, enabling Spotlight with that URL. **Example parsing logic (Python reference):** @@ -111,19 +113,17 @@ def parse_spotlight_env(env_value): ## Precedence Rules -The interaction between configuration options and environment variables follows these precedence rules: +The interaction between configuration options and environment variables MUST follow these precedence rules: -1. **Config option takes precedence over env var**, except: - - If `spotlight: true` (boolean, no URL specified) AND `SENTRY_SPOTLIGHT` is set to a URL string → use the env var URL - - This allows developers to enable Spotlight via config but override the URL via environment variable +1. **Config option MUST take precedence over env var**, except: + - If `spotlight: true` (boolean, no URL specified) AND `SENTRY_SPOTLIGHT` is set to a URL string → MUST use the env var URL + This allows developers to enable Spotlight via config but override the URL via environment variable -2. **If `spotlight` is set to a string URL** → it overrides the env var completely +2. **If `spotlight` is set to a string URL** → it MUST override the env var completely 3. **If using two-attribute approach:** - - If `spotlightUrl` config and env var are both set → prefer config value (`spotlightUrl`) - - If `spotlight: false` is explicitly set → ignore `spotlightUrl` value and the env var - -4. **If `spotlight: false` explicitly set** → ignore env var and any URL configuration + - If `spotlightUrl` config and env var are both set → MUST use config value (`spotlightUrl`) + - If `spotlight: false` is explicitly set → MUST ignore `spotlightUrl` value, the env var, and any URL configuration **Precedence Examples:** @@ -151,32 +151,32 @@ The interaction between configuration options and environment variables follows ## Data Collection Behavior -When Spotlight is enabled, SDKs must implement the following data collection behavior: +When Spotlight is enabled, SDKs MUST implement the following data collection behavior: + +**General Requirements:** +- SDKs SHOULD use a **separate pipeline** for Spotlight that does not affect upstream Sentry behavior +- All Spotlight-specific settings (sample rates, PII collection, etc.) MUST NOT affect upstream Sentry configuration +- Fallback: If a separate pipeline is not feasible, SDKs SHOULD enable Spotlight-specific settings manually if no DSN is configured in development mode ### Envelope Transmission -- Send a copy of **every envelope** to the Spotlight server +- MUST send a copy of **every envelope** to the Spotlight server - This includes errors, transactions, sessions, profiles, replays, and all other envelope types - The Spotlight server HTTP semantics are the same as the Sentry server HTTP semantics (e.g. use POST to send envelopes) ### Sampling -- Enable **100% sample rate** for the Spotlight pipeline -- This **MUST NOT affect** the upstream Sentry sample rates -- The ideal implementation uses a **separate pipeline** that ignores sampling settings -- Fallback: If separate pipeline is not feasible, enable sampling manually if no DSN is configured in development mode +- MUST enable **100% sample rate** for all telemetry types for the Spotlight pipeline ### PII Data Collection -- Enable **all PII data collection** for Spotlight (equivalent to `sendDefaultPii: true`) -- This should **not affect** upstream Sentry PII settings +- MUST enable **all PII data collection** for Spotlight (equivalent to `sendDefaultPii: true`) - Spotlight is intended for local development, so full data visibility is expected ### Profiling and Logs -- Enable profiling data transmission to Spotlight -- Enable log data transmission to Spotlight -- These should be sent regardless of upstream Sentry configuration +- MUST enable profiling to Spotlight +- MUST enable log collection to Spotlight ### Pipeline Architecture @@ -219,29 +219,28 @@ The default Spotlight backend URL is: http://localhost:8969/stream ``` -This URL should be used when: -- `spotlight: true` is set (boolean, no URL specified) -- `SENTRY_SPOTLIGHT` is set to a truthy value (not a URL string) +This URL MUST be used when: +- `spotlight: true` is set (boolean, no URL specified) and `SENTRY_SPOTLIGHT` is not set +- `SENTRY_SPOTLIGHT` is set to a truthy value (not a URL string) and `spotlight` config is not set ### Default Behavior -- Spotlight is **disabled by default** -- SDKs MUST only enable Spotlight when explicitly configured or when the environment variable is set. +- Spotlight MUST be **disabled by default** and MUST only be enabled when explicitly configured or when the environment variable is set. ## Error Handling -SDKs must handle Spotlight server connectivity issues gracefully: +SDKs MUST handle Spotlight server connectivity issues gracefully: ### Unreachable Server -- If the Spotlight server is unreachable, SDKs should: - - Log an error message (ideally once, not per-envelope) - - Implement exponential backoff retry logic - - Continue normal Sentry operation without interruption +- If the Spotlight server is unreachable, SDKs: + - SHOULD log an error message (ideally once, not per-envelope) + - SHOULD implement exponential backoff retry logic + - MUST continue normal Sentry operation without interruption ### Retry Logic -**Recommended retry strategy:** +**RECOMMENDED retry strategy:** ```python import time @@ -284,15 +283,15 @@ class SpotlightTransport: ### Logging -- Log errors at the appropriate level (typically `ERROR` or `WARNING`) -- Avoid logging errors for every failed envelope to prevent log spam -- Consider logging once per connection failure, then periodically if failures persist +- SHOULD log errors at the appropriate level (typically `ERROR` or `WARNING`) +- MUST avoid logging errors for every failed envelope to prevent log spam +- MAY consider logging once per connection failure, then periodically if failures persist ### Non-Blocking Behavior -- Spotlight transmission must **never block** normal Sentry operation -- If Spotlight is unavailable, the SDK should continue sending data to Sentry normally -- Spotlight failures should not affect event capture, transaction recording, or any other SDK functionality +- Spotlight transmission MUST **never block** normal Sentry operation +- If Spotlight is unavailable, the SDK MUST continue sending data to Sentry normally +- Spotlight failures MUST NOT affect event capture, transaction recording, or any other SDK functionality ## Implementation Examples From ac3e098cd12473d53634bc4c0934a29acd421df8 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 14 Nov 2025 09:52:44 +0000 Subject: [PATCH 13/16] address review comments --- develop-docs/sdk/expected-features/spotlight.mdx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx index 3a67ce004beb8..04e12343e406a 100644 --- a/develop-docs/sdk/expected-features/spotlight.mdx +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -62,7 +62,14 @@ spotlightUrl: "http://localhost:3000/stream" # Ignored ## Environment Variable Handling -SDKs MUST support the `SENTRY_SPOTLIGHT` environment variable. The value MUST be parsed according to the following rules: +SDKs MUST support the `SENTRY_SPOTLIGHT` environment variable. This is to enable `spotlight run` to be used as a development server, +which is the preferred way to run Spotlight. In this mode Spotlight runs your development command for you, with a fresh, unique Spotlight +server running on a random port. To enable Spotlight on the target application, it sets the `SENTRY_SPOTLIGHT` environment variable to the +URL of the Spotlight server. It also does some accomodations based on the target application, such as altering the host value for Docker Compose +while keeping the front-end ones the same. It will also support emulator-based development enviroments and will set the host value accordingly in +the near future. + +The value MUST be parsed according to the following rules: ### Truthy Values @@ -172,6 +179,7 @@ When Spotlight is enabled, SDKs MUST implement the following data collection beh - MUST enable **all PII data collection** for Spotlight (equivalent to `sendDefaultPii: true`) - Spotlight is intended for local development, so full data visibility is expected +- To achieve this, the RECOMMENDED approach is to collect all PII data and then scrub it locally before sending it to Sentry while keeping it for Spotlight. ### Profiling and Logs @@ -234,7 +242,8 @@ SDKs MUST handle Spotlight server connectivity issues gracefully: ### Unreachable Server - If the Spotlight server is unreachable, SDKs: - - SHOULD log an error message (ideally once, not per-envelope) + - MUST log an error message at least once + - MUST NOT log an error message for every failed envelope - SHOULD implement exponential backoff retry logic - MUST continue normal Sentry operation without interruption From e3aefbee2282c3b0213afaff5b5463c786ae4cc4 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 14 Nov 2025 09:54:22 +0000 Subject: [PATCH 14/16] fix typos --- develop-docs/sdk/expected-features/spotlight.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx index 04e12343e406a..f84dd64f00020 100644 --- a/develop-docs/sdk/expected-features/spotlight.mdx +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -65,8 +65,8 @@ spotlightUrl: "http://localhost:3000/stream" # Ignored SDKs MUST support the `SENTRY_SPOTLIGHT` environment variable. This is to enable `spotlight run` to be used as a development server, which is the preferred way to run Spotlight. In this mode Spotlight runs your development command for you, with a fresh, unique Spotlight server running on a random port. To enable Spotlight on the target application, it sets the `SENTRY_SPOTLIGHT` environment variable to the -URL of the Spotlight server. It also does some accomodations based on the target application, such as altering the host value for Docker Compose -while keeping the front-end ones the same. It will also support emulator-based development enviroments and will set the host value accordingly in +URL of the Spotlight server. It also does some accommodations based on the target application, such as altering the host value for Docker Compose +while keeping the front-end ones the same. It will also support emulator-based development environments and will set the host value accordingly in the near future. The value MUST be parsed according to the following rules: From 4585f659454c5252aa70b9b7af95cb170a224218 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 14 Nov 2025 11:39:24 +0000 Subject: [PATCH 15/16] add requirements for user notification on potentially confusing situations --- develop-docs/sdk/expected-features/spotlight.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx index f84dd64f00020..311b4aa4e7c5d 100644 --- a/develop-docs/sdk/expected-features/spotlight.mdx +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -127,10 +127,12 @@ The interaction between configuration options and environment variables MUST fol This allows developers to enable Spotlight via config but override the URL via environment variable 2. **If `spotlight` is set to a string URL** → it MUST override the env var completely + When this happens, the SDK MUST print a warning to the console indicating that the config URL is taking precedence over the env var 3. **If using two-attribute approach:** - If `spotlightUrl` config and env var are both set → MUST use config value (`spotlightUrl`) - If `spotlight: false` is explicitly set → MUST ignore `spotlightUrl` value, the env var, and any URL configuration + - In either case the SDK MUST print a warning to the console explaining the reason for deactivation of Spotlight **Precedence Examples:** From 278096ee12f139229922a373bc44a77523112f2e Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 14 Nov 2025 14:17:23 +0000 Subject: [PATCH 16/16] Apply suggestion from @BYK --- develop-docs/sdk/expected-features/spotlight.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop-docs/sdk/expected-features/spotlight.mdx b/develop-docs/sdk/expected-features/spotlight.mdx index 311b4aa4e7c5d..d7b89bf6fbfa7 100644 --- a/develop-docs/sdk/expected-features/spotlight.mdx +++ b/develop-docs/sdk/expected-features/spotlight.mdx @@ -132,7 +132,7 @@ The interaction between configuration options and environment variables MUST fol 3. **If using two-attribute approach:** - If `spotlightUrl` config and env var are both set → MUST use config value (`spotlightUrl`) - If `spotlight: false` is explicitly set → MUST ignore `spotlightUrl` value, the env var, and any URL configuration - - In either case the SDK MUST print a warning to the console explaining the reason for deactivation of Spotlight + - In either case the SDK MUST print a warning to the console explaining the reason for deactivation of Spotlight or that the env variable exists but not being used due to hard-coded configuration. **Precedence Examples:**