-
-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
0 / 20 of 2 issues completed
Copy link
Labels
ProjectType: DocumentationImprovements or additions to documentationImprovements or additions to documentation
Description
Spotlight Implementation Specification
Overview
This document specifies how SDKs should implement support for Sentry Spotlight, a local development tool that provides real-time observability for errors, traces, logs, and performance data during development.
File Location
Create the specification document at develop-docs/sdk/expected-features/spotlight.mdx following the format of other expected-features documents like rate-limiting.mdx.
Document Structure
The document should include:
- Introduction - Brief overview of Spotlight and its purpose
- Configuration Options - Detailed specification of the
spotlightconfiguration attribute(s) - Environment Variable Handling - Specification for
SENTRY_SPOTLIGHTenvironment variable - Precedence Rules - Clear rules for how config options and env vars interact
- Data Collection Behavior - How Spotlight mode affects sampling, PII, and data collection
- Default Values - Default Spotlight URL and behavior
- Error Handling - How to handle unreachable Spotlight servers
- Implementation Examples - Reference implementation patterns
Key Requirements to Document
Configuration Attribute
- Single attribute approach:
spotlight: Optional[boolean|string] - Alternative two-attribute approach:
spotlight: Optional[boolean]andspotlightUrl: Optional[string] - If using two attributes, setting any truthy
spotlightUrlimpliesspotlight: trueunless explicitly set to false
Environment Variable (SENTRY_SPOTLIGHT)
- Truthy values: "true", "t", "y", "yes", "on", "1" → treat as
spotlight: true - Falsy values: "false", "f", "n", "no", "off", "0" → treat as
spotlight: false - Any other string → use as Spotlight backend URL
- Reference Python implementation:
sentry_sdk/utils.pylines 90-103
Precedence Rules
- Config option takes precedence over env var, except:
- If
spotlight: true(boolean, no URL) ANDSENTRY_SPOTLIGHTis set to a URL string → use env var URL
- If
spotlightis set to a string URL → it overrides env var - If
spotlightUrlconfig and env var are both set → prefer config value (spotlightUrl) - If
spotlight: falseexplicitly set → ignorespotlightUrlvalue and the env var
Data Collection
- Send copy of every envelope to Spotlight server
- Enable 100% sample rate for Spotlight pipeline (without affecting upstream Sentry rates)
- Enable all PII data collection for Spotlight (without affecting upstream)
- Enable profiling data and logs for Spotlight
- Ideal: separate pipeline that ignores sampling settings
- Fallback: enable manually if no DSN in development mode
Default Values
- Default Spotlight URL:
http://localhost:8969/stream
Error Handling
- If Spotlight server unreachable: log error with exponential backoff retry
- Output debug log statement ideally once
- Do not affect normal Sentry operation
Implementation Tasks
- Create
develop-docs/sdk/expected-features/spotlight.mdxwith comprehensive specification - Include code examples showing configuration patterns
- Document edge cases and precedence clearly
- Reference the Python SDK implementation as an example
- Add appropriate frontmatter (title, sidebar_order)
- Link to Spotlight documentation and GitHub repository
buenaflor
Sub-issues
Metadata
Metadata
Assignees
Labels
ProjectType: DocumentationImprovements or additions to documentationImprovements or additions to documentation