Repository navigation
feat(observability): Add OpenTelemetry logs, metrics and traces with optional Sentry - #78
Open
tintinhamans wants to merge 5 commits into
Open
tintinhamans wants to merge 5 commits into
tintinhamans wants to merge 5 commits into
Conversation
|
This PR is doing a lot more than logging. Are you sure this PR is in line with the main branch? |
tintinhamans
force-pushed
the
arctic/feat/observability
branch
from
October 29, 2026 04:59
a9d22bb to
9ecd3cd
Compare
This was referenced Oct 29, 2026
Contributor
Author
Was part of the stack before, made it based on main now. |
tintinhamans
force-pushed
the
arctic/feat/observability
branch
from
October 29, 2026 05:13
9ecd3cd to
73de6d3
Compare
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.
Moves logging to structured
ILoggereverywhere and adds OpenTelemetry logs, metrics and traces, exported over OTLP to a collector like Grafana Alloy. Sentry is optional and gets errors, plus logs and traces if enabled. Metrics only go over OTLP since Sentry 6.8 can't read .NET meters. Everything is off by default (OpenTelemetry:Enabled,Sentry:enabled), anddocs/observability.mdcovers config, the metric list and an Alloy example.Database, HTTP and runtime metrics come from the built-in MySqlConnector, ASP.NET Core, HttpClient and runtime meters. On top of that there are 14
genonline.*metrics worth alerting on: online players, active lobbies, auth attempts, WebSocket connections, failures and send queue depth, matchmaking queue, wait time and matches, background job failures and last success, external publication failures and backlog age, and security actions (rate limits, moderation, anti-cheat). Labels are small fixed sets, never player, lobby or match IDs.Spans never carry SQL, connection strings or database users, and outbound HTTP spans only keep scheme, host and port since the TURN key is in the Cloudflare path. EF's command events are ignored in the context options, so SQL can't be logged whatever the logging config says. Slow commands (
SlowDatabaseCommandMilliseconds, default 500) are logged with operation, duration and result only. Logs and traces do carry user, lobby and match IDs, so treat the collector and Sentry as holding player identifiers.Builds on #80 (MySqlConnector advisory bump), so its commit stays in the diff until it lands. Lands before #77 and #71–#75, which build on it.