orbit_mon

command
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2025 License: MIT Imports: 9 Imported by: 0

README ΒΆ

Grafana Monitoring Example for Orbit

This example demonstrates how to integrate the Orbit scheduler with Prometheus and Grafana for real-time job monitoring and alerting.

πŸ“¦ Features

  • Tracks job success/failure counts
  • Measures execution duration in seconds
  • Exposes job status as numeric gauge
  • Fully compatible with Prometheus + Grafana stack

πŸ“ Files

  • main.go – Runs an Orbit job that emits Prometheus metrics

πŸ”§ Setup Instructions

1. Run the example
go run main.go

It will:

2. Prometheus Configuration

Create a file named prometheus.yml:

global:
  scrape_interval: 5s

scrape_configs:
  - job_name: 'orbit_example'
    static_configs:
      - targets: ['localhost:2112']

Then run Prometheus:

prometheus --config.file=prometheus.yml
3. Grafana Dashboard (Suggested Panels)

Import a new dashboard and add these panels:

βœ… Job Success Count
sum(increase(job_success_total[5m])) by (job_id)
❌ Job Failure Count
sum(increase(job_failure_total[5m])) by (job_id)
⏱️ Execution Duration (Histogram)
histogram_quantile(0.95, sum(rate(job_duration_seconds_bucket[5m])) by (le, job_id))
πŸ“Š Job Status
job_status{job_id="grafana_demo_job"}

Display as: Stat panel with value mappings:

0 = Waiting
1 = Running
2 = Completed
3 = Error
4 = Paused
5 = Stopped

πŸ“ˆ Example Output

After running a few minutes, your dashboard will show:

  • Success/failure spikes
  • Duration distribution
  • Live job state indicator

πŸ’‘ Tips

  • You can add alert rules in Prometheus for job error spikes
  • You can expose additional metrics by extending PrometheusMonitoring
  • All metric labels are per job_id to support multi-job environments

Made with ❀️ and Orbit

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL