Skip to content

feat: Add dedicated Microcks health check command #645

Backlog

Description

@aniket866

Reason/Context

Description

Add a new microcks health command that provides quick diagnostics for the configured Microcks server.

The command should verify server reachability, measure request latency, check API responsiveness, report the health of key subsystems, and identify the running Microcks version.

Proposed behavior

microcks health
microcks health --json
microcks health --watch --interval 5s

Human-readable output should include:

  • Server URL and reachability
  • Request latency
  • API responsiveness
  • Database health
  • Keycloak health
  • Async Minion health
  • Detected Microcks version
  • Overall status: healthy, degraded, or unreachable

The --json option should return stable, machine-readable output suitable for CI/CD pipelines and monitoring integrations.

The --watch option should continuously refresh the health status at the configured --interval.

Exit codes

  • 0: The server is healthy.
  • 1: The server is unreachable, or a network/API failure occurred.
  • 2: The server is reachable, but one or more subsystems are degraded.

Implementation notes

  • Add the health-related API methods to the MicrocksClient interface in pkg/connectors/microcks_client.go.
  • Reuse the existing connection and API error classifications.
  • Keep command handling thin and place health-check logic in the connector or a dedicated package.
  • Ensure watch mode respects context cancellation.
  • Confirm the supported Microcks endpoints and response formats for subsystem health and version detection.

Acceptance criteria

  • microcks health works with the currently configured server context.
  • Human-readable and JSON output are supported.
  • Watch mode and configurable intervals work correctly.
  • Exit codes match the documented health state.
  • Tests cover parsing, output formats, watch mode, latency, unreachable servers, degraded services, and healthy responses.
  • Command documentation is added.
  • go fmt ./... and go test ./... pass.

Description

.

Implementation ideas

No response

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions