Skip to content

feat: custom metric definition CRUD + backup support - #249

Merged
jeff-schnitter merged 10 commits into
mainfrom
worktree-custom-metric-definitions
Oct 26, 2026
Merged

jeff-schnitter merged 10 commits into
mainfrom
worktree-custom-metric-definitions

Conversation

@jeff-schnitter

Copy link
Copy Markdown
Collaborator

Summary

  • Add definition-create, definition-list, definition-get, definition-update, definition-delete commands to cortex custom-metrics for full API parity with the custom metric definition endpoints
  • Add custom-metric-definitions to backup export/import — definitions are exported as individual JSON files and imported before data points (so import is self-contained)
  • Update ai-spend solution to install its metric definition automatically during cortex solutions install via a new custom-metric-definitions/ai-spend.json file; remove the now-unnecessary post-install setup script

Test plan

  • cortex custom-metrics definition-create -k my-key -n "My Metric" -V POSITIVE creates a definition
  • cortex custom-metrics definition-create -f my-def.json creates from file
  • cortex custom-metrics definition-list returns paginated list
  • cortex custom-metrics definition-get -k my-key returns definition
  • cortex custom-metrics definition-update -k my-key -n "Updated" updates name only
  • cortex custom-metrics definition-delete -k my-key deletes definition
  • cortex backup export includes custom-metric-definitions/ directory
  • cortex backup import creates definitions before data points (409 on re-import = silent success)
  • cortex solutions install -s ai-spend self-contained — no post-install step needed

🤖 Generated with Claude Code

@jeff-schnitter
jeff-schnitter merged commit 39f2994 into main Oct 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant