第 19 章 コンプライアンス、ストレージ & 運用 管理: #pAlerts

運用ダッシュボード、アラート、ライブ テレメトリ

運用ダッシュボード (#pOps) には、ライブおよび 24 時間の履歴として次の情報が表示されます: 1 分あたりの受信/送信メール数、遅延メールとバウンス メール、スパム率、失敗したサインイン、キューのサイズと最も古いメッセージの経過時間、プロトコルごとのアクティブ接続、CPU、メモリ、ディスクの空き容量、データベース サイズ、証明書の有効期限、クラスター ノード。アラート (#pAlerts) は、しきい値超過をメール、Webhook、SMS、Telegram、Signal、WhatsApp で通知します。外部ツールは /metrics (Prometheus)、OpenTelemetry、またはライブ イベント ストリーム (Server-Sent Events) を通じて同じデータを読み取ります。

運用のヒントとアーキテクチャに関する注記

nextxch は初回起動時に、通知先のない 5 つのルール (キューの停滞、ディスク容量の逼迫、証明書の期限切れ間近、多数のサインイン失敗、多数のバウンス) を作成します。これらは履歴に表示されます。通知を受け取るには、[通知先] でメール アドレスまたは Webhook を追加し、ルールでそれをオンにします。履歴は再起動後も保持されます (Ops:PersistHistory = false で無効化できます)。

監視ツール向けのライブ イベント ストリーム

認証は管理 API と同じです (管理者の API キーを X-Api-Key、Bearer、または Basic で指定)。テナント管理者には自分のテナントのみが表示されます。フィルター: types、direction、status、q。maxRate は 1 秒あたりのイベント数を制限します (既定 20、最大 200)。超過分は dropped イベントで報告されます。

リファレンス / 構成
curl -N -H "X-Api-Key: $NEXTXCH_KEY" \
  "https://mail.company.com/api/admin/telemetry/stream?types=delivery,rejection,auth-failure&maxRate=50"

event: delivery
data: {"at":"2026-11-02T08:15:01Z","direction":"Outbound","status":"Delivered","from":"billing@company.com","to":"customer@example.com","code":250,...}

event: auth-failure
data: {"account":"info@company.com","protocol":"IMAP","remoteIp":"203.0.113.7","reason":"invalid password"}

# Types: delivery, rejection, auth-failure, filter, alert, queue

設定、既定値 & ベスト プラクティス

設定 / 場所 説明 既定値 本番環境のベスト プラクティス
Alarmregel メトリック、条件 (>、>=、<、<=)、しきい値、継続時間 (分)。条件がその時間途切れずに続いた場合にのみアラートが発生します。 5 min 短時間のスパイクは無視: レート (毎分) は少なくとも 5 分、証明書の有効期限は 0 分。
Abklingzeit, Wiederholung, Entwarnung クールダウンは同じルールの 2 つのメッセージ間の最小間隔です。リピートはアラートが有効な間、再通知します。リカバリーは終了を報告します。 60 min / aus / an 値が変動してもアラート通知が繰り返されないよう、クールダウンは 30 分以上にしてください。
Ziele メール (送信者は設定を保存した管理者)、Webhook (type nextxch.alert の JSON、X-Nextxch-Signature: sha256=... で署名)、SMS、Telegram、Signal、WhatsApp。[通知] のチャネル経由で送信されます。 - 自社のメール サーバー以外の通知先を少なくとも 1 つ追加してください (SMS、メッセンジャー、または Webhook)。配信が停止している場合、アラート メールは届きません。
Messwerte in Prometheus und OpenTelemetry ダッシュボードのすべての値は /metrics で取得できます: nextxch_mail_inbound_total、nextxch_mail_outbound_total、nextxch_mail_deferred_total、nextxch_mail_bounced_total、nextxch_mail_rejected_total、nextxch_mail_spam_total、nextxch_auth_failures_total、nextxch_mail_spam_rate_percent、nextxch_queue_messages、nextxch_queue_deferred_messages、nextxch_queue_oldest_age_minutes、nextxch_connections_active{protocol}、nextxch_process_cpu_percent、nextxch_process_working_set_bytes、nextxch_disk_free_percent、nextxch_disk_free_bytes、nextxch_database_size_bytes、nextxch_tls_certificate_min_expiry_days、nextxch_tls_certificate_expiry_days{domain}、nextxch_cluster_nodes_active、nextxch_alerts_firing、nextxch_smtp_filter_verdicts_total{type,verdict}、nextxch_smtp_filter_failures_total。 aktiv OTLP 経由では、インストルメントはアンダースコアの代わりにドットを使った同じ名前になります (nextxch.mail.inbound)。Prometheus への変換で再び同じ名前になります。