WikiOasis runs two complementary observability systems: Sentry captures errors, exceptions, and distributed traces from every PHP request, while DogStatsD ships application metrics to a StatsD-compatible endpoint. Together they provide real-time visibility into application health, slow requests, and database errors without requiring any manual instrumentation at the wiki level. A public Instatus status page atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wikioasis/mw-config/llms.txt
Use this file to discover all available pages before exploring further.
status.wikioasis.org surfaces ongoing incidents to end users.
Monitoring Components
| Tool | Purpose | Config Location |
|---|---|---|
| Sentry PHP SDK | Error capture, distributed tracing, profiling | Sentry.php |
| Sentry Browser SDK | Client-side error capture (JS) | Sentry.php (injected via hook) |
| Monolog → Sentry | Log-level routing: exceptions, DB errors | Sentry.php |
| DogStatsD | Application metrics (counters, timers) | LocalSettings.php |
| Instatus widget | Public status page and maintenance page | DatabaseMaintenance.php |
Sentry Configuration
Sentry.php initialises the Sentry PHP SDK immediately after PrivateSettings.php
is loaded, so every subsequent line of the MediaWiki bootstrap is covered by
the active Sentry hub.
100% Trace Sampling
traces_sample_rate = 1.0 — every HTTP request generates a Sentry
transaction. This gives complete request-level visibility but may require
Sentry plan capacity planning as traffic grows.30% Profiling
profiles_sample_rate = 0.3 — 30% of traced requests also capture a
continuous CPU profile, providing function-level performance data without
the overhead of profiling every request.Stacktrace Attachment
attach_stacktrace = true — every captured message (not just exceptions)
includes a full PHP stack trace, making it easier to pinpoint the source of
informational warnings and non-fatal log entries.Breadcrumb Depth
max_breadcrumbs = 100 — up to 100 structured breadcrumb events
(log entries, DB queries, HTTP calls) are retained per transaction,
providing rich context for post-mortem debugging.Environment and Release
- Environment is read from the
MW_ENVPHP constant. If the constant is not defined, it defaults to'production'. The beta realm (hostnamestaging11) should defineMW_ENV=stagingto keep staging events in a separate Sentry environment. - Release is set to
$wgVersion, so every MediaWiki version upgrade automatically creates a new Sentry release, enabling regression tracking across deployments.
Monolog Integration
All standard MediaWiki log channels are routed through a Monolog SPI that sends records to Sentry via two dedicated handlers plus a stderr stream:| Handler | Class | Minimum Level |
|---|---|---|
sentry-logs | Sentry\Monolog\LogsHandler | INFO |
sentry-crumbs | Sentry\Monolog\BreadcrumbHandler | DEBUG |
stderr | Monolog\Handler\StreamHandler | DEBUG |
exception — PHP exceptions and Throwables
exception — PHP exceptions and Throwables
Captures every PHP exception that passes through MediaWiki’s logging
infrastructure. Works in tandem with the
LogException hook for exceptions
raised during page rendering.error — PHP errors and warnings
error — PHP errors and warnings
Captures PHP-level errors (warnings, notices) that MediaWiki converts into
log entries. The
attach_stacktrace setting ensures these arrive in Sentry
with full call-stack context.DBError — database errors
DBError — database errors
Routes all MediaWiki database-layer errors (connection failures, query errors,
deadlocks) to Sentry. These are also written to
php://stderr via the
stderr handler, making them visible in server logs.@default — catch-all logger
@default — catch-all logger
Any log channel not explicitly named in the Monolog config falls through to
@default, which routes to the same three handlers. This ensures no log
record is silently dropped.HTTP Transaction Tracking
For non-CLI requests,Sentry.php creates a TransactionContext that records
the HTTP method and URI path (query string stripped) as the transaction name:
die() or a fatal error.
MediaWiki Hook Integrations
LogException Hook
Captures any
Throwable that MediaWiki logs and is not suppressed
($suppressed === false). Suppressed exceptions (e.g. expected 404s) are
intentionally excluded to reduce noise.UserGetRights Hook
Sets Sentry user context (
id and username) for every authenticated
request. This allows Sentry issues to be filtered and searched by affected
user account.BeforePageDisplay Hook
Injects the Sentry Browser SDK
<script> tag into every page’s <head>,
enabling client-side JavaScript error capture and session replays in
addition to the server-side PHP integration.Fatal Error Capture
Both web and CLI shutdown functions callerror_get_last() and send any
fatal-class error (E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR)
to Sentry as a fatal-severity message before flushing the SDK:
DogStatsD Metrics
Application-level counters, timers, and gauges are emitted in DogStatsD format via UDP:$wgStatsTarget (MediaWiki core stats) and $wgWMEStatsdBaseUri
(WikimediaEvents extension) point to the same endpoint on
monitoring-us-east-021.ovvin.wonet. The DogStatsD format adds tag support
on top of plain StatsD, enabling per-wiki and per-cluster metric filtering in
any compatible metrics backend (e.g. Datadog, VictoriaMetrics, Grafana).
Status Page and Maintenance Mode
The public status page at https://status.wikioasis.org/ is powered by Instatus and is the canonical source of truth for ongoing incidents and scheduled maintenance windows. During database maintenance,DatabaseMaintenance.php serves an HTTP 503
response with links to the status page and the WikiOasis Discord server. An
Instatus status widget is embedded directly in the maintenance page so users
can check current incident status without navigating away.
The
readOnlyBySection entries in Database.php and the 503 maintenance
page in DatabaseMaintenance.php are complementary mechanisms. Read-only
mode allows reads to continue while blocking writes; the 503 page is used
when the cluster must be taken fully offline (e.g. for schema migrations).