본문으로 건너뛰기
Skillpedia
기타81k · #1600

cost-export

하는 일

이 스킬은 기록된 AI 비용 데이터를 다른 모니터링 도구에서 볼 수 있는 형태로 저장합니다. AI 지출을 공용 대시보드에 올리고 싶은 사람을 위한 스킬입니다.

사용하는 경우

  • ✓Grafana 등 대시보드에 AI 지출을 표시하고 싶을 때.
  • ✓비용 스냅숏을 보고용으로 웹 주소에 보내고 싶을 때.
  • ✓비용 데이터를 일정에 따라 정기적으로 새로 고치고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-export/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“AI 비용 데이터를 내보내서 대시보드에서 볼 수 있게 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 저장된 비용 기록을 읽고, Prometheus용 텍스트 파일로 쓰거나 입력한 웹 주소로 JSON 메시지를 보냅니다. 옵션을 주지 않으면 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 텍스트 파일이란 무엇인가요?

노드 익스포터 수집기가 읽고 대시보드에 보여 줄 수 있는 메트릭 줄이 담긴 일반 파일입니다.

웹훅에 로그인 정보를 추가할 수 있나요?

네. 환경 설정으로 인증 토큰 같은 헤더를 요청과 함께 보낼 수 있습니다.

기본 설정으로 데이터가 외부로 전송되나요?

아닙니다. 파일 또는 웹훅 옵션을 고르지 않으면 JSON을 화면에 출력할 뿐입니다.

상세 정보

작성자의 원본 설명

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
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬