cost-export
Skill này làm gì
Skill này lấy dữ liệu chi phí AI bạn đã ghi lại và lưu thành dạng mà các công cụ giám sát khác có thể hiển thị. Nó dành cho người muốn xem chi tiêu AI trên một dashboard chung.
Khi nào nên dùng
- ✓Khi bạn muốn chi tiêu AI hiển thị trên Grafana hoặc dashboard tương tự.
- ✓Khi bạn muốn gửi một bản chụp chi phí tới một địa chỉ web để báo cáo.
- ✓Khi bạn muốn dữ liệu chi phí được làm mới định kỳ theo lịch.
Liên kết skill
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-export/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy xuất dữ liệu chi phí AI của tôi để tôi xem trên dashboard.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill đọc các bản ghi chi phí đã lưu, rồi ghi chúng thành một file văn bản cho Prometheus hoặc một thông điệp JSON gửi tới địa chỉ web bạn cung cấp. Nếu không có tùy chọn nào, nó in JSON ra màn hình.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 5mto keep external dashboards near-real-time. - One-shot to a webhook for ad-hoc reporting (Slack, custom endpoint).
Steps
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.mjsInspect 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)Webhook payload shape — the JSON the webhook receives matches the stdout JSON:
{ exportedAt, sessions: [...], budget, totalUsd, byTier }. Headers may be added viaEXPORT_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 exportscost-budget-check— the samecost_tracker_budget_*metrics are alertable in Prometheus- node_exporter textfile collector docs (Prometheus convention) — drop the
.promfile in the collector directory and Prometheus picks it up
Câu hỏi thường gặp
File văn bản Prometheus là gì?
Đó là một file thuần văn bản chứa các dòng số liệu mà bộ thu thập node exporter có thể đọc và hiển thị trên dashboard.
Tôi có thể thêm đăng nhập cho webhook không?
Có. Một cài đặt môi trường có thể gửi kèm header, chẳng hạn token xác thực, cùng yêu cầu.
Mặc định skill có gửi dữ liệu đi đâu không?
Không. Nó chỉ in JSON ra màn hình trừ khi bạn chọn tùy chọn file hoặc webhook.
Chi tiết
Mô tả gốc của tác giả
Export cost-tracking telemetry in Prometheus textfile or webhook JSON formats — for external observability (Grafana, Datadog, custom dashboards)
repo: ruvnet/ruflo
Độ phổ biến
- Sao GitHub
- 81k
- Vị trí xếp hạng
- #1600
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-adaptive-coordinator
81kGiúp agent của bạn chia và cân bằng lại một nhóm agent AI khi khối lượng công việc thay đổi, chọn bố cục phù hợp với tác vụ.
agent-agent
81kDạy agent của bạn biến một mục tiêu lớn thành kế hoạch hành động có thứ tự, và lập lại kế hoạch khi điều kiện thay đổi.
agent-agentic-payments
81kGiúp agent của bạn quản lý ủy quyền chi tiêu cho mua sắm bằng AI, với hạn mức chi, khung thời gian, quy tắc người bán và phê duyệt có chữ ký.
agent-analyze-code-quality
81kGiúp agent của bạn rà soát chất lượng mã, tìm code smell, nợ kỹ thuật và gợi ý tái cấu trúc mà không thay đổi các file.
Skill tương tự
blucli
394kGiúp agent của bạn tìm, phát, tạm dừng, nhóm và chỉnh âm lượng loa Bluesound và NAD qua lệnh blu.
camsnap
394kGiúp agent của bạn chụp ảnh, quay clip ngắn hoặc lấy sự kiện chuyển động từ camera mạng và webcam nội bộ mà bạn đã thiết lập.
eightctl
394kGiúp agent của bạn kiểm tra và điều khiển thiết bị Eight Sleep pod, gồm nhiệt độ, báo thức và lịch ngủ.