Skip to content

Feat: Integrate Sentry error reporting and enhance observability features#194

Merged
SloMR merged 23 commits into
mainfrom
feat/AddObservability
May 8, 2026
Merged

Feat: Integrate Sentry error reporting and enhance observability features#194
SloMR merged 23 commits into
mainfrom
feat/AddObservability

Conversation

@SloMR
Copy link
Copy Markdown
Owner

@SloMR SloMR commented May 8, 2026

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:

Environment & Deployment Configuration:

Documentation & Legal:

Security & Privacy:

Tooling Improvements:

These changes make it easier and safer to configure, deploy, and monitor PastePoint while maintaining strong privacy guarantees.

SloMR added 9 commits May 7, 2026 22:59
- 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.
@SloMR SloMR self-assigned this May 8, 2026
Copilot AI review requested due to automatic review settings May 8, 2026 11:00
@SloMR SloMR added the documentation Improvements or additions to documentation label May 8, 2026
@SloMR SloMR added this to PastePoint May 8, 2026
@SloMR SloMR added enhancement New feature or request feature Creating a new feature dependencies Pull requests that update a dependency file typescript Pull requests that update TypeScript code translation Update for the translations server Changes made for the Server side client Changes made for the Client side script Generate or modify the scripts. UI UI changes Bump Version Bump the project version labels May 8, 2026
@SloMR SloMR moved this to testing in PastePoint May 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 dev uses --env-file .env.development but doesn’t check that the file exists (unlike make 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.

Comment thread server/src/main.rs
Comment thread server/src/main.rs Outdated
Comment thread server/src/main.rs
Comment thread client/web/src/main.ts
Comment thread client/web/src/main.ts
Comment thread README.md Outdated
Comment thread docker-compose.yml Outdated
SloMR added 4 commits May 8, 2026 14:21
- 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.
SloMR added 6 commits May 8, 2026 18:58
- 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 dev assumes .env.development already exists; if it’s missing, docker compose --env-file .env.development ... fails with a generic error. For consistency with prod (and to improve onboarding), add an explicit existence check with a clear message to copy .env.development.example first.
# 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"

Comment thread client/web/src/app/core/services/communication/websocket-connection.service.ts Outdated
Comment thread client/web/src/app/core/services/room-management/room.service.ts Outdated
Comment thread DISCLAIMER.md
Comment thread README.md
Comment thread README.md
Comment thread client/web/src/main.ts
Comment thread server/src/main.rs
Comment thread server/src/handler.rs
SloMR added 3 commits May 8, 2026 21:41
- Wrap Sentry transaction in `Option` to prevent crashes if the client is unavailable.
@SloMR SloMR added nginx Changes made for the Nginx configuration docker Modification for docker labels May 8, 2026
@SloMR SloMR merged commit 7253804 into main May 8, 2026
25 checks passed
@SloMR SloMR deleted the feat/AddObservability branch May 8, 2026 18:48
@github-project-automation github-project-automation Bot moved this from testing to done in PastePoint May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bump Version Bump the project version client Changes made for the Client side dependencies Pull requests that update a dependency file docker Modification for docker documentation Improvements or additions to documentation enhancement New feature or request feature Creating a new feature nginx Changes made for the Nginx configuration script Generate or modify the scripts. server Changes made for the Server side translation Update for the translations typescript Pull requests that update TypeScript code UI UI changes

Projects

Status: done

Development

Successfully merging this pull request may close these issues.

2 participants