diagnostics-prometheus. يستمع إلى التشخيصات الموثوقة وأحداث استقرار Gateway الصادرة من النواة، ثم يعرض نقطة نهاية نصية بتنسيق Prometheus على:
text/plain; version=0.0.4; charset=utf-8، وهو تنسيق العرض القياسي في Prometheus.
للتتبعات والسجلات ودفع OTLP وسمات GenAI الدلالية في OpenTelemetry، راجع تصدير OpenTelemetry.
بدء سريع
يلزم ضبط
diagnostics.enabled: true. بدونه، يظل Plugin يسجّل مسار HTTP، لكن لا تتدفق أي أحداث تشخيصية إلى أداة التصدير، لذلك تكون الاستجابة فارغة.المقاييس المصدّرة
| المقياس | النوع | التسميات |
|---|---|---|
openclaw_run_completed_total | عداد | channel, model, outcome, provider, trigger |
openclaw_run_duration_seconds | مدرج تكراري | channel, model, outcome, provider, trigger |
openclaw_model_call_total | عداد | api, error_category, model, outcome, provider, transport |
openclaw_model_call_duration_seconds | مدرج تكراري | api, error_category, model, outcome, provider, transport |
openclaw_model_failover_total | عداد | from_model, from_provider, lane, reason, suspended, to_model, to_provider |
openclaw_model_tokens_total | عداد | agent, channel, model, provider, token_type |
openclaw_gen_ai_client_token_usage | مدرج تكراري | model, provider, token_type |
openclaw_model_cost_usd_total | عداد | agent, channel, model, provider |
openclaw_skill_used_total | عداد | activation, agent, skill, source |
openclaw_tool_execution_total | عداد | error_category, outcome, params_kind, tool, tool_owner, tool_source |
openclaw_tool_execution_duration_seconds | مدرج تكراري | error_category, outcome, params_kind, tool, tool_owner, tool_source |
openclaw_tool_execution_blocked_total | عداد | denied_reason, params_kind, tool, tool_owner, tool_source |
openclaw_harness_run_total | عداد | channel, error_category, harness, model, outcome, phase, plugin, provider |
openclaw_harness_run_duration_seconds | مدرج تكراري | channel, error_category, harness, model, outcome, phase, plugin, provider |
openclaw_webhook_received_total | عداد | channel, webhook |
openclaw_webhook_error_total | عداد | channel, webhook |
openclaw_webhook_duration_seconds | مدرج تكراري | channel, webhook |
openclaw_message_received_total | عداد | channel, source |
openclaw_message_dispatch_started_total | عداد | channel, source |
openclaw_message_dispatch_completed_total | عداد | channel, outcome, reason, source |
openclaw_message_dispatch_duration_seconds | مدرج تكراري | channel, outcome, reason, source |
openclaw_message_processed_total | عداد | channel, outcome, reason |
openclaw_message_processed_duration_seconds | مدرج تكراري | channel, outcome, reason |
openclaw_message_delivery_started_total | عداد | channel, delivery_kind |
openclaw_message_delivery_total | عداد | channel, delivery_kind, error_category, outcome |
openclaw_message_delivery_duration_seconds | مدرج تكراري | channel, delivery_kind, error_category, outcome |
openclaw_talk_event_total | عداد | brain, event_type, mode, provider, transport |
openclaw_talk_event_duration_seconds | مدرج تكراري | brain, event_type, mode, provider, transport |
openclaw_talk_audio_bytes | مدرج تكراري | brain, event_type, mode, provider, transport |
openclaw_queue_lane_size | مقياس | lane |
openclaw_queue_lane_wait_seconds | مدرج تكراري | lane |
openclaw_session_state_total | عداد | reason, state |
openclaw_session_queue_depth | مقياس | state |
openclaw_session_turn_created_total | عداد | agent, channel, trigger |
openclaw_session_stuck_total | عداد | reason, state |
openclaw_session_stuck_age_seconds | مدرج تكراري | reason, state |
openclaw_session_recovery_total | عداد | action, active_work_kind, state, status |
openclaw_session_recovery_age_seconds | مدرج تكراري | action, active_work_kind, state, status |
openclaw_liveness_warning_total | عداد | reason |
openclaw_liveness_sessions | مقياس | state |
openclaw_liveness_event_loop_delay_p99_seconds | مدرج تكراري | reason |
openclaw_liveness_event_loop_delay_max_seconds | مدرج تكراري | reason |
openclaw_liveness_event_loop_utilization_ratio | مدرج تكراري | reason |
openclaw_liveness_cpu_core_ratio | مدرج تكراري | reason |
openclaw_payload_large_total | عداد | action, channel, plugin, reason, surface |
openclaw_payload_large_bytes | مدرج تكراري | action, channel, plugin, reason, surface |
openclaw_memory_bytes | مقياس | kind |
openclaw_memory_rss_bytes | مدرج تكراري | لا شيء |
openclaw_memory_pressure_total | عداد | level, reason |
openclaw_telemetry_exporter_total | عداد | exporter, reason, signal, status |
openclaw_prometheus_series_dropped_total | عداد | لا شيء |
سياسة التسميات
تسميات محدودة ومنخفضة التعددية
تسميات محدودة ومنخفضة التعددية
تبقى تسميات Prometheus محدودة ومنخفضة التعددية. لا تصدر أداة التصدير معرّفات تشخيصية خامًا مثل
runId أو sessionKey أو sessionId أو callId أو toolCallId أو معرّفات الرسائل أو معرّفات المحادثات أو معرّفات طلبات المزوّدين.تُنقّح قيم التسميات ويجب أن تطابق سياسة OpenClaw للأحرف منخفضة التعددية. تُستبدل القيم التي لا تستوفي السياسة بـ unknown أو other أو none، حسب المقياس. وتُستبدل أيضًا التسميات التي تبدو كمفاتيح جلسات وكيل ذات نطاق بـ unknown.حد السلاسل ومحاسبة التجاوز
حد السلاسل ومحاسبة التجاوز
تضع أداة التصدير حدًا أقصى للسلاسل الزمنية المحتفَظ بها في الذاكرة يبلغ 2048 سلسلة عبر العدادات والمقاييس والمدرجات التكرارية مجتمعة. تُسقَط السلاسل الجديدة التي تتجاوز هذا الحد، وتزداد قيمة
openclaw_prometheus_series_dropped_total بمقدار واحد كل مرة.راقب هذا العداد كإشارة حاسمة إلى أن سمة في المصدر الأعلى تسرّب قيمًا عالية التعددية. لا ترفع أداة التصدير الحد تلقائيًا أبدًا؛ إذا بدأ بالارتفاع، فأصلح المصدر بدلًا من تعطيل الحد.ما لا يظهر أبدًا في مخرجات Prometheus
ما لا يظهر أبدًا في مخرجات Prometheus
- نص الموجه، نص الاستجابة، مدخلات الأدوات، مخرجات الأدوات، موجهات النظام
- نصوص محادثات Talk، حمولات الصوت، معرّفات المكالمات، معرّفات الغرف، رموز التسليم، معرّفات الأدوار، ومعرّفات الجلسات الخام
- معرّفات طلبات المزوّد الخام (تجزئات محدودة فقط، عند الاقتضاء، على المقاطع — وليس على المقاييس أبدًا)
- مفاتيح الجلسات ومعرّفات الجلسات
- أسماء المضيفين، مسارات الملفات، القيم السرية
وصفات PromQL
الاختيار بين تصدير Prometheus وOpenTelemetry
يدعم OpenClaw كلا السطحين بشكل مستقل. يمكنك تشغيل أيٍّ منهما، أو كليهما، أو عدم تشغيلهما.- diagnostics-prometheus
- diagnostics-otel
- نموذج السحب: يقوم Prometheus بجمع
/api/diagnostics/prometheus. - لا يلزم مجمّع خارجي.
- تتم المصادقة عبر مصادقة Gateway العادية.
- السطح مخصص للمقاييس فقط (لا توجد تتبعات أو سجلات).
- الأفضل للمكدسات الموحّدة مسبقًا على Prometheus + Grafana.
استكشاف الأخطاء وإصلاحها
جسم استجابة فارغ
جسم استجابة فارغ
- تحقق من
diagnostics.enabled: trueفي الإعدادات. - تأكد من أن Plugin مفعّل ومحمّل باستخدام
openclaw plugins list --enabled. - أنشئ بعض الحركة؛ لا تُصدر العدادات والمدرجات التكرارية أسطرًا إلا بعد حدث واحد على الأقل.
401 / غير مصرّح
401 / غير مصرّح
تتطلب نقطة النهاية نطاق مشغّل Gateway (
auth: "gateway" مع gatewayRuntimeScopeSurface: "trusted-operator"). استخدم الرمز أو كلمة المرور نفسها التي يستخدمها Prometheus لأي مسار مشغّل Gateway آخر. لا يوجد وضع عام غير مصادق عليه.`openclaw_prometheus_series_dropped_total` يرتفع
`openclaw_prometheus_series_dropped_total` يرتفع
تتجاوز سمة جديدة حد السلاسل البالغ 2048. افحص المقاييس الحديثة بحثًا عن تسمية ذات كاردينالية عالية بشكل غير متوقع، وأصلحها عند المصدر. يتعمّد المصدّر إسقاط السلاسل الجديدة بدلًا من إعادة كتابة التسميات بصمت.
يعرض Prometheus سلاسل قديمة بعد إعادة التشغيل
يعرض Prometheus سلاسل قديمة بعد إعادة التشغيل
يحتفظ Plugin بالحالة في الذاكرة فقط. بعد إعادة تشغيل Gateway، تعود العدادات إلى الصفر وتُعاد مقاييس القياس عند القيمة التالية التي يتم الإبلاغ عنها. استخدم
rate() وincrease() في PromQL للتعامل مع عمليات إعادة الضبط بشكل نظيف.ذو صلة
- تصدير التشخيصات — أرشيف zip للتشخيصات المحلية لحزم الدعم
- الصحة والجاهزية — مجسات
/healthzو/readyz - التسجيل — تسجيل قائم على الملفات
- تصدير OpenTelemetry — دفع OTLP للتتبعات والمقاييس والسجلات