Skip to content

Operations

Maxime Gauthier edited this page Apr 30, 2026 · 1 revision

Operations

Boot Behavior

Enabled plugins are booted during startup. Boot failures are intentional hard failures because they usually mean required configuration, gems, or infrastructure are missing.

Examples:

  • enabling redis without the optional Redis bundle group
  • enabling postgres without DATABASE_URL
  • enabling admin_notifications without ADMIN_NOTIFICATION_CHANNEL_ID
  • enabling harassment without postgres

Runtime plugin hooks are isolated after boot. If a hook fails while handling messages or contributing optional behavior, the bot logs plugin_hook_failed and continues processing unrelated work.

Logging

The bot emits structured JSON logs by default. Each entry includes timestamp, level, event name, and event-specific fields.

Use plain logs locally:

LOG_FORMAT=plain

OpenTelemetry

Enable telemetry with:

PLUGINS=telemetry
TELEMETRY_ENABLED=true
OTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.io
OTEL_EXPORTER_OTLP_HEADERS=x-honeycomb-team=secretkey
OTEL_SERVICE_NAME=OpenModBot

Install optional telemetry dependencies locally:

bundle config set --local with telemetry
bundle install

For Docker:

BUNDLE_WITH=telemetry docker compose build

When combining optional groups in Docker, use values such as BUNDLE_WITH=redis:postgres:telemetry.

Harassment Worker

The harassment background worker logs harassment_worker_failed when one processing pass fails, then continues polling due jobs. Repeated worker failures usually indicate an unhealthy classifier, repository, or database dependency and should be treated as operational alerts.

Harassment Postgres Cutover

Historical Redis harassment state can be bootstrapped into Postgres:

PLUGINS=redis,postgres
ruby scripts/bootstrap_harassment_postgres.rb

Rebuild relationship-edge projections:

PLUGINS=postgres
ruby scripts/rebuild_harassment_relationship_edges.rb

Verify Redis and Postgres counts before cutover:

PLUGINS=redis,postgres
ruby scripts/verify_harassment_postgres.rb

The full cutover sequence is documented in bot/docs/harassment-postgres-cutover.md.

Clone this wiki locally