Skip to content

RE1-T115 More TTS work plus adding Sentry to TTS service#360

Merged
ucswift merged 1 commit intomasterfrom
develop
May 3, 2026
Merged

RE1-T115 More TTS work plus adding Sentry to TTS service#360
ucswift merged 1 commit intomasterfrom
develop

Conversation

@ucswift
Copy link
Copy Markdown
Member

@ucswift ucswift commented May 3, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Integrated error tracking and performance monitoring into the text-to-speech service for enhanced reliability and diagnostic insights.
  • Chores

    • Expanded text-to-speech service dependencies with additional audio synthesis libraries for improved functionality.
    • Added service configuration parameters to support monitoring and tracking infrastructure.

@request-info
Copy link
Copy Markdown

request-info Bot commented May 3, 2026

Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

📝 Walkthrough

Walkthrough

This PR adds Sentry error tracking and performance monitoring to the TTS web service. It introduces a new configuration field, adds Sentry NuGet dependencies, initializes Sentry in the application startup, updates the configuration settings, and enhances the Docker image with additional TTS-specific system dependencies.

Changes

Sentry Monitoring for TTS Service

Layer / File(s) Summary
Configuration
Core/Resgrid.Config/ExternalErrorConfig.cs, Web/Resgrid.Web.Tts/appsettings.json
New ExternalErrorServiceUrlForTts field added to ExternalErrorConfig. Sentry configuration section added to appsettings.json with breadcrumb, event level, and activity data settings.
Dependencies
Web/Resgrid.Web.Tts/Resgrid.Web.Tts.csproj
Sentry.AspNetCore and Sentry.Profiling NuGet packages (v5.4.0) added to the project.
Initialization
Web/Resgrid.Web.Tts/Program.cs
Sentry error tracking initialized conditionally when ExternalErrorServiceUrlForTts is configured. Custom trace sampling excludes health check endpoints (/health, /livez, /readyz) while using configured sample rate for others.
Infrastructure
Web/Resgrid.Web.Tts/Dockerfile
Ubuntu multiverse repository enabled and TTS dependencies installed (mbrola, mbrola-us1) alongside existing packages (espeak-ng, ffmpeg, ca-certificates).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • RE1-T102 Added healthcheck #279: Adds a parallel Sentry configuration field (ExternalErrorServiceUrlForMcp) to ExternalErrorConfig for a different service, following the same pattern as this PR.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the two main changes: TTS work and Sentry integration to the TTS service, matching the changeset accurately.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Web/Resgrid.Web.Tts/Program.cs (1)

31-56: ⚡ Quick win

TracesSampleRate (Line 31) is dead code — TracesSampler takes precedence when both are set.

The two options are meant to be mutually exclusive; if you set both, TracesSampler will take precedence. Since TracesSampler is configured (Lines 39–56) and already returns SentryPerfSampleRate as its fallback (Line 55), the explicit TracesSampleRate assignment on Line 31 has no effect.

♻️ Proposed cleanup
 	options.Dsn = ExternalErrorConfig.ExternalErrorServiceUrlForTts;
 	options.AttachStacktrace = true;
 	options.SendDefaultPii = true;
 	options.AutoSessionTracking = true;
-	options.TracesSampleRate = ExternalErrorConfig.SentryPerfSampleRate;
 	options.Environment = ExternalErrorConfig.Environment;
 	options.Release = Assembly.GetEntryAssembly()?.GetName().Version?.ToString();
 	options.ProfilesSampleRate = ExternalErrorConfig.SentryProfilingSampleRate;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Web/Resgrid.Web.Tts/Program.cs` around lines 31 - 56, Remove the redundant
TracesSampleRate assignment because TracesSampler takes precedence; delete or
omit the line setting options.TracesSampleRate =
ExternalErrorConfig.SentryPerfSampleRate and rely solely on the configured
options.TracesSampler (which already returns
ExternalErrorConfig.SentryPerfSampleRate as fallback) so tracing behavior is
deterministic; ensure no other code later expects TracesSampleRate to be set.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Web/Resgrid.Web.Tts/Program.cs`:
- Around line 31-56: Remove the redundant TracesSampleRate assignment because
TracesSampler takes precedence; delete or omit the line setting
options.TracesSampleRate = ExternalErrorConfig.SentryPerfSampleRate and rely
solely on the configured options.TracesSampler (which already returns
ExternalErrorConfig.SentryPerfSampleRate as fallback) so tracing behavior is
deterministic; ensure no other code later expects TracesSampleRate to be set.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 90af6d0a-7619-4d9f-aac8-d4dfee789c3c

📥 Commits

Reviewing files that changed from the base of the PR and between 1c45da9 and 4f9e1aa.

📒 Files selected for processing (5)
  • Core/Resgrid.Config/ExternalErrorConfig.cs
  • Web/Resgrid.Web.Tts/Dockerfile
  • Web/Resgrid.Web.Tts/Program.cs
  • Web/Resgrid.Web.Tts/Resgrid.Web.Tts.csproj
  • Web/Resgrid.Web.Tts/appsettings.json

@ucswift
Copy link
Copy Markdown
Member Author

ucswift commented May 3, 2026

Approve

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

This PR is approved.

@ucswift ucswift merged commit 31de68a into master May 3, 2026
18 of 19 checks passed
This was referenced May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant