Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
ruvnet avatar

Cost Export

  • 587 installs
  • 67k repo stars
  • Updated August 4, 2026
  • ruvnet/ruflo

cost-export is an agent skill that exports ruflo cost-tracking session and budget records to Prometheus textfile or webhook JSON for Grafana, Datadog, and custom observability dashboards.

About

cost-export is a ruflo agent skill that pulls every session-* and budget-config-* record from the cost-tracking AgentDB namespace and emits Prometheus textfile or webhook JSON for external observability. Without export, cost data stays inside AgentDB; with it, the same telemetry feeds Grafana, Datadog, or custom dashboards. Run it after cost-track sessions or on a cron via /loop 5m to keep external metrics near real-time. Arguments accept --prometheus <path> for textfile collector output and --webhook <url> for JSON push. The skill uses Bash and fits teams operating AI agent fleets who need budget visibility outside the ruflo runtime.

  • cost-export

Cost Export by the numbers

  • 587 all-time installs (skills.sh)
  • +10 installs in the week ending Jul 26, 2026 (Skillselion tracking)
  • Ranked #680 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ruvnet/ruflo --skill cost-export

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs587
repo stars67k
Last updatedAugust 4, 2026
Repositoryruvnet/ruflo

How do you export agent cost metrics to Prometheus?

Use cost-export for development tasks

Who is it for?

Teams running ruflo agent cost-tracking who need session and budget metrics in Grafana, Datadog, or Prometheus outside AgentDB.

Skip if: Projects without ruflo cost-tracking data or teams needing cloud billing exports from AWS Cost Explorer instead of agent session telemetry.

When should I use this skill?

Agent cost data must appear in Grafana or Datadog, or after a cost-track run when external dashboards need refreshing.

What you get

Prometheus textfile metrics, webhook JSON payloads, and refreshed external dashboard series for agent session costs

  • Prometheus textfile metrics
  • Webhook JSON payload
  • Dashboard-ready cost series

By the numbers

  • Exports session-* and budget-config-* record types from cost-tracking AgentDB
  • Supports Prometheus textfile and webhook JSON output formats

Files

SKILL.mdMarkdownGitHub ↗

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

EnvDefaultPurpose
EXPORT_NAMESPACEcost-trackingOverride target namespace
EXPORT_WEBHOOK_HEADERunsetComma-separated K: V pairs for webhook auth
EXPORT_QUIET=1unsetSuppress 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

Related skills

How it compares

Use cost-export when ruflo AgentDB already tracks sessions; use cloud FinOps tools when the source of truth is AWS or GCP billing APIs instead.

FAQ

What data does cost-export pull?

cost-export reads every session-* and budget-config-* record from the ruflo cost-tracking AgentDB namespace. It formats that telemetry as Prometheus textfile output or webhook JSON for external systems.

How do you run cost-export on a schedule?

cost-export supports cron-style refresh via /loop 5m after cost-track runs. Pass --prometheus <path> for textfile collector files or --webhook <url> to push JSON metrics to Grafana, Datadog, or custom endpoints.

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.