{"id":203,"date":"2018-04-20T14:35:38","date_gmt":"2018-04-20T22:35:38","guid":{"rendered":"http:\/\/www.gauntletwizard.net\/wordpress\/?p=203"},"modified":"2018-04-20T14:35:38","modified_gmt":"2018-04-20T22:35:38","slug":"prometheus-alerting-and-questions","status":"publish","type":"post","link":"https:\/\/www.gauntletwizard.net\/wordpress\/?p=203","title":{"rendered":"Prometheus alerting and questions"},"content":{"rendered":"<p>I&#8217;ve been switching my company over to Prometheus, and I&#8217;ve come across a few things that need discussion and opinions.<\/p>\n<p>First, concrete advice:<br \/>\nDon&#8217;t just write an alert like<br \/>\n&#8220;`<br \/>\nalert: foo<br \/>\nexpr: sum(rate(bar[5m])) > 5<br \/>\n&#8220;`<br \/>\nWrite it so you record the rate, and then alert on that metric:<br \/>\n&#8220;`<br \/>\nrecord: bar:rate<br \/>\nexpr: sum(rate(bar[5m]))<br \/>\nalert: foo<br \/>\nexpr: bar:rate > 5<br \/>\n&#8220;`<\/p>\n<p>From my Google days, I can say I should probably specify what the time is on that rate.<\/p>\n<p>Questions:<br \/>\n1) How long should the rate window be? [5m]? [2m]? 3? 10?<br \/>\n* I&#8217;ve adopted 5m as standard across my company, being a compromise between being fast-moving and not overly smoothed<br \/>\n2) How long should alert `for`s be?<br \/>\n3) Metric naming<br \/>\n* I&#8217;m using `A_Metric_Name`; Not sure if this is right<br \/>\n4) Recorded rule naming<br \/>\n* I like `product:metric[:submetric]:unit` ; eg. houseparty:websockets_open:byDeviceType:sum<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been switching my company over to Prometheus, and I&#8217;ve come across a few things that need discussion and opinions. First, concrete advice: Don&#8217;t just write an alert like &#8220;` alert: foo expr: sum(rate(bar[5m])) > 5 &#8220;` Write it so you record the rate, and then alert on that metric: &#8220;` record: bar:rate expr: sum(rate(bar[5m])) &hellip; <a href=\"https:\/\/www.gauntletwizard.net\/wordpress\/?p=203\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Prometheus alerting and questions<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/203"}],"collection":[{"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=203"}],"version-history":[{"count":1,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/203\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/203\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}