Add metrics for recipe metadata in scheduler, UI, and CLI (#4399)

This commit is contained in:
Max Novich
2025-08-28 16:18:47 -07:00
committed by GitHub
parent bfea4062d8
commit b78337dc30
4 changed files with 92 additions and 2 deletions
+18 -1
View File
@@ -941,8 +941,25 @@ pub async fn cli() -> Result<()> {
.and_then(|name| name.to_str())
.unwrap_or(&recipe_name);
tracing::info!(counter.goose.recipe_runs = 1,
let recipe_version =
crate::recipes::search_recipe::retrieve_recipe_file(&recipe_name)
.ok()
.and_then(|rf| {
goose::recipe::template_recipe::parse_recipe_content(
&rf.content,
rf.parent_dir.to_string_lossy().to_string(),
)
.ok()
.map(|(r, _)| r.version)
})
.unwrap_or_else(|| "unknown".to_string());
tracing::info!(
counter.goose.recipe_runs = 1,
recipe_name = %recipe_display_name,
recipe_version = %recipe_version,
session_type = "recipe",
interface = "cli",
"Recipe execution started"
);