Skip to content

Conversation

@DAcodedBEAT
Copy link
Contributor

resolves: #846

Add SpotlightTransport that sends events to local Spotlight server for real-time debugging during development. The integration works by wrapping the existing transport and duplicating events to Spotlight.

Features:

  • Spotlight transport decorator supporting custom URL overrides
  • SENTRY_SPOTLIGHT environment variable for easy enabling
  • Example program demonstrating usage patterns
  • README documentation update

@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 60.41667% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.93%. Comparing base (1ce3436) to head (d01d90c).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
transport.go 54.54% 17 Missing and 8 partials ⚠️
mocks.go 48.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1085      +/-   ##
==========================================
- Coverage   86.04%   85.93%   -0.12%     
==========================================
  Files          62       63       +1     
  Lines        6090     6241     +151     
==========================================
+ Hits         5240     5363     +123     
- Misses        635      657      +22     
- Partials      215      221       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cleptric cleptric marked this pull request as draft September 15, 2025 19:56
@cleptric
Copy link
Member

Thanks for your PR, but we won't merge this anytime soon. We have a big refactor coming in our transport and we can look at this afterwards maybe.

@DAcodedBEAT
Copy link
Contributor Author

@cleptric Thanks for the update!

I first asked about Spotlight support back in June 2024 and only heard back a year later with "no progress", so I went ahead and built this to give the community something useful and closer to what Python/JS already have (and to help offload some effort since the Sentry team is swamped).

I understand holding off until the transport refactor, but is there a public roadmap or place where this is being discussed? It would really help contributors know what’s changing and avoid working on features that might get blocked.

Happy to rebase once things stabilize!

@cleptric cleptric marked this pull request as ready for review October 1, 2025 01:10
@cleptric
Copy link
Member

cleptric commented Oct 1, 2025

I'm ok merging this now instead of waiting for our refactoring, as the surface area is indeed rather small.
If you could address the lint issue, we can review it and write docs prior the release.

cursor[bot]

This comment was marked as outdated.

@cleptric cleptric requested a review from BYK October 1, 2025 18:59
@cleptric cleptric added the Feature Issue type label Oct 1, 2025
@DAcodedBEAT
Copy link
Contributor Author

I'm ok merging this now instead of waiting for our refactoring, as the surface area is indeed rather small. If you could address the lint issue, we can review it and write docs prior the release.

Sorry for missing the lint errors! I've fixed it and re-pushed (trying to keep a clean git history for y'all). Let me know if there's anything else I can do to get this merged!

Copy link
Contributor

@giortzisg giortzisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Left some small comments. Let's get them fixed and we can merge this.

@DAcodedBEAT DAcodedBEAT force-pushed the feature/spotlight branch 2 times, most recently from a0b6588 to d660c5e Compare December 12, 2025 22:47
Add SpotlightTransport that sends events to local Spotlight server for
real-time debugging during development. The integration works by wrapping
the existing transport and duplicating events to Spotlight.

Features:
- Spotlight transport decorator supporting custom URL overrides
- SENTRY_SPOTLIGHT environment variable for easy enabling
- Example program demonstrating usage patterns
- README documentation update
Address review comments from PR:
- Move SENTRY_SPOTLIGHT env var check to NewClient
- Remove noopTransport check in SendEvent
- Use event.Sdk.Name/Version for User-Agent header
- Use context for HTTP requests
- Always drain HTTP response bodies
- Use shared MockTransport from mocks.go
@DAcodedBEAT
Copy link
Contributor Author

@giortzisg / @cleptric - may I please get some re-reviews on this?

Explicitly handle error from NewDsn to prevent nil pointer panic.
Sentry delivery is unaffected as it occurs before Spotlight.
Add FlushCount() and CloseCount() accessors to MockTransport with
optional ResetCounts() for multi-assertion tests.

Update tests to verify the underlying transport methods are
properly delegated instead of silently broken.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Issue type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Spotlight

3 participants