Skip to content

Add Prometheus metrics and health endpoints #55

@dorser

Description

@dorser

Summary

Micromize has no observability features — no metrics endpoint, no health checks, no readiness/liveness probes.

What's Needed

1. Prometheus Metrics

Expose metrics at /metrics:

  • micromize_events_total{gadget, action} — Counter of events by gadget and action (blocked/audited)
  • micromize_gadgets_running — Gauge of currently running gadgets
  • micromize_gadget_errors_total{gadget} — Counter of gadget errors
  • micromize_uptime_seconds — Uptime gauge

2. Health Endpoint

Expose /healthz and /readyz endpoints:

  • Healthy when all gadgets are loaded and running
  • Unhealthy if a gadget fails

3. Kubernetes Probes

Add to the DaemonSet template:

livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
readinessProbe:
  httpGet:
    path: /readyz
    port: 8080

Considerations

  • The tool runs as a DaemonSet — metrics should be scrapable per-node
  • Consider whether to use the Prometheus Go client library or a lightweight alternative
  • Port should be configurable

Files

  • internal/runtime/manager.go
  • internal/gadget/registry.go
  • charts/micromize/templates/daemonset.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestresearchResearch and design decisions needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions