Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

feat: Implement Prometheus metrics #8

Description

@kitsunoff

⚠️ TDD MANDATORY

Tests MUST be written BEFORE implementation code. No exceptions.

Write tests that verify metrics are emitted correctly FIRST.


Description

Implement Prometheus metrics for observability.

Tasks

Test First

  • Test: Gauge metrics update correctly on state changes
  • Test: Counter metrics increment on events
  • Test: Histogram metrics record durations
  • Test: Metrics have correct labels

Gauge Metrics (current state)

  • nio_machines_total
  • nio_machines_discoverable
  • nio_machines_with_configuration
  • nio_configurations_total
  • nio_jobs_active

Counter Metrics (accumulated)

  • nio_configurations_applied_total
  • nio_configurations_failed_total
  • nio_ssh_connections_total
  • nio_git_clones_total
  • nio_nixos_builds_total
  • nio_retries_total
  • nio_errors_total
  • nio_jobs_failed_total
  • nio_secret_watch_triggers_total

Histogram Metrics (duration)

  • nio_reconcile_duration_seconds
  • nio_ssh_connection_duration_seconds
  • nio_git_clone_duration_seconds
  • nio_nixos_build_duration_seconds
  • nio_job_duration_seconds

State Distribution

  • nio_machines_by_state
  • nio_configs_by_state

Reference

See docs/kubebuilder-migration-analysis.md section 11.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions