Feat: Integrate Sentry error reporting and enhance observability features#194
Merged
Conversation
- Automated .env.development creation using a script if missing. - Updated gitignore to avoid committing local env files. - Facilitates smoother local development without manual setup.
- New .env.production.example template (gitignored real file lives on host)
- Makefile prod target requires .env.production
- docker-compose.yml: ${VAR:?error} replaces silent defaults for required vars
- .env.development.example: add SENTRY_ENABLED / SENTRY_DSN placeholders
- Add sentry + sentry-actix crates with privacy-tight defaults (send_default_pii=false, before_send strips user/headers/body/query, loopback IP suppresses geo-IP enrichment server-side) - New SentryConfig loaded from TOML; SENTRY_ENABLED / SENTRY_DSN env vars override and gate initialization - Quiet noisy transport crates (reqwest/hyper/h2/rustls) in env_logger filter so app logs stay readable
- Add @sentry/angular ^10.52.0 - Init in main.ts before bootstrap, gated by environment.sentry.enabled + DSN - Sentry.createErrorHandler registered as Angular ErrorHandler - Privacy-tight beforeSend: strips user/headers/body/query/cookies, device timezone/locale, and culture context; forces 127.0.0.1 IP to suppress server-side geo enrichment - Replay and Performance disabled (no integrations added, sample rates 0)
- README: add Observability feature, Sentry in Tech Stack, env-file workflow in Quick Start, Error Diagnostics under Security - DISCLAIMER.md: amend 5 and add new 11 (Error Diagnostics & Third-Party Processors) covering what is/isn't sent to Sentry, EU storage region, retention, and self-host opt-out - Privacy & Terms page: new "Error Diagnostics" section between Privacy and Terms; updated PRIVACY_THIRD_PARTIES wording - Bump LAST_UPDATED to May 8, 2026 across en, ar, es, fr, ru, zh-CN
- Enable sentry "log" + "logs" features for structured Logs ingestion - SentryLogger bridge: error → Exception (Issues), warn/info → Log + Breadcrumb (Logs page), debug/trace dropped - enable_logs: true on ClientOptions; sentry-actix middleware switched to with_transaction() so HTTP requests auto-create transactions - traces_sample_rate config (default 0.1); per-op sampler reduces signaling.relay to 1% to stay under free-tier quota - RelaySignalMessage / ValidateAndRelaySignal handlers wrapped in named "signaling.relay" transactions - Privacy hardening for non-Event surfaces (logs/transactions skip before_send): server_name overridden globally, default scope user set with 127.0.0.1 to suppress geo enrichment - Quiet noisy transport crates (reqwest/hyper/h2/rustls) in env_logger
- New SentryLoggerMonitor bridges ngx-logger output to Sentry: error/fatal → captureException (Issues), warn → log + breadcrumb (Logs page), info → breadcrumb only (context for the next error, not on Logs page) - Monitor registered via app initializer when Sentry is enabled - main.ts: enableLogs + tracesSampleRate read from environment; browserTracingIntegration added explicitly (not in default set); initialScope sets user.ip_address = 127.0.0.1 to suppress server-side geo enrichment on logs/transactions - Per-environment sentry.tracesSampleRate (0.1) and enableLogs (true) in environment.ts / environment.docker-dev.ts / environment.prod.ts
- Integrate Sentry spans to track WebRTC connections and file uploads. - Add tracing for room management operations.
- Enhances error monitoring by adding Sentry breadcrumbs in WebRTC data channels. - Introduces Sentry spans to track file download and upload events, improving traceability. - Streamlines Sentry data for ICE gathering by reducing excessive relay information.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds optional Sentry-based observability across the Rust server and Angular web client, plus environment templates and deployment/tooling updates to make configuration safer and more explicit.
Changes:
- Added Sentry initialization + log/trace wiring on the server, and new tracing/breadcrumb instrumentation in WebRTC + file-transfer code on the web client.
- Introduced
.env.development.example/.env.production.example, tightened.gitignore, and adjusted Docker Compose + Make targets to use explicit env files. - Expanded README / DISCLAIMER and in-app “Privacy & Terms” translations to document diagnostics, privacy defaults, and how to enable/disable reporting.
Reviewed changes
Copilot reviewed 36 out of 39 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/main.rs | Initializes Sentry, wraps Actix with Sentry middleware, and routes logs through Sentry logger integration. |
| server/src/config.rs | Adds SentryConfig and environment/config loading for Sentry toggling and sampling. |
| server/src/handler.rs | Adds Sentry transactions around websocket signaling relay handlers. |
| server/src/lib.rs | Re-exports SentryConfig. |
| server/config/production.toml | Adds [sentry] configuration defaults for production. |
| server/config/development.toml | Adds [sentry] configuration defaults for development. |
| server/config/docker-dev.toml | Adds [sentry] configuration defaults for docker-dev. |
| server/Cargo.toml | Adds sentry and sentry-actix dependencies. |
| server/Cargo.lock | Locks new Sentry dependency graph. |
| client/web/src/main.ts | Initializes Sentry in the web app before bootstrapping and scrubs event payloads. |
| client/web/src/app/app.config.ts | Adds Sentry ErrorHandler and wires ngx-logger monitoring to Sentry when enabled. |
| client/web/src/app/core/services/monitoring/sentry-logger-monitor.ts | Adds a new ngx-logger monitor that forwards logs to Sentry/breadcrumbs. |
| client/web/src/app/core/services/room-management/room.service.ts | Adds Sentry span around join-room behavior. |
| client/web/src/app/core/services/file-management/file-upload.service.ts | Adds Sentry span + outcome/status annotations for upload flows. |
| client/web/src/app/core/services/file-management/file-download.service.ts | Adds receive-span lifecycle tracking + outcome/status annotations for downloads. |
| client/web/src/app/core/services/communication/webrtc-signaling.service.ts | Adds connect spans and breadcrumbs for ICE/peer state transitions. |
| client/web/src/app/core/services/communication/webrtc-communication.service.ts | Adds breadcrumbs for datachannel errors/decoding failures. |
| client/web/src/app/features/privacy-and-terms/privacy-and-terms.component.html | Adds a diagnostics section in the UI. |
| client/web/src/app/core/i18n/localizations/*.json | Adds/updates translations for diagnostics + policy updates and updates “Last updated” date. |
| client/web/tsconfig.json | Enables JSON module resolution and includes package.json for release tagging. |
| client/web/package.json | Adds @sentry/angular. |
| client/web/package-lock.json | Locks Sentry web dependencies. |
| docker-compose.yml | Makes more env vars mandatory and passes Sentry env vars into the server container. |
| Makefile | Uses explicit --env-file for prod/dev and adds prod env-file guard. |
| scripts/configure-network.sh | Bootstraps .env.development from the committed example on fresh checkouts. |
| .gitignore | Ignores env files (.env.development, .env.production, etc.). |
| .env.development.example | Adds development env template including Sentry toggles. |
| .env.production.example | Adds production env template including Sentry toggles. |
| .env.development | Removes previously committed dev env file. |
| README.md | Documents env templates, prod setup steps, and Sentry privacy/toggling. |
| DISCLAIMER.md | Adds an “Error Diagnostics” section describing Sentry data handling and opt-out. |
Files not reviewed (1)
- client/web/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
Makefile:23
make devuses--env-file .env.developmentbut doesn’t check that the file exists (unlikemake prod). Add a similar guard with a clear “copy .env.development.example → .env.development” message to reduce setup friction on fresh checkouts.
# Development environment
dev:
@echo "Starting development environment..."
docker compose --env-file .env.development build --parallel
docker compose --env-file .env.development up --force-recreate -d
@echo "Development services are starting. View logs with: make logs"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Improve Docker environment variable error messages to prevent misconfiguration by providing clear validation prompts. - Fix lint for .env.*.example files. - Update documentation to clarify how environment variables impact build and runtime configurations.
- Use conditional middleware to enable Sentry only if it's configured. - Removed redundant log statements to streamline error reporting.
- Auto-detects environment files for Docker operations. - Improves error handling when env files are missing.
- Reduces noise in Sentry by excluding tracing for "/ws" endpoint requests.
- Switch file download log from error to debug level to reduce noise. - Add logger info for reconnect issues when page visibility changes. - Enhance WebSocket error handling to provide detailed info for debugging. - Boost Sentry observability with enriched error context and additional log data.
- Integrated Sentry with WebSocket connections and file transfers. - Enhanced performance insights with new trace data points. - Improved error tracking and diagnostics through Sentry spans.
- Ensure Sentry doesn't initialize during server-side rendering. - Reduce noise in traces by filtering unnecessary spans. - Improve browser tracing with refined integration settings.
- Introduce inactive spans for improved trace clarity. - Reset pending traces on cancellation or supersession. - Simplify room joining logic with sanitation and validation. - Improve Sentry's integration for room activities.
- Start new tracing spans to improve observability. - Add status attributes for attempted and skipped connections. - Clean up spans and attempt counts on connection completion.
- Introduce Sentry TraceService with router dependency - Improve source map enabling condition for better debugging in browser contexts - Enhance error tracking and tracing capabilities
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 39 out of 42 changed files in this pull request and generated 8 comments.
Files not reviewed (1)
- client/web/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
Makefile:28
make devassumes.env.developmentalready exists; if it’s missing,docker compose --env-file .env.development ...fails with a generic error. For consistency withprod(and to improve onboarding), add an explicit existence check with a clear message to copy.env.development.examplefirst.
# Development environment
dev:
@echo "Starting development environment..."
docker compose --env-file .env.development build --parallel
docker compose --env-file .env.development up --force-recreate -d
@echo "Development services are starting. View logs with: make logs"
…om management to streamline observability.
- Wrap Sentry transaction in `Option` to prevent crashes if the client is unavailable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces robust environment configuration templates, adds optional Sentry-based error tracking with strong privacy defaults, and updates documentation and tooling to clarify setup and security practices. The main themes are improved observability, privacy-conscious diagnostics, and clearer environment management for both development and production.
Observability & Error Tracking:
SENTRY_ENABLED,SENTRY_DSN). Sentry integration is off by default in development. [1]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[2]](https://github.com/SloMR/PastePoint/pull/194/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L33-R47) [3]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[4]](https://github.com/SloMR/PastePoint/pull/194/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R77) [5]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[6]](https://github.com/SloMR/PastePoint/pull/194/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R95) [7]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[8]](https://github.com/SloMR/PastePoint/pull/194/files#diff-ea9fbc9e09273ddeaa667f9a8e04b3238a982f74f34861a8e50f5c271e978156R3-R10) [9]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[10]](https://github.com/SloMR/PastePoint/pull/194/files#diff-ea9fbc9e09273ddeaa667f9a8e04b3238a982f74f34861a8e50f5c271e978156L18-R24) [11]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[12]](https://github.com/SloMR/PastePoint/pull/194/files#diff-ea9fbc9e09273ddeaa667f9a8e04b3238a982f74f34861a8e50f5c271e978156R48-R51) [13]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[14]](https://github.com/SloMR/PastePoint/pull/194/files#diff-9755dd05075a9dc0626315acf42fc5b61b030985b8580ef0d626d2a8339e2ef8R24) [15]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[16]](https://github.com/SloMR/PastePoint/pull/194/files#diff-9755dd05075a9dc0626315acf42fc5b61b030985b8580ef0d626d2a8339e2ef8R6811-R6905) [17]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[18]](https://github.com/SloMR/PastePoint/pull/194/files#diff-f669e832b021e795b7206497424085a6c20db1401e0d86b41ca88e7bd5dd73e4R36))Environment & Deployment Configuration:
.env.development.exampleand.env.production.exampletemplates with documentation on usage, emphasizing that real secrets should never be committed. Updated setup instructions and Makefile to enforce correct environment file handling for both development and production. [1]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[2]](https://github.com/SloMR/PastePoint/pull/194/files#diff-a938ba534220b0796ab2717a94cb9653e29b078dfbdbb830fc312d4347f84f61R1-R28) [3]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[4]](https://github.com/SloMR/PastePoint/pull/194/files#diff-b434fb70eea261665d1af2c7f5aed81f3934cb0d9c0ccdc87956952080e865ebR1-R28) [5]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[6]](https://github.com/SloMR/PastePoint/pull/194/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L13-R15) [7]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[8]](https://github.com/SloMR/PastePoint/pull/194/files#diff-da4c41d59c967338247b2f0ea6d845ab05171f942fd9521b96d3304202185db9L1-L14) [9]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[10]](https://github.com/SloMR/PastePoint/pull/194/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L200-R230))Documentation & Legal:
DISCLAIMER.mdto describe error diagnostics and third-party processors (Sentry), clarifying what data is (and is not) sent, and how to disable reporting for self-hosted instances. UpdatedREADME.mdto document Sentry usage, privacy guarantees, and environment configuration best practices. [1]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[2]](https://github.com/SloMR/PastePoint/pull/194/files#diff-43619c02edb86243d66d2e3e75076fb98393a82936fe0349205836b2a99b3d8dL58-R53) [3]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[4]](https://github.com/SloMR/PastePoint/pull/194/files#diff-43619c02edb86243d66d2e3e75076fb98393a82936fe0349205836b2a99b3d8dL97-R110) [5]](https://github.com/SloMR/pastepoint/pull/XXX/files#diff-[[6]](https://github.com/SloMR/PastePoint/pull/194/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R261-R264))Security & Privacy:
Tooling Improvements:
These changes make it easier and safer to configure, deploy, and monitor PastePoint while maintaining strong privacy guarantees.