Skip to content
Snippets Groups Projects

Update Context Switch Check to use Prometheus as Datasource

Merged Mike Hanby requested to merge update-context-switch-check-now-poll-prometheus into main

The previous method of using data returned by node_exporter was invalid, as it returns a total since boot.

The new method queries Prometheus to get a rate change of the same metric:

HW_CONTEXT_SWITCH_RATE=$(curl -fs --data-urlencode "query=irate(node_context_switches_total{job=\"compute-node\",name=\"$NODENAME\"}[$HW_CONTEXT_SWITCH_INTERVAL])" http://nagios.rc.uab.edu:9090/api/v1/query | jq -r '.data.result[] | .value[1]')

Merge request reports

Approval is optional

Merged by Mike HanbyMike Hanby 1 year ago (Aug 14, 2023 8:09pm UTC)

Merge details

  • Changes merged into main with b101b11b.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading