Skip to content

feat: Micrometer integration for Prometheus/Grafana metrics #14

@rlaope

Description

@rlaope

Problem

Argus metrics are only available through its own dashboard and API:

  • Cannot integrate with existing monitoring infrastructure
  • No support for standard metrics formats (Prometheus, OpenMetrics)
  • Cannot create custom Grafana dashboards
  • No long-term metrics storage

Proposed Solution

Integrate Micrometer for standard metrics exposure:

  1. Expose metrics in Prometheus format
  2. Provide pre-built Grafana dashboard
  3. Support custom metric tags
  4. Compatible with existing monitoring stacks

Acceptance Criteria

  • Add Micrometer dependency
  • Expose /prometheus endpoint with metrics
  • Include all current metrics (events, threads, pinning)
  • Add JVM metrics (memory, GC, threads)
  • Support custom tags via configuration
  • Provide Grafana dashboard JSON
  • Document Prometheus scrape configuration

Metrics to Expose

# HELP argus_virtual_thread_events_total Total virtual thread events
# TYPE argus_virtual_thread_events_total counter
argus_virtual_thread_events_total{type="START"} 15234
argus_virtual_thread_events_total{type="END"} 15100
argus_virtual_thread_events_total{type="PINNED"} 45
argus_virtual_thread_events_total{type="SUBMIT_FAILED"} 0

# HELP argus_virtual_threads_active Current active virtual threads
# TYPE argus_virtual_threads_active gauge
argus_virtual_threads_active 134

# HELP argus_pinned_events_rate Pinning events per second
# TYPE argus_pinned_events_rate gauge
argus_pinned_events_rate 0.5

# HELP argus_carrier_threads_active Active carrier threads
# TYPE argus_carrier_threads_active gauge
argus_carrier_threads_active 8

# HELP argus_websocket_clients Connected WebSocket clients
# TYPE argus_websocket_clients gauge
argus_websocket_clients 2

Prometheus Configuration

# prometheus.yml
scrape_configs:
  - job_name: 'argus'
    static_configs:
      - targets: ['localhost:8080']
    metrics_path: '/prometheus'
    scrape_interval: 5s

Grafana Dashboard

Provide JSON dashboard with:

  • Events rate panel (START, END, PINNED over time)
  • Active threads gauge
  • Pinning alerts panel
  • Carrier utilization heatmap
  • Top pinning hotspots table

Configuration

argus.metrics.enabled=true
argus.metrics.prometheus.enabled=true
argus.metrics.tags.application=my-app
argus.metrics.tags.environment=production

Technical Considerations

  • Use micrometer-registry-prometheus
  • Consider push gateway support for short-lived apps
  • Add histogram for thread duration distribution
  • Support dimensional metrics with thread name prefix patterns

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions