O'Reilly logo

The DevOps 2.2 Toolkit by Viktor Farcic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Firing alerts based on instrumented metrics

Now that we have a solid understanding of some of the expressions based on instrumented metrics, we can proceed and apply that knowledge to create a few alerts.

Let us deploy updated version of the go-demo stack.

docker stack deploy \  
    -c stacks/go-demo-instrument-alert.yml \   
    go-demo 

We'll take a couple of moments to discuss the changes to the updated stack while waiting for the services to become operational. The stack definition, limited to relevant parts, is as follows:

... 
  main: 
    ... 
    deploy: 
      ... 
      labels: 
        ... 
        - com.df.alertName.1=mem_limit 
        - com.df.alertIf.1=@service_mem_limit:0.8 
        - com.df.alertFor.1=5m 
        - com.df.alertName.2=resp_time 
        - com.df.alertIf.2=sum(rate(http_server_resp_time_bucket{\ job="go-demo_main", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required