{"id":2561,"date":"2012-04-05T20:24:51","date_gmt":"2012-04-06T04:24:51","guid":{"rendered":"http:\/\/blog.mozilla.org\/webdev\/?p=2561"},"modified":"2012-04-05T20:24:51","modified_gmt":"2012-04-06T04:24:51","slug":"tracking-deployments-in-graphite","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/","title":{"rendered":"Tracking deployments in Graphite"},"content":{"rendered":"<p>We use <a href=\"http:\/\/graphite.wikidot.com\/\">Graphite<\/a> in Web Development to track metrics on our sites. For the Marketplace and Addons team, it has been a real eye opener into the state of our sites.<\/p>\n<p>One thing that I&#8217;ve wanted to add is information on when deployments occur as these are often critical periods that can trigger changes in the graphs. Sure enough, this has all been done before and covered in a <a href=\"http:\/\/codeascraft.etsy.com\/2010\/12\/08\/track-every-release\/\">blog post<\/a>. Following on from that blog post, here&#8217;s how I added this for the Marketplace.<\/p>\n<p>First, I added a management command to <a href=\"https:\/\/github.com\/andymckay\/django-statsd\">django-statsd<\/a> that allows you to easily send a ping to Graphite for a specific key. The value of the key is set to be a UNIX time stamp. Once that was in place I altered our deployment scripts so that on each update they send a ping with the key &#8220;update&#8221;:<\/p>\n<pre>python2.6 manage.py statsd_ping --key=update<\/pre>\n<p>Then each time a server is deployed that key gets added to Graphite.<\/p>\n<p>Next, I altered our graphs so that they show this ping as a vertical line. That&#8217;s using the command <a href=\"http:\/\/graphite.readthedocs.org\/en\/1.0\/functions.html#graphite.render.functions.drawAsInfinite\">drawAsInfinite<\/a>, for example:<\/p>\n<pre>drawAsInfinite(stats.timers.addons-dev.update.count)<\/pre>\n<p>Our development server updates on every commit. In other words, it continually deploys all the time. This is the graph for the development server, and you can see the large number of small commits we had this afternoon (each commit is indicated by a pink line):<\/p>\n<p><a href=\"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2564\" title=\"Screen Shot 2012-04-05 at 5.40.54 PM\" src=\"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png\" alt=\"\" width=\"597\" height=\"145\" srcset=\"https:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png 597w, https:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM-300x72.png 300w\" sizes=\"(max-width: 597px) 100vw, 597px\" \/><\/a><\/p>\n<p>A more realistic view is our production server, where you can see our Thursday afternoon push in context (each push is a pink line):<\/p>\n<p><a href=\"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.41.14-PM.png\"><img decoding=\"async\" loading=\"lazy\" title=\"Screen Shot 2012-04-05 at 5.41.14 PM\" src=\"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.41.14-PM.png\" alt=\"\" width=\"591\" height=\"144\" \/><\/a><\/p>\n<p>Adding this data is crucial to helping the Marketplace get closer to continuous deployment in the coming months.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We use Graphite in Web Development to track metrics on our sites. For the Marketplace and Addons team, it has been a real eye opener into the state of our sites. One thing that I&#8217;ve wanted to add is information &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/\">Continue reading<\/a><\/p>\n","protected":false},"author":271,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[288],"tags":[553],"coauthors":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tracking deployments in Graphite - Mozilla Web Development<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andy McKay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/\",\"url\":\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/\",\"name\":\"Tracking deployments in Graphite - Mozilla Web Development\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png\",\"datePublished\":\"2012-04-06T04:24:51+00:00\",\"dateModified\":\"2012-04-06T04:24:51+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/7e1881db0e8a23a4a06695f8a0efd6b8\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#primaryimage\",\"url\":\"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png\",\"contentUrl\":\"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/webdev\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tracking deployments in Graphite\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/webdev\/\",\"name\":\"Mozilla Web Development\",\"description\":\"For make benefit of glorious tubes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/webdev\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/7e1881db0e8a23a4a06695f8a0efd6b8\",\"name\":\"Andy McKay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/image\/96eb032e0f9fa78d076a49a55bf3cd09\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ad304e7a7d4f6fba05a81b10810fe6fd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ad304e7a7d4f6fba05a81b10810fe6fd?s=96&d=mm&r=g\",\"caption\":\"Andy McKay\"},\"description\":\"Andy is an Engineering Manager at Mozilla. As a Canadian he tweets and blogs about curling, skiing, politics, maple syrup, bears and all things from the great white north.\",\"sameAs\":[\"http:\/\/mckay.pub\",\"https:\/\/x.com\/andymckay\"],\"url\":\"https:\/\/blog.mozilla.org\/webdev\/author\/amckaymozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tracking deployments in Graphite - Mozilla Web Development","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/","twitter_misc":{"Written by":"Andy McKay","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/","url":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/","name":"Tracking deployments in Graphite - Mozilla Web Development","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/webdev\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#primaryimage"},"image":{"@id":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png","datePublished":"2012-04-06T04:24:51+00:00","dateModified":"2012-04-06T04:24:51+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/7e1881db0e8a23a4a06695f8a0efd6b8"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#primaryimage","url":"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png","contentUrl":"http:\/\/blog.mozilla.org\/webdev\/files\/2012\/04\/Screen-Shot-2012-04-05-at-5.40.54-PM.png"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/webdev\/2012\/04\/05\/tracking-deployments-in-graphite\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/webdev\/"},{"@type":"ListItem","position":2,"name":"Tracking deployments in Graphite"}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/webdev\/#website","url":"https:\/\/blog.mozilla.org\/webdev\/","name":"Mozilla Web Development","description":"For make benefit of glorious tubes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/webdev\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/7e1881db0e8a23a4a06695f8a0efd6b8","name":"Andy McKay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/webdev\/#\/schema\/person\/image\/96eb032e0f9fa78d076a49a55bf3cd09","url":"https:\/\/secure.gravatar.com\/avatar\/ad304e7a7d4f6fba05a81b10810fe6fd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ad304e7a7d4f6fba05a81b10810fe6fd?s=96&d=mm&r=g","caption":"Andy McKay"},"description":"Andy is an Engineering Manager at Mozilla. As a Canadian he tweets and blogs about curling, skiing, politics, maple syrup, bears and all things from the great white north.","sameAs":["http:\/\/mckay.pub","https:\/\/x.com\/andymckay"],"url":"https:\/\/blog.mozilla.org\/webdev\/author\/amckaymozilla-com\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/posts\/2561"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/users\/271"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/comments?post=2561"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/posts\/2561\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/media?parent=2561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/categories?post=2561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/tags?post=2561"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webdev\/wp-json\/wp\/v2\/coauthors?post=2561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}