Langsung ke konten
Skillpedia
Lain-lain81k Β· #1600

cost-export

Fungsinya

Skill ini mengambil data biaya AI yang sudah tercatat dan menyimpannya dalam bentuk yang bisa ditampilkan alat pemantauan lain. Skill ini untuk orang yang ingin pengeluaran AI mereka tampil di dasbor bersama.

Kapan dipakai

  • βœ“Saat Anda ingin pengeluaran AI muncul di dasbor Grafana atau sejenisnya.
  • βœ“Saat Anda ingin mengirim ringkasan biaya ke alamat web untuk pelaporan.
  • βœ“Saat Anda ingin data biaya diperbarui secara rutin sesuai jadwal.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-export/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œEkspor data biaya AI saya supaya bisa saya lihat di dasbor.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill membaca catatan biaya yang tersimpan, lalu menuliskannya sebagai file teks untuk Prometheus, atau sebagai pesan JSON yang dikirim ke alamat web yang Anda berikan. Tanpa opsi, skill mencetak JSON di layar.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Apa itu file teks Prometheus?

File itu berisi baris metrik sederhana yang bisa dibaca collector node exporter dan ditampilkan di dasbor.

Bisakah saya menambahkan login ke webhook?

Bisa. Pengaturan lingkungan dapat mengirim header, seperti token otorisasi, bersama permintaan.

Apakah data dikirim ke tempat lain secara default?

Tidak. Skill mencetak JSON di layar kecuali Anda memilih opsi file atau webhook.

Detail

Deskripsi asli dari pembuat

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

repo: ruvnet/ruflo

Popularitas

Bintang GitHub
81k
Peringkat
#1600
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa