Git Product home page Git Product logo

slack-prometheous-integration's Introduction

Prometheus setup

pre-requisites

  1. Kubernetes cluster
  2. helm

Setup Prometheus

  1. Create a dedicated namespace for prometheus

    kubectl create namespace monitoring
  2. Add Prometheus helm chart repository

    helm repo add prometheus-community https://prometheus-community.github.io/helm-charts 
  3. Update the helm chart repository

    helm repo update
    helm repo list
  4. Install the prometheus

     helm install prometheus prometheus-community/kube-prometheus-stack --namespace monitoring
  5. Above helm create all services as ClusterIP. To access Prometheus out side of the cluster, we should change the service type load balancer

    kubectl edit svc prometheus-kube-prometheus-prometheus -n monitoring
    
  6. Loginto Prometheus dashboard to monitor application https://:9090

  7. Check for node_load15 executor to check cluster monitoring

  8. We check similar graphs in the Grafana dashboard itself. for that, we should change the service type of Grafana to LoadBalancer

    kubectl edit svc prometheus-grafana
  9. To login to Grafana account, use the below username and password

    username: admin
    password: prom-operator
  10. Here we should check for "Node Exporter/USE method/Node" and "Node Exporter/USE method/Cluter" USE - Utilization, Saturation, Errors

  11. Even we can check the behavior of each pod, node, and cluster

Integrate Prometheus with Slack

  1. Create an slack account

  2. Create a slack channel called "demo-alerts"

  3. Install app called "incomming webooks". once installed it give a URL. Use the URL

  4. Copy below test along with URL

    curl -X POST --data-urlencode "payload={\"channel\": \"#demo-alerts\", \"username\": \"webhookbot\", \"text\": \"This is posted to #demo-alerts and comes from a bot named webhookbot.\", \"icon_emoji\": \":ghost:\"}" <Webhook_URL> 
    
    Example:    curl -X POST --data-urlencode "payload={\"channel\": \"#demo-alerts\", \"username\": \"webhookbot\", \"text\": \"This is posted to #demo-alerts and comes from a bot named webhookbot.\", \"icon_emoji\": \":ghost:\"}" https://hooks.slack.com/services/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
    
  5. Now find out secret called "alertmanager-monitoring-kube-prometheus-alertmanager" and delete it

    kubectl get secret -n monitoring
    kubectl delete secret -n monitoring  alertmanager-my-kube-prometheus-stack-alertmanager
  6. Now create a configuration file with name 'alertmanager.yaml' and copy content from here

    Note: make usre you have updated slack_web_url with the whebook url of slack

  7. Create a secret with an updated alertmanager.yaml file

    kubectl create secret generic --from-file=alertmanager.yaml alertmanager-my-kube-prometheus-stack-alertmanager -n monitoring
  8. Look for the password of grafana

    get secret --namespace default
    kubectl get secret --namespace default prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo 

slack-prometheous-integration's People

Contributors

shrinivaskatti5 avatar

Watchers

 avatar

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.