fix usd metric
ci/woodpecker/push/tests Pipeline was successful

This commit is contained in:
qpismont committed 2026-07-26 11:41:58 +00:00
1 parent 6ffd88927c
commit e1cb5d7d96
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -35,8 +35,8 @@ pub fn task_failed(event_type: &str) {
.increment(1);
}
pub fn openrouter_cost_usd(cost: u64) {
counter!("herald_openrouter_cost_usd_total").increment(cost);
pub fn openrouter_cost_usd(cost: f64) {
counter!("herald_openrouter_cost_cents_total").increment((cost * 100.0).round() as u64);
}
pub fn describe() {
@@ -46,7 +46,7 @@ pub fn describe() {
describe_gauge!("herald_bot_tasks_active", Unit::Count, "Bot tasks currently in progress");
describe_counter!("herald_bot_tasks_completed_total", Unit::Count, "Bot tasks completed successfully");
describe_counter!("herald_bot_tasks_failed_total", Unit::Count, "Bot tasks that failed");
describe_counter!("herald_openrouter_cost_usd_total", Unit::Count, "Total OpenRouter cost in USD");
describe_counter!("herald_openrouter_cost_cents_total", Unit::Count, "Total OpenRouter cost in cents (divide by 100 for USD)");
}
pub fn install(bind_addr: &str) -> anyhow::Result<()> {