Skip to content

Conversation

@richardscull
Copy link
Member

@richardscull richardscull commented Jan 4, 2026

Summary

This PR introduces comprehensive telemetry and observability improvements to the Sunrise application, including OpenTelemetry tracing, enhanced logging with Serilog, and improved monitoring capabilities.

⚠️ Migrated infrastructure values from appsettings.*.json into .env

  • New and migrated values can be viewed in .env.example.
  • We will try to fall back to the appsettings.*.json if the .env value doesn't exist.

Important

Please refer to Migration notes below if you are self-hosting sunrise.

Telemetry

Tracing

  • Added tracing for both api and server controllers.
  • We use Rougamo integration to mark methods with [TraceExecution] for AOP-based tracing**
  • Integrated Grafana Tempo for centralized traces aggregation
  • Added tracing for specific heavy methods.

Logging

  • Migrated logger factories to use Serilog logger
  • Integrated Grafana Loki for centralized log aggregation
  • Added logging for slow queries.
  • Disabled W3C file logging by default in favour of logger exporter (Loki)

Metrics

  • Added new metrics (efcore + db based metrics)

Misc

  • ⚠️ Hangfire server now uses MySQL instead of Postgres
  • Added parallelized medal evaluation
  • Replaced List with ConcurrentDictionary in ChatChannel for thread-safe user ID management
  • Enhanced ServicesProviderHolder to attempt retrieving HttpContext scope before creating a new one
  • Bump Microsoft.EntityFrameworkCore up to 8.0.22.


Migration notes

Due to the upcoming move to the Solar System monorepo we made almost non-compatible changes to the Sunrise. If you were using Sunrise before, please watch out for the following breaking changes:

  • We now use .env file for environment variables instead of appsettings.json - Please refer to step 3.1 of the Standalone installation with self-signed certificate (Docker) 🐳 or Development installation ⚒️ sections for more information.
  • ⚠️ Hangfire now uses MySQL instead of Postgres - This change is most important and requires action if you try to update your existing Sunrise server.
    • If you see Deprecated hangfire connection was using Postgres, which is no longer supported error at the server startup, please create .env file and setup the HANGFIRE_* variables according to your MySQL setup. View example below:
  # Check your MySQL connection details from `appsettings.*.json` file:
      "ConnectionString": "Host=mysql-sunrise-db;Port=3306;Database=sunrise;Username=root;Password=root;SslMode=Required;"
  # Then set the following variables in your `.env` file:
  HANGFIRE_HOST=mysql-sunrise-db
  HANGFIRE_PORT=3306
  HANGFIRE_USER=root
  HANGFIRE_PASSWORD=root
  • We dropped docker compose setup for prometheus and grafana - These services were an overhead for the solo Sunrise server setup. They are now included in the Solar System monorepo only.

@richardscull richardscull self-assigned this Jan 4, 2026
@richardscull richardscull added refactor Improvements of already existing system enhancement New feature or request Major release This pull request introduces significant changes, new features, or major improvements. labels Jan 4, 2026
@richardscull richardscull marked this pull request as draft January 4, 2026 18:10
@richardscull richardscull force-pushed the feat/better-telemetry branch from c7e051b to dbd08d1 Compare January 5, 2026 12:25
@richardscull richardscull force-pushed the feat/better-telemetry branch from 03ca379 to 913cb87 Compare January 5, 2026 17:55
@richardscull richardscull marked this pull request as ready for review January 6, 2026 20:36
new ExternalApi(ApiType.CalculateScorePerformance, ApiServer.Observatory, $"http://{ObservatoryUrl}/calculator/score", 0, 0, true),
new ExternalApi(ApiType.BeatmapDownload, ApiServer.Observatory, $"http://{ObservatoryUrl}/osu/{{0}}", 0, 1),
new ExternalApi(ApiType.BeatmapSetDataById, ApiServer.Observatory, $"http://{ObservatoryUrl}/api/v2/s/{{0}}", 0, 1),
new ExternalApi(ApiType.BeatmapSetDataById, ApiServer.Observatory, $"http://{ObservatoryUrl}/api/v2/s/{{0}}?allowMissingNonBeatmapValues=true", 0, 1),
Copy link
Member Author

Choose a reason for hiding this comment

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

Reflect SunriseCommunity/Observatory#7

Basically, this will allow us to fallback to osu.direct if catboy.best fails (or unavailable) at getting beatmap by hash.

Comment on lines +35 to +39
var httpContextAccessor = _serviceProvider.GetService<IHttpContextAccessor>();

return httpContextAccessor?.HttpContext != null
? new RequestScopeWrapper(httpContextAccessor.HttpContext.RequestServices)
: _serviceProvider.CreateScope();
Copy link
Member Author

Choose a reason for hiding this comment

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

Huge improvement actually, pretty proud of this one.

@richardscull richardscull merged commit 17dd8eb into master Jan 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Major release This pull request introduces significant changes, new features, or major improvements. refactor Improvements of already existing system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants