SteveKMin / pagerduty-exporter

Prometheus exporter for PagerDuty informations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PagerDuty Exporter

license Docker Docker Build Status

Prometheus exporter for PagerDuty informations (users, teams, schedules, oncalls, incidents...)

Configuration

Normally no configuration is needed but can be customized using environment variables.

Environment variable DefaultValue Description
SCRAPE_TIME 5m Time (time.Duration) for general informations
SCRAPE_TIME_LIVE 1m Time (time.Duration) for live metrics (incidents, oncall)
SERVER_BIND :8080 IP/Port binding
PAGERDUTY_AUTH_TOKEN none PagerDuty auth token
PAGERDUTY_SCHEDULE_OVERRIDE_TIMEFRAME 48h PagerDuty schedule override list timeframe
PAGERDUTY_SCHEDULE_ENTRY_TIMEFRAME 72h PagerDuty schedule rendered list timeframe
PAGERDUTY_SCHEDULE_ENTRY_TIMEFORMAT Mon, 02 Jan 15:04 MST PagerDuty schedule entry timeformat (label)
PAGERDUTY_INCIDENT_TIMEFORMAT Mon, 02 Jan 15:04 MST PagerDuty incident entry timeformat (label)
PAGERDUTY_DISABLE_TEAMS false Boolean (set to 'true' to skip collecting "team" data)

Metrics

Metric Scraper Description
pagerduty_stats Collector Collector stats
pagerduty_api_counter Collector PagerDuty api call counter
pagerduty_team_info Team Team informations
pagerduty_user_info User User informations
pagerduty_service_info Service Service (per team) informations
pagerduty_maintenancewindow_info MaintanaceWindows Maintenance window informations
pagerduty_maintenancewindow_status Maintenance window status (start and endtime)
pagerduty_schedule_info Schedule Schedule informations
pagerduty_schedule_layer_info Schedule Schedule layer informations
pagerduty_schedule_layer_entry Schedule Schedule layer schedule entries
pagerduty_schedule_layer_coverage Schedule Schedule layer schedule coverage
pagerduty_schedule_final_entry Schedule Schedule final (rendered) schedule entries
pagerduty_schedule_final_coverage Schedule Schedule final (rendered) schedule coverage
pagerduty_schedule_override Schedule Schedule override informations
pagerduty_schedule_oncall Oncall Schedule oncall informations
pagerduty_incident_info Incident Incident informations
pagerduty_incident_status Incident Incident status informations (acknowledgement, assignment)

Prometheus queries

Current oncall person

pagerduty_schedule_oncall{scheduleID="$SCHEDULEID",type="startTime"}
* on (userID) group_left(userName) (pagerduty_user_info)

Next shift

bottomk(1,
  min by (userName, time) (
    pagerduty_schedule_final_entry{scheduleID="$SCHEDULEID",type="startTime"}
    * on (userID) group_left(userName) (pagerduty_user_info) 
  ) - time() > 0
)

About

Prometheus exporter for PagerDuty informations

License:MIT License


Languages

Language:Go 98.2%Language:Dockerfile 1.8%