Skillpedia
متفرقات81k · #1600

cost-export

ما الذي تفعله

تأخذ هذه المهارة بيانات تكلفة الذكاء الاصطناعي المسجلة وتحفظها بصيغة تستطيع أدوات المراقبة الأخرى عرضها. وهي مناسبة لمن يريد أن يظهر إنفاقه على الذكاء الاصطناعي في لوحة مشتركة.

متى تستخدمها

  • ✓عندما تريد أن يظهر إنفاق الذكاء الاصطناعي على لوحة Grafana أو ما يشبهها.
  • ✓عندما تريد إرسال لقطة من التكاليف إلى عنوان ويب لإعداد التقارير.
  • ✓عندما تريد تحديث بيانات التكلفة بانتظام حسب جدول زمني.

رابط المهارة

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-export/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-export/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“صدّر لي بيانات تكلفة الذكاء الاصطناعي حتى أراها على لوحتي.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تقرأ المهارة سجلات التكلفة المحفوظة، ثم تكتبها إما كملف نصي لـ Prometheus، أو كرسالة JSON ترسل إلى عنوان الاستقبال (webhook) الذي تحدده لك. وبدون خيار محدد تطبع JSON على الشاشة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Cost Export

Pulls every session-* and budget-config-* record from cost-tracking and emits in formats consumable by external observability systems. Without this, cost data lives only inside the AgentDB namespace; with it, the same data lights up dashboards.

When to use

  • After any cost-track run, to refresh metrics for Grafana / Datadog / Prometheus.
  • Cron-friendly via /loop 5m to keep external dashboards near-real-time.
  • One-shot to a webhook for ad-hoc reporting (Slack, custom endpoint).

Steps

  1. Pick a format — textfile collector for Prometheus / Grafana, or webhook POST for everything else:

    # Prometheus node_exporter textfile collector
    node plugins/ruflo-cost-tracker/scripts/export.mjs --prometheus /var/lib/node_exporter/textfile_collector/cost_tracker.prom
    
    # Webhook (POSTs JSON; add auth via env)
    EXPORT_WEBHOOK_HEADER='Authorization: Bearer $TOKEN' \
      node plugins/ruflo-cost-tracker/scripts/export.mjs --webhook https://hooks.example.com/cost-tracker
    
    # Stdout JSON (default if no flag)
    node plugins/ruflo-cost-tracker/scripts/export.mjs
    
  2. Inspect what's emitted — Prometheus output includes:

    cost_tracker_total_usd                                    <gauge>
    cost_tracker_tier_total_usd{tier="opus|sonnet|haiku"}     <gauge>
    cost_tracker_session_total_usd{session="<8-char>"}        <gauge>
    cost_tracker_session_messages{session="<8-char>"}         <counter>
    cost_tracker_budget_usd                                   <gauge>  (if budget configured)
    cost_tracker_budget_utilization                           <gauge>  (spent / budget)
    
  3. Webhook payload shape — the JSON the webhook receives matches the stdout JSON: { exportedAt, sessions: [...], budget, totalUsd, byTier }. Headers may be added via EXPORT_WEBHOOK_HEADER='K1: V1, K2: V2' (comma-separated).

Env overrides

Env Default Purpose
EXPORT_NAMESPACE cost-tracking Override target namespace
EXPORT_WEBHOOK_HEADER unset Comma-separated K: V pairs for webhook auth
EXPORT_QUIET=1 unset Suppress non-error confirmation output

Cross-references

  • cost-track — produces the data this skill exports
  • cost-budget-check — the same cost_tracker_budget_* metrics are alertable in Prometheus
  • node_exporter textfile collector docs (Prometheus convention) — drop the .prom file in the collector directory and Prometheus picks it up
الأسئلة الشائعة

ما ملف Prometheus النصي؟

هو ملف نصي عادي يحتوي على أسطر مقاييس يستطيع مجمّع node exporter قراءته وعرضه في لوحة.

هل يمكنني إضافة تسجيل دخول إلى الـ webhook؟

نعم. يمكن لإعداد في متغيرات البيئة أن يمرر ترويسة، مثل رمز التفويض، مع الطلب.

هل ترسل البيانات إلى أي مكان افتراضيًا؟

لا. تطبع JSON على الشاشة ما لم تختر خيار الملف أو الـ webhook.

التفاصيل

الوصف الأصلي من المؤلف

Export cost-tracking telemetry in Prometheus textfile or webhook JSON formats — for external observability (Grafana, Datadog, custom dashboards)

repo: ruvnet/ruflo

الشعبية

نجوم GitHub
81k
الترتيب
#1600
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة