Giter Club home page Giter Club logo

managed-prometheus-exporter-stuck-ebs-vols's Introduction

Stuck EBS Volume Exporter

This monitor is designed to expose a HTTP Service endpoint that Prometheus will use to gather information about the state of the cluster's attached EBS volumes.

Prometheus Output

A volume may be in one of these states attaching, attached, detaching, detached and is thus reported, for example, in one time slice:

    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="attaching"} 1.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="attached"} 0.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="detaching"} 0.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="detached"} 0.0

The next time slice may be

    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="attaching"} 0.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="attached"} 1.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="detaching"} 0.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="detached"} 0.0

And the next might be

    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="attaching"} 0.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="attached"} 0.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="detaching"} 0.0
    ebs_volume_state{vol_id="vol-d34db33f",clusterid="testcluster",vol_state="detached"} 1.0

Here, we can see the transition from attaching to attached to detached. Note that the the state record may have missed the detaching state transition on the way to detached due to the polling interval.

(Note: These are sample outputs)

PromQL - What's Stuck

When the attaching or detaching state is high (1.0) for whichever interval we care about we can consider the volume vol_id to be "stuck."

The query min_over_time(ebs_volume_state{ebs_volume_state="attaching"}[5m]) == 1 can be used to identify volumes which have only been in the attaching state for the past five minutes. The [5m] time interval can be changed for other timeframes, perhaps causing a warning at 5 minutes and a critical alert at 10 minutes.

Required IAM Roles

This service requires these read-only IAM roles:

  • ec2:DescribeInstances

Installation Process

Installation of the exporter is a multi-step process. Step one is to use the provided Makefile to render various templates into OpenShift YAML manifests.

Rendering Templates with Make

A total of four variables must be provided with make:

  • AWS_REGION - The region to make AWS API calls against
  • AWS_ACCESS_KEY_ID - The AWS access key ID
  • AWS_SECRET_ACCESS_KEY - The AWS secret access key
  • CLUSTERID - The identifier of the cluster. Only EBS volumes with tag kubernetes.io/cluster/$CLUSTERID will be checked

Optionally, a different image version can be provided with the IMAGE_VERSION variable. The defalt is stable.

Currently these are provided as environment variables to make.

make all will render these manifests:

  • deploy/025_sourcecode.yaml
  • deploy/030_secrets.yaml
  • deploy/040_deployment.yaml

Once these have been created the collection of manifests can be applied in the usual fashion (such as oc apply -f).

Additional Make Targets

The Makefile includes three helpful targets:

  • clean - Delete any of the rendered manifest files which the Makefile renders
  • filelist - Echos to the terminal a list of all the YAML files in the deploy directory
  • resourcelist - Echos to the terminal a list of OpenShift/Kubernetes objects created by the manifests in the deploy directory, which may be useful for those wishing to delete the installation of this monitor.

Prometheus Rules

Rules are provided by the openshift/managed-cluster-config repository.

managed-prometheus-exporter-stuck-ebs-vols's People

Contributors

cblecker avatar csheremeta avatar fahlmant avatar jewzaam avatar lisa avatar mrbarge avatar nautilux avatar openshift-ci[bot] avatar openshift-merge-robot avatar rafael-azevedo avatar staebler avatar thrasher-redhat avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

managed-prometheus-exporter-stuck-ebs-vols's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.