Automating Developer Relations Metrics with Low Code RunBooks
Tags: blog, intelligentautomatio, leadership, otherposts
Published: 2023-04-27 10:10:25

---
title: Automating Developer Relations Metrics with Low Code RunBooks
published: true
date: 2023-04-24 22:05:02 UTC
tags: Blog,IntelligentAutomatio,Leadership,OtherPosts
canonical_url: https://unskript.com/automating-developer-relations-metrics-with-low-code-runbooks/
---

My job at unSkript is to spread awareness and excitement around the DevOps tooling we have built.  But, I am also expected to provide reporting on various metrics around developer awareness and usage of our product. In this post, I walk through how I have automated the data collection process, so that I can spend more time creating content and building awareness.</span></p>
<p><span style="font-weight: 400;">A bit of background: at unSkript, we are building automation tools to reduce toil. In the DevOps/SRE space, toil is defined as the manual and repetitive work that needs to be done to keep everything shipshape.  If you ask me – collecting metrics from a bunch of different services (Github, Google Analytics, internal databases, Docker,….), and aggregating them in one place – that sounds like toil.  So let’s automate that away, and then I no longer have to think about it (until I decide to write a blog post about it, of course.)</span></p>
<p> </p>
<h2><span style="font-weight: 400;">Collecting the Data</span></h2>
<p>unSkript is a tool to help you build RunBooks. A RunBook is a collection of steps (we call them Actions) that complete a task.  For DevOps teams, that could be <a href="https://unskript.com/security-checkup-force-aws-load-balancers-to-redirect-to-https/">auto-remediation of your load balancers</a>, <a href="https://unskript.com/runbook-analysis-of-k8s-logs/">running health checks on a K8s cluster</a>, or even monitoring your <a href="https://unskript.com/keeping-your-cloud-costs-in-check-automated-aws-cost-charts-and-alerting/">daily Cloud costs</a>.</p>
<p>I want to use these actions to collect a bunch of different data points, and store them all in one place. There are a few different ways that I use unSkript to collect the information:</p>
<h2><span style="font-weight: 400;">Built in Actions</span></h2>
<p><span style="font-weight: 400;">unSkript comes with hundreds of built-in Actions – simply drag &amp; drop into your RunBook, configure your credentials, and you are ready to go!  When using built-in Actions – unSkript can be thought of as essentially “no-code” to set up. There are several built-in Actions in unSkript that are well suited to collecting the data that I want to collect: Daily Unique users from Google Analytics, and the Github star count.  </span></p>
<p> </p>
<p><span style="font-weight: 400;"><img decoding="async" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.31.00.jpg?resize=300%2C85&amp;ssl=1" alt="GA Action" width="300" height="85" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.31.00.jpg?resize=300%2C85&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.31.00.jpg?resize=558%2C158&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.31.00.jpg?resize=655%2C186&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.31.00.jpg?resize=24%2C7&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.31.00.jpg?w=734&amp;ssl=1 734w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1"></span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-14.44.41.jpg?resize=300%2C80&amp;ssl=1" alt="GitHub Star Action" width="300" height="80" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-14.44.41.jpg?resize=300%2C80&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-14.44.41.jpg?resize=558%2C149&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-14.44.41.jpg?resize=24%2C6&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-14.44.41.jpg?w=644&amp;ssl=1 644w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1">NOTE: Github stars as a DevRel metric can be controversial (IMO- it is useful as an indicator metric) but feel free to leave a comment below with your thoughts.)</span></p>
<h2><span style="font-weight: 400;">Database Queries </span></h2>
<p><span style="font-weight: 400;">Many of our stats are collected from Segment, and stored in a database (and that database is awesome for in depth detailed analysis).  But I want to keep all of my high level statistics and data in one table, so, I’ll use the PostgreSQL connector to extract the datapoints I’d like into my dataset:</span></p>
<p> </p>
<p><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.53.29.jpg?resize=300%2C232&amp;ssl=1" alt="3 SQL Actions to add data" width="300" height="232" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.53.29.jpg?resize=300%2C232&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.53.29.jpg?resize=558%2C432&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.53.29.jpg?resize=655%2C507&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.53.29.jpg?resize=24%2C19&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.53.29.jpg?w=664&amp;ssl=1 664w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1"></p>
<p>These Actions are “low-code” in that once you drag &amp; drop the action and make the connections, you still need to create a SQL query to grab the results.</p>
<h2><span style="font-weight: 400;">REST API</span></h2>
<p><span style="font-weight: 400;">There are still a few more data points that I’d like to pull out of other tools.  We have a REST API connector that makes this easy: set up your credentials and the headers you need – and you can create a new Action that extracts your data via API.  These are also “low-code” but do require some understanding of how to make API calls – in order to set up the credentials properly.</span></p>
<p> </p>
<p><span style="font-weight: 400;">For example: Docker Hub publishes the number of times our Docker Image has been downloaded. We can collect this number Each day using the REST API Action – and adding the endpoint and headers to the Action:</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?resize=300%2C297&amp;ssl=1" alt="" width="300" height="297" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?resize=300%2C297&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?resize=768%2C761&amp;ssl=1 768w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?resize=806%2C799&amp;ssl=1 806w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?resize=558%2C553&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?resize=655%2C649&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?resize=24%2C24&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.23.55.jpg?w=928&amp;ssl=1 928w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1"><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.25.27.jpg?resize=300%2C99&amp;ssl=1" alt="" width="300" height="99" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.25.27.jpg?resize=300%2C99&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.25.27.jpg?resize=558%2C184&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.25.27.jpg?resize=24%2C8&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-11.25.27.jpg?w=642&amp;ssl=1 642w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1"></span></p>
<h2><span style="font-weight: 400;">Storing &amp; reporting our data</span></h2>
<p><span style="font-weight: 400;">Once we have collected all of the data, we can create a message and post it on Slack for the team to see:</span></p>
<p><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.35.34.jpg?resize=300%2C267&amp;ssl=1" alt="Slack Action" width="300" height="267" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.35.34.jpg?resize=300%2C267&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.35.34.jpg?resize=768%2C684&amp;ssl=1 768w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.35.34.jpg?resize=806%2C718&amp;ssl=1 806w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.35.34.jpg?resize=558%2C497&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.35.34.jpg?resize=655%2C583&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.35.34.jpg?resize=24%2C21&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.35.34.jpg?w=986&amp;ssl=1 986w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1">The message that is sent to the channel is a <a href="https://realpython.com/python-f-strings/">Python f string</a> with variables added.</p>
<p><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=945%2C315&amp;ssl=1" alt="" width="945" height="315" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=1024%2C341&amp;ssl=1 1024w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=300%2C100&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=768%2C256&amp;ssl=1 768w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=1116%2C371&amp;ssl=1 1116w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=806%2C268&amp;ssl=1 806w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=558%2C186&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=655%2C218&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?resize=24%2C8&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot_2023-04-24_at_12_05_04.jpg?w=1328&amp;ssl=1 1328w" sizes="(max-width: 945px) 100vw, 945px" data-recalc-dims="1"></p>
<p><span style="font-weight: 400;">This is a fun way to update the team on a daily basis…but we also want to chart this data over time.  To accomplish this, we have a table in PostgreSQL for our stats, and we just make an INSERT using the prebuilt Postgres Action (again this is low-code as you must write the SQL INSERT command:</span></p>
<p><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.37.49.jpg?resize=300%2C64&amp;ssl=1" alt="" width="300" height="64" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.37.49.jpg?resize=300%2C64&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.37.49.jpg?resize=768%2C163&amp;ssl=1 768w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.37.49.jpg?resize=806%2C171&amp;ssl=1 806w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.37.49.jpg?resize=558%2C119&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.37.49.jpg?resize=655%2C139&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.37.49.jpg?resize=24%2C5&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.37.49.jpg?w=950&amp;ssl=1 950w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1"></p>
<p><span style="font-weight: 400;">The data in Postgres feeds a Grafana dashboard – allowing the team access to the latest data from our metrics – and the best part of it all is that there is no daily toil required.  And many folks on the team just go to the dashboard to get the data – the DevRel team is no longer a bottleneck!</span></p>
<h2><span style="font-weight: 400;">Progressive enhancement</span></h2>
<p><span style="font-weight: 400;">As time goes on, more questions about data will arise. </span></p>
<p><span style="font-weight: 400;">As an example, since the number of Actions and RunBooks in GitHub keeps increasing, I was recently asked “how many Actions do we have in GItHub today?” </span></p>
<p><span style="font-weight: 400;">The first few times you are asked a question like this, you can probably get away with waving your hands, and a ballpark figure… but after being asked a few times, I knew I needed a “real” answer. Reusing an existing GitHub Action, I was able to create a file in Github with the counts that I needed.  </span><span style="font-weight: 400;">By dragging a new Action into my RunBook, writing a few lines of Python code (and a small change on the Postgres insert), I was able to easily extend the current data collection to include more data.  </span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.43.42.jpg?resize=300%2C134&amp;ssl=1" alt="" width="300" height="134" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.43.42.jpg?resize=300%2C134&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.43.42.jpg?resize=768%2C342&amp;ssl=1 768w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.43.42.jpg?resize=806%2C359&amp;ssl=1 806w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.43.42.jpg?resize=558%2C249&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.43.42.jpg?resize=655%2C292&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.43.42.jpg?resize=24%2C11&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.43.42.jpg?w=808&amp;ssl=1 808w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1"><br>
</span></p>
<p><span style="font-weight: 400;">Aside: We can also leverage these values to create custom badges for the Github readme, and on the website – so creating the data has been a double win!</span></p>
<p><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.44.33.jpg?resize=300%2C148&amp;ssl=1" alt="" width="300" height="148" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.44.33.jpg?resize=300%2C148&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.44.33.jpg?resize=558%2C275&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.44.33.jpg?resize=655%2C323&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.44.33.jpg?resize=24%2C12&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-17.44.33.jpg?w=750&amp;ssl=1 750w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1"></p>
<h2><span style="font-weight: 400;">Scheduling</span></h2>
<p><span style="font-weight: 400;">Now that I have built a RunBook that collects all of data we need (so far…) -&gt; I want to automate the execution of the RunBook.  Using unSkript’s Scheduler, I have set my RunBook to run at midnight GMT every day.  </span></p>
<p><img decoding="async" loading="lazy" src="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=945%2C549&amp;ssl=1" alt="" width="945" height="549" srcset="https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=1024%2C595&amp;ssl=1 1024w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=300%2C174&amp;ssl=1 300w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=768%2C446&amp;ssl=1 768w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=1116%2C648&amp;ssl=1 1116w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=806%2C468&amp;ssl=1 806w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=558%2C324&amp;ssl=1 558w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=655%2C381&amp;ssl=1 655w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?resize=24%2C14&amp;ssl=1 24w, https://i0.wp.com/unskript.com/wp-content/uploads/2023/04/Screenshot-2023-04-24-at-15.32.28.jpg?w=1332&amp;ssl=1 1332w" sizes="(max-width: 945px) 100vw, 945px" data-recalc-dims="1"></p>
<p>Now, I have daily reports being created for the team, that require ZERO work on my part!</p>
<h2><span style="font-weight: 400;">Summary</span></h2>
<p><span style="font-weight: 400;">Collecting and aggregating statistics via automation frees the team to can focus on our “real” work: creating more tools and applications – and no longer spend significant time on metric collection.  At the same time, everyone has visibility into the project – showing the value of the DevRel team, without impacting their workload.</span></p>
<p><span style="font-weight: 400;">How does your DevRel team collect usage data?  If you’d like to give unSkript a try, check out our<a href="https://us.app.unskript.io/"> Free trial</a>.  Join our <a href="https://communityinviter.com/apps/cloud-ops-community/awesome-cloud-automation">Slack Channel</a>, and I would be happy to chat with you on strategies to build your RunBook to collect your analytics data.  I’ll also be happy to share the skeleton of my RunBook to get you started!