<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David Calvert on Medium]]></title>
        <description><![CDATA[Stories by David Calvert on Medium]]></description>
        <link>https://medium.com/@dotdc?source=rss-dcd0622a4145------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-jr05aRsofQSbeSt_siqBA.jpeg</url>
            <title>Stories by David Calvert on Medium</title>
            <link>https://medium.com/@dotdc?source=rss-dcd0622a4145------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 05:54:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dotdc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Replacing pre-commit with prek]]></title>
            <link>https://medium.com/@dotdc/replacing-pre-commit-with-prek-b12fc9e94119?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/b12fc9e94119</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[pre-commit]]></category>
            <category><![CDATA[pre-k]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 00:00:12 GMT</pubDate>
            <atom:updated>2026-11-04T06:15:43.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQPRkCrwU5LTFl-lvtfUIg.png" /></figure><h3>Introduction</h3><p>If you use <a href="https://github.com/pre-commit/pre-commit">pre-commit</a>, <a href="https://github.com/j178/prek">prek</a> is a faster, drop-in replacement written in Rust. It ships as a single binary with no Python dependency, and your existing configs and hooks work as-is.</p><p>In <a href="https://0xdc.me/blog/git-hooks-management-with-pre-commit-and-lefthook/">Git hooks management with pre-commit and lefthook</a>, I compared the tradeoffs between these two tools. pre-commit had the community hooks, and lefthook had the performance. Today, prek offers the best of both worlds for most people, with pre-commit’s hook compatibility and parallel execution similar to lefthook’s.</p><p>In this article, I’ll go through what prek changes compared to pre-commit, how it performs, and how I migrated my repositories.</p><h3>What prek brings</h3><p>For the most part, prek matches pre-commit’s features. But like most rewrites, it’s also a good opportunity to revisit well-known pain points.</p><p>Over the years, pre-commit’s issue tracker has accumulated a lot of declined feature requests. While many of these decisions are valid, I think some of these features would have significantly increased the value of the project. It appears that prek’s maintainer came to a similar conclusion, as several features requested by the pre-commit community are available in prek. The most important ones for me are:</p><h3>Performance</h3><p>pre-commit is written in Python. It creates a virtual environment for each Python hook with virtualenv and installs the hook’s dependencies with pip. prek is written in Rust and uses uv for both steps, so installing hooks is faster out of the box. If you already use <a href="https://github.com/tox-dev/pre-commit-uv">pre-commit-uv</a>, you get the uv speedup at install time too, but prek still installs hooks faster because it sets up their environments in parallel.</p><p>The <a href="https://prek.j178.dev/benchmark/#summary">prek benchmark</a> runs 13 hooks from pre-commit-hooks on 960 files, adding one optimization at a time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*oJ0m_yYbp_OPMtKzPBPBRg.png" /></figure><p>Most of the gain comes from prek’s fast path, which swaps these common hooks for built-in Rust versions. prek can also skip the that pre-commit runs after every hook to detect changes when it already knows the outcome of its hooks, which adds up in large repositories.</p><h3>Parallel execution</h3><p>For individuals and teams looking for fast checks, this is likely the most interesting feature. When I wrote my previous article, I wanted to see if it was possible to have parallel execution in pre-commit, similar to lefthook. I even started a small project in Go that I was planning to call pre-gommit. The idea was to wrap pre-commit calls using goroutines, but I wasn’t satisfied with the results, and I didn’t want to invest much time in the project.</p><p>prek doesn’t have a global switch to enable parallel execution like lefthook’s parallel: true. By default, prek assigns each hook an implicit priority based on its order, which preserves the sequential behavior of pre-commit. Running the five hooks from my previous article takes just as long as it did with pre-commit:</p><pre>$ time prek run --all-files<br>command-1............................................................Passed<br>command-2............................................................Passed<br>command-3............................................................Passed<br>command-4............................................................Passed<br>command-5............................................................Passed<br><br>real    0m5.044s<br>user    0m0.010s<br>sys     0m0.036s</pre><p>Parallel execution is only possible when using the priority option. Hooks with a lower priority run first, and hooks sharing the same priority run in parallel.</p><p>Let’s give all our hooks the same priority:</p><pre># .pre-commit-config.yaml<br>repos:<br>  - repo: local<br>    hooks:<br>      - id: command-1<br>        name: command-1<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br>        priority: 1<br><br>      - id: command-2<br>        name: command-2<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br>        priority: 1<br><br>      - id: command-3<br>        name: command-3<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br>        priority: 1<br><br>      - id: command-4<br>        name: command-4<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br>        priority: 1<br><br>      - id: command-5<br>        name: command-5<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br>        priority: 1</pre><p>All five hooks now run in parallel:</p><pre>$ time prek run --all-files<br>command-1............................................................Passed<br>command-2............................................................Passed<br>command-3............................................................Passed<br>command-4............................................................Passed<br>command-5............................................................Passed<br><br>real    0m2.059s<br>user    0m0.083s<br>sys     0m0.166s</pre><p>If you set the priority of command-2 to 0, it will run first, followed by the other four hooks in parallel:</p><pre>$ time prek run --all-files<br>command-2............................................................Passed<br>command-1............................................................Passed<br>command-3............................................................Passed<br>command-4............................................................Passed<br>command-5............................................................Passed<br><br>real    0m2.059s<br>user    0m0.083s<br>sys     0m0.166s</pre><p>This way, priority groups let you choose both the execution order of your hooks and which ones can run in parallel.</p><p>Execution safety is not guaranteed by prek, as described in its <a href="https://prek.j178.dev/reference/configuration/#priority">documentation</a>:</p><blockquote><em>If two hooks run in the same priority group and both mutate the same files (or depend on shared state), results are undefined. Use separate priorities to avoid overlap.</em></blockquote><p>In other words, it’s up to you to decide which hooks can safely run in parallel. This is also why pre-commit’s maintainer declined the feature, arguing that there’s no way to do it safely in general. prek leaves that decision to the user, which I think is the right tradeoff. A good starting point is to group read-only checks together, and give each hook that modifies files its own priority.</p><h3>Monorepos</h3><p>pre-commit expects a single configuration at the root of the repository, which is hard to maintain in a monorepo where each project has its own tools. With prek’s <a href="https://prek.j178.dev/monorepos/">workspace mode</a>, every directory containing a configuration file is a project, and there’s nothing else to set up:</p><pre>├── .pre-commit-config.yaml<br>├── backend/<br>│   └── .pre-commit-config.yaml<br>└── frontend/<br>    └── .pre-commit-config.yaml</pre><p>Running prek from the root discovers all the projects. Each hook runs from its own project’s directory, and you can target a single project or hook:</p><pre># Run all projects<br>$ prek run --all-files<br><br># Run a single project<br>$ prek run frontend/ --all-files<br><br># Run a single hook from a project<br>$ prek run frontend:check-json --all-files</pre><p>Nested configurations add to their parents rather than replacing them, so a shared check defined at the root still applies to frontend/, unless the project sets orphan: true.</p><h3>Keeping your hooks fast</h3><p>While looking for data on prek versus pre-commit, I noticed that many people were complaining about their pre-commit checks running for minutes. A faster runner will help, but it won’t fix slow hooks. I think hooks are a great way to catch a bunch of errors early, but they shouldn’t be used for tests or other long-running tasks.</p><p>For these, I would recommend using a make tests or similar, which can be used both locally and in your CI/CD pipelines. This way, your hooks remain small and developers won&#39;t be tempted to use git commit --no-verify.</p><h3>Migration</h3><p>I’ve migrated my repositories both at work and at home, and I haven’t noticed any compatibility issues.</p><p>First, <a href="https://prek.j178.dev/installation/">install prek</a> using the method of your choice:</p><pre>uv tool install prek</pre><p>Then replace the Git hook in each repository using pre-commit:</p><pre>$ prek install --force<br>Overwriting existing hook at `.git/hooks/pre-commit`<br>Installed Git hook at `.git/hooks/pre-commit`</pre><p>That’s all you need for the migration itself, as prek reads the same .pre-commit-config.yaml.</p><h3>Built-in hooks</h3><p>The only change I made to my configurations was replacing <a href="https://github.com/pre-commit/pre-commit-hooks">pre-commit/pre-commit-hooks</a> with prek’s built-in hooks, which don’t require cloning a remote repository.</p><p>Replace the old pre-commit hooks:</p><pre>repos:<br>  - repo: https://github.com/pre-commit/pre-commit-hooks<br>    rev: v6.0.0<br>    hooks:<br>      - id: trailing-whitespace<br>      - id: check-added-large-files</pre><p>With prek’s built-in hooks:</p><pre>repos:<br>  - repo: builtin<br>    hooks:<br>      - id: trailing-whitespace<br>      - id: check-added-large-files</pre><p>Be aware that repo: builtin and priority are <a href="https://prek.j178.dev/compatibility/">specific to prek</a>, so these configurations are no longer portable to pre-commit. This is fine once all team members have switched to prek. If that&#39;s not the case, keep the original configuration, as you&#39;ll still benefit from <a href="https://prek.j178.dev/built-in-hooks/#use-the-automatic-fast-path">prek&#39;s fast path</a>.</p><h3>GitHub Actions</h3><p>In CI, the <a href="https://github.com/j178/prek-action">prek action</a> replaces the steps to set up Python and install pre-commit. Here’s a simple GitHub workflow:</p><pre>name: prek-hooks<br><br># Doc: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions<br><br>on:<br>  push:<br>    branches:<br>      - main<br>  pull_request:<br>    branches:<br>      - main<br>  # Allow this workflow to be manually triggered<br>  workflow_dispatch:<br><br># No permissions by default<br>permissions: {}<br><br>jobs:<br>  prek-hooks:<br>    runs-on: ubuntu-latest<br>    permissions:<br>      contents: read<br>    steps:<br>      - name: Checkout ${{ github.repository }}<br>        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1<br>        with:<br>          persist-credentials: false<br><br>      - name: Run prek hooks<br>        uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0</pre><h3>Final words</h3><p>Replacing pre-commit with prek is easy and gives you faster hooks out of the box. If you’re willing to invest a bit more time, parallel execution and workspaces can take it further, and teams with monorepos or many hooks will benefit the most. The prek community is growing fast, and projects like OpenClaw, Ruff and Sentry are already <a href="https://github.com/j178/prek#who-is-using-prek">using it</a>.</p><p>If you’re using pre-commit today, give prek a try. It only takes a few minutes, and you’ll probably notice the difference!</p><h3>References</h3><ul><li><a href="https://github.com/j178/prek">prek</a></li><li><a href="https://prek.j178.dev/benchmark/">prek benchmark</a></li><li><a href="https://prek.j178.dev/compatibility/">prek compatibility with pre-commit</a></li><li><a href="https://github.com/pre-commit/pre-commit">pre-commit</a></li><li><a href="https://0xdc.me/blog/git-hooks-management-with-pre-commit-and-lefthook/">Git hooks management with pre-commit and lefthook</a></li></ul><p><em>Originally published at </em><a href="https://0xdc.me/blog/replacing-pre-commit-with-prek/"><em>https://0xdc.me</em></a><em> on November 4, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b12fc9e94119" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a written culture with RFDs]]></title>
            <link>https://medium.com/@dotdc/building-a-written-culture-with-rfds-b835678d9686?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/b835678d9686</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[process]]></category>
            <category><![CDATA[culture]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[rfd]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Fri, 23 Oct 2026 16:05:54 GMT</pubDate>
            <atom:updated>2026-10-23T16:05:54.699Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*naQ0599EYfaefIhIe3MrAw.png" /></figure><h3>Introduction</h3><p>When I started at <a href="https://strangebee.com/">StrangeBee</a>, my role covered both the technical aspects, which I’m used to, and the organizational side of leading the team, which was new to me. I’ve done many things in my career, but this was the first time I had the chance to shape how a team works, from its methodology and tooling to its processes and approach to quality.</p><p>Like many distributed teams, most of our discussions and collaboration happen asynchronously. When working remotely, a written culture isn’t a nice-to-have, it’s what keeps everyone aligned, and it was missing. Ideas and decisions were spread across conversations, and rarely written down in a way everyone could find, discuss and come back to. We needed a framework to change the current habits.</p><p>Inspired by the IETF’s <a href="https://www.ietf.org/process/rfcs/">Requests for Comments</a> (RFC) and <a href="https://oxide.computer/">Oxide</a>’s <a href="https://rfd.shared.oxide.computer/rfd/0001">Requests for Discussion</a> (RFD), I started working on an RFD process tailored to our needs. In this article, I’ll go through why we chose RFDs, how our process works, how we adapted it along the way, and how it spread beyond my team.</p><h3>Why write things down?</h3><p>Writing down ideas helps us formulate them clearly and share them openly with everyone they may affect. Anyone is free to give feedback, raise concerns or suggest alternatives before we commit. This way, decisions are made collectively and in the open, and the reasoning behind them remains available long after the discussion is over.</p><p>That written record also becomes shared context for both humans and AI agents. A new teammate can read it to understand how and why things are done. Published RFDs can also feed an AGENTS.md, a CLAUDE.md or agent skills, so that AI agents work as closely as possible to what the team expects.</p><h3>Why RFD and not RFC or ADR?</h3><p>We chose the name RFD over RFC for two reasons. First, RFC was already used internally at StrangeBee for “Request for Change”, so it would have been confusing. Second, I believe that discussion is more welcoming than comments. Comments suggest a review, where you comment on someone else&#39;s proposal. A discussion, instead, invites collaboration and contributions. While this may sound like a minor detail, this alone changed how people perceived the idea when I pitched it.</p><p>A few initiatives had also started using <a href="https://github.com/architecture-decision-record/architecture-decision-record">Architecture Decision Records</a> (ADR) to document architecture choices. But because of their name, ADRs are heavily associated with architecture, and often seen as reserved for architects, technical leads and the like. RFDs, on the other hand, are broader in both subject and audience. Anyone can write one, about anything that deserves a discussion, which makes adoption much easier.</p><h3>When to write an RFD</h3><p>We write an RFD whenever a decision is significant enough to deserve a discussion. Common cases include the following:</p><ul><li>Adding or changing a team process</li><li>Making an architectural or design decision</li><li>Choosing a tool or technology</li><li>Introducing a breaking change</li></ul><p>Casual work such as regular features, bug fixes, small tooling decisions or generally anything with a low blast radius doesn’t need an RFD, a pull request is enough.</p><h3>Anatomy of an RFD</h3><p>The structure of an RFD is open, but we strongly encourage the following format, which also serves as our template.</p><ul><li><strong>Title and ID</strong>: formatted as RFD n: Title, where n is the next available ID, or n.x for an amendment.</li><li><strong>Description</strong>: what the RFD is about.</li><li><strong>Problem</strong>: what it solves and why it matters.</li><li><strong>Proposal</strong>: the proposal and which alternatives were considered.</li><li><strong>Impact</strong>: who will be affected and how.</li></ul><h3>Requirement keywords</h3><p>All our RFDs MUST respect <a href="https://www.rfc-editor.org/info/rfc2119/">RFC 2119</a> when using requirement keywords. We use them to clearly declare whether what we’re discussing is required, recommended or optional. As clarified by <a href="https://www.rfc-editor.org/info/rfc8174/">RFC 8174</a>, these keywords only carry this meaning when capitalized.</p><blockquote><em>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.</em></blockquote><p>It may look a bit formal for a team process, but it removes a lot of ambiguity. For example, “Pull requests MUST be reviewed by at least two team members” leaves no room for interpretation, while “Commit messages SHOULD follow Conventional Commits” is a strong recommendation that can be ignored if there’s a good reason.</p><h3>Lifecycle of an RFD</h3><p>Oxide’s RFD 1 defines six states, but we decided to keep it simple and only use four:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*SYuIBxCST2zp7DdgHYjk7w.png" /></figure><h3>Acceptance</h3><p>An RFD is published once the team has collectively agreed on it. We aim for consensus, but we don’t wait for unanimity, as that would delay every decision. Once an RFD is published, we commit to it as one team, including those who argued for something else, in the spirit of <a href="https://en.wikipedia.org/wiki/Disagree_and_commit">disagree and commit</a>.</p><h3>Updating an RFD</h3><p>RFDs aren’t immutable. Requiring a new RFD for every change would be too restrictive, and updates would end up lost much further in the index, with something like RFD 172 updating RFD 25. Instead, we clearly define when to update an RFD in place and when to create a new one.</p><p>A published RFD can be updated in one of three ways, depending on how much the decision is affected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*KjpJfAw2YnBbUuHH7FdAOg.png" /></figure><p>For example, amending RFD 42 creates RFD 42.1, amending RFD 42.1 creates RFD 42.2, and so on.</p><p>Amending or superseding an RFD MUST go through a new discussion, which follows the same lifecycle as any other RFD. Once the new RFD is published, the previous one is flagged as ABANDONED with a link to the latest version. Readers immediately know it has been replaced, and the reasoning and timeline behind every decision remain available to everyone.</p><h3>Rolling it out</h3><h3>The team</h3><p>After my initial RFD proposal, my teammates quickly understood the format and had their own ideas for RFDs. Within a few days, new RFDs had been created, and the RFD process itself was improved several times along the way. That was the best sign I could have hoped for, as the team embraced the process and made it their own.</p><h3>Beyond my team</h3><p>I then pitched the idea to the Head of Infrastructure &amp; Security at StrangeBee, who had recently started a similar initiative with ADRs. He liked the format and our ideas, and wanted a single process for the whole division. Since there were only a few ADRs, he converted them to RFDs and generalized the format across the entire Infrastructure &amp; Security division, which includes the Infrastructure, Cloud, IT and Security teams.</p><p>From there, it reached other engineering teams. Our VP of Engineering liked the idea, and the frontend team started writing their own RFDs. They reached out to share their ideas to improve both the process and how RFDs are managed across teams.</p><p>Seeing the idea spread that quickly in a company with already established processes was a really good sign. I believe the open format and the name played a key role in its adoption. Anyone can write an RFD about anything, and everyone is invited to take part, so it’s easy to jump in.</p><h3>Final words</h3><p>Implementing RFDs turned out to be a simple way to make decisions in the open, and to give everyone a voice before we commit. Thanks to Oxide for sharing their process publicly, and to my teammates for writing and challenging the first RFDs!</p><p>If your team struggles to keep track of its decisions, I hope this article gives you a good starting point to build your own RFD process!</p><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li><li>X : <a href="https://twitter.com/0xDC_">https://x.com/0xDC_</a></li></ul><p>👋</p><h3>References</h3><ul><li><a href="https://rfd.shared.oxide.computer/rfd/0001">Oxide RFD 1: Requests for Discussion</a></li><li><a href="https://github.com/architecture-decision-record/architecture-decision-record">Architecture Decision Record</a></li><li><a href="https://www.ietf.org/process/rfcs/">Requests for Comments</a></li><li><a href="https://www.rfc-editor.org/info/rfc2119/">RFC 2119: Key words for use in RFCs to Indicate Requirement Levels</a></li><li><a href="https://www.rfc-editor.org/info/rfc8174/">RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</a></li></ul><p><em>Originally published at </em><a href="https://0xdc.me/blog/building-a-written-culture-with-rfds/"><em>https://0xdc.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b835678d9686" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating from ingress-nginx to Envoy Gateway]]></title>
            <link>https://medium.com/@dotdc/migrating-from-ingress-nginx-to-envoy-gateway-b26a877f9443?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/b26a877f9443</guid>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[envoy]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[nginx-ingress]]></category>
            <category><![CDATA[envoy-gateway]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 21:02:12 GMT</pubDate>
            <atom:updated>2026-03-17T21:02:12.293Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-nDRvcJOm5oRwCU_MAKkA.png" /></figure><h3>Introduction</h3><p>At work, I recently had to plan the migration from <a href="https://github.com/kubernetes/ingress-nginx">ingress-nginx</a> to <a href="https://github.com/envoyproxy/gateway">Envoy Gateway</a>. The main reason was the announced <a href="https://www.kubernetes.dev/blog/2025/11/12/ingress-nginx-retirement/">retirement of ingress-nginx</a>, but it was also a good opportunity to adopt <a href="https://gateway-api.sigs.k8s.io/">Gateway API</a>. In this article, I’ll go through the main differences between the two solutions, the migration plan I used, how I converted the existing manifests and how I made the switch without affecting customers.</p><h3>What changes?</h3><p>The goal here is not to list all changes or replace the existing documentation, but to focus on the most common ones and those related to my use case. For each nginx.ingress.kubernetes.io/* annotation you use, you&#39;ll need to make sure you can achieve the same result with Gateway API resources.</p><p>Here are a few differences worth checking:</p><ul><li><strong>Default timeout</strong>: 60s on ingress-nginx, 15s on Envoy Gateway. This timeout difference matters because requests that were fine with ingress-nginx may now fail earlier, especially for slow HTTP endpoints or long-lived gRPC calls.</li><li><strong>Headers containing underscores</strong>: Envoy Gateway rejects headers with underscores by default. Depending on your existing configuration, you may need to use withUnderscoresAction: Allow in ClientTrafficPolicy or another configuration scope. (See <a href="https://github.com/envoyproxy/gateway/issues/8351">envoyproxy/gateway #8351</a>)</li><li><strong>External auth</strong>: Envoy Gateway appends the original request path to the configured auth path, so you may need to update your auth endpoint to handle more paths, and more HTTP methods than you had with ingress-nginx. (<a href="https://gateway.envoyproxy.io/docs/api/extension_types/#httpextauthservice">Documentation</a>)</li></ul><p>To get all Ingress resources:</p><pre>kubectl get ingress -A</pre><p>To get nginx-ingress annotations in use:</p><pre>kubectl get ingress -A -o yaml | grep &quot;nginx.ingress.kubernetes.io&quot; | sort -u</pre><h3>Migration strategy</h3><p>Here’s my migration plan:</p><ol><li>Install the Gateway API CRDs and Envoy Gateway.</li><li>Create a <a href="https://gateway.envoyproxy.io/latest/api/gateway_api/gatewayclass/">GatewayClass</a> and a <a href="https://gateway.envoyproxy.io/latest/api/gateway_api/gateway/">Gateway</a>.</li><li>Create new AWS target groups and security rules.</li><li>Convert existing <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/">Ingress</a> resources into <a href="https://gateway-api.sigs.k8s.io/api-types/httproute/">HTTPRoute</a>, <a href="https://gateway-api.sigs.k8s.io/api-types/backendtrafficpolicy/">BackendTrafficPolicy</a>, <a href="https://gateway.envoyproxy.io/latest/concepts/gateway_api_extensions/security-policy/">SecurityPolicy</a> and <a href="https://gateway-api.sigs.k8s.io/api-types/referencegrant/">ReferenceGrant</a>.</li><li>Validate all routes and test in staging.</li><li>Switch traffic using the new target groups.</li><li>Clean up old resources.</li></ol><p>This step-by-step approach makes the migration easier to manage without impacting developers and customers.</p><h3>Installing Envoy Gateway</h3><p>The first step is to install the Gateway API CRDs and Envoy Gateway. I used the <a href="https://gateway.envoyproxy.io/latest/install/install-helm/">official Helm chart</a> to do so and then created a <a href="https://gateway.envoyproxy.io/latest/api/gateway_api/gatewayclass/">GatewayClass</a> and a <a href="https://gateway.envoyproxy.io/latest/api/gateway_api/gateway/">Gateway</a>.</p><p>In order to validate the deployment, make sure all the resources have been created:</p><pre>kubectl get deploy,po,svc,gtw,eproxy -n envoy-gateway-system</pre><h3>Creating new AWS resources</h3><p>We use Terraform to provision our AWS infrastructure, so I added new resources behind a use_envoy_gateway feature flag in our Terraform modules alongside the existing ones. In my case, I had to:</p><ul><li>Create new target groups for the AWS ALBs and NLBs</li><li>Add security group rules to allow traffic on the new port</li></ul><p>This allowed me to leave the current load balancer configuration untouched until everything was ready.</p><h3>Converting Ingress resources</h3><p>To translate the existing Ingress resources to Gateway API resources, I initially tried <a href="https://github.com/kubernetes-sigs/ingress2gateway">ingress2gateway</a> from Kubernetes SIGs, but it didn&#39;t support many of our use cases. That&#39;s when I found the <a href="https://github.com/kkk777-7/ingress2eg">ingress2eg</a> fork, which supports many more features.</p><h3>Conversion script</h3><p>To speed things up, I created a script to convert all ingresses from all namespaces in the current Kubernetes context:</p><pre>#!/usr/bin/env bash<br><br>Y=&quot;\033[1;33m&quot;<br>W=&quot;\033[0m&quot;<br><br># ./ingress2gateway or ./ingress2eg<br># See:<br># - https://github.com/kubernetes-sigs/ingress2gateway<br># - https://github.com/kkk777-7/ingress2eg<br>binary=&quot;./ingress2eg&quot;<br><br># Loop through all namespaces and convert all ingresses<br>for ns in $(kubectl get ingress -A --no-headers | awk &#39;{ print $1 }&#39; | sort -u); do<br>    for ingress in $(kubectl get ingress -n &quot;$ns&quot; --no-headers | awk &#39;{ print $1 }&#39;); do<br>        kubectl get ingress &quot;$ingress&quot; -n &quot;$ns&quot; -o yaml &gt; &quot;ingress-${ns}-${ingress}.yaml&quot;<br><br>        # Files and command definition<br>        input_file=&quot;ingress-${ns}-${ingress}.yaml&quot;<br>        output_file=&quot;converted-ingress-${ns}-${ingress}.gateway.yaml&quot;<br>        cmd=(<br>          &quot;$binary&quot; print<br>          --providers=ingress-nginx<br>          -n &quot;$ns&quot;<br>          --input-file &quot;$input_file&quot;<br>        )<br><br>        if &quot;${cmd[@]}&quot; &amp;&gt; &quot;$output_file&quot;; then<br>            echo -e &quot;✅ ${Y}${ingress}${W} in namespace ${Y}${ns}${W} converted!&quot;<br>        else<br>            echo -e &quot;❌ Error converting ${Y}${ingress}${W} in namespace ${Y}${ns}${W}.&quot;<br>        fi<br>    done<br>done</pre><p>For the Ingresses that fail to convert, you’ll need to handle them manually, but the others may work out of the box. In our case, it turned out that many generated manifests lacked critical configuration, especially for routes requiring external auth (extAuth), so I had to fix them.</p><p>Note that using ingress2eg will add the following annotations which you may want to remove:</p><p>Depending on your setup, you will likely end up with:</p><ul><li><a href="https://gateway-api.sigs.k8s.io/api-types/httproute/">HTTPRoute</a> for routing rules</li><li><a href="https://gateway-api.sigs.k8s.io/api-types/backendtrafficpolicy/">BackendTrafficPolicy</a> for traffic settings</li><li><a href="https://gateway.envoyproxy.io/latest/concepts/gateway_api_extensions/security-policy/">SecurityPolicy</a> for auth and security settings</li><li><a href="https://gateway-api.sigs.k8s.io/api-types/referencegrant/">ReferenceGrant</a> for cross-namespace references</li></ul><h3>Making the switch</h3><p>Once all the Gateway API and Envoy Gateway resources were running alongside the existing configuration, the final switch was straightforward and had no impact on customers. In our case, this simply meant enabling the use_envoy_gateway feature flag in our Terraform module. It also made rollback easy in case something went wrong.</p><h3>Final thoughts</h3><p>The complexity of migrating from ingress-nginx to Envoy Gateway depends heavily on your platform requirements. It also requires some attention, especially if you are new to the Gateway API. I hope this article gives you a useful starting point if you need to make the switch.</p><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li><li>Twitter : <a href="https://twitter.com/0xDC_">https://twitter.com/0xDC_</a></li></ul><p>👋</p><p><em>Originally published at </em><a href="https://0xdc.me/blog/migrate-nginx-ingress-to-envoy-gateway/"><em>https://0xdc.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b26a877f9443" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Cursor workshop developers enjoy doing]]></title>
            <link>https://medium.com/@dotdc/creating-a-cursor-workshop-developers-enjoy-doing-41242a2373d3?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/41242a2373d3</guid>
            <category><![CDATA[cursor-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[workshop]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 12:32:03 GMT</pubDate>
            <atom:updated>2025-11-11T12:32:03.402Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STkAUyaFALg6ZPend8QHUw.png" /></figure><h3>Introduction</h3><p>A few weeks ago, my friend <a href="https://www.linkedin.com/in/donia-chaiehloudj/">Donia</a> started asking me questions about <a href="https://cursor.com/">Cursor</a>, the AI coding editor, because she knew I was working with it and wanted to learn how I was using it. She was really interested, and since she’s also a founding member of the Google Developer Group in Sophia-Antipolis, she asked if I would be willing to prepare a workshop on Cursor for the local community.</p><h3>Goal</h3><p>The goal was to organize a local event limited to 40 people, starting with a Cursor presentation led by <a href="https://www.linkedin.com/in/michele-legait/">Michèle</a> (<a href="https://docs.google.com/presentation/d/1rjCuA0mfH_Csq4sM7IhhGjgNEGduKKvCKOyYUSZi8Uc">slides</a>), followed by a hands-on workshop to discover the tool, which I volunteered to prepare.</p><p>I’ve been involved with local tech communities since March 2016, participated in many events, and contributed to several, especially by co-organizing and preparing technical talks for the local <a href="https://www.meetup.com/docker-nice/">Docker User Group</a> and <a href="https://www.meetup.com/fr-FR/sophia-antipolis-hashicorp-user-group/">Sophia-Antipolis HashiCorp User Group</a>. However, I had never organized or built an entire workshop before.</p><h3>Building the workshop</h3><p>I never really participated in workshops myself. I mostly learned by hacking solo at home or at work with the help of teammates. So I thought about what would make one enjoyable and decided to build the kind of workshop I’d like to do, one that lets you learn while having fun and keeps you entertained and motivated all the way through.</p><p>I decided to create a small web application so participants could easily modify and visualize their changes.</p><p>Script:</p><blockquote><em>You’re a bold entrepreneur ready to outclass Amazon.com with the </em><em>{Gopher|Snake|Typed} Bookshop! 🚀<br>Luckily, you&#39;ve just discovered the legendary Cursor IDE and unlocked AI magical powers! ✨<br>Hero, grab your keyboard, the code awaits! ⚔️</em></blockquote><p>I wanted the workshop to be available in several programming languages so people could choose the one they felt most comfortable with. It’s available in three versions:</p><ul><li>golang-workshop: The Gopher Bookshop, the Golang version.</li><li>python-workshop: The Snake Bookshop, the Python version.</li><li>typescript-workshop: The Typed Bookshop, the TypeScript version.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B9R_wc4xgW8nELAI.gif" /><figcaption><em>Screenshots: animation of the {Gopher|Snake|Typed} Bookshop websites.</em></figcaption></figure><blockquote><em>🚀 </em><strong><em>Learn Cursor with this workshop</em></strong><em><br>The workshop is open-source and hosted on GitHub.<br>You can complete most of it using </em><a href="https://cursor.com/pricing"><em>Cursor’s free tier</em></a><em> (Auto Mode).<br>👉 Repository: </em><a href="https://github.com/dotdc/cursor-workshop"><em>https://github.com/dotdc/cursor-workshop</em></a></blockquote><h3>Workshop Quests</h3><p>Here’s a summary of the workshop quests and their purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*bk-QRsE5Yh7Whb5_wQvOgg.png" /><figcaption>Screenshot of the quests</figcaption></figure><h3>The event</h3><p>The event took place on Thursday, November 6, at Datadog’s offices in Sophia-Antipolis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXbanDvu5Qj1w-z4F7kVdA.jpeg" /><figcaption>Picture of the event</figcaption></figure><p><strong>Program:</strong></p><ul><li><strong>Presentation (30 min):</strong> Introduction to Cursor: description, features, modes, and much more. (<a href="https://docs.google.com/presentation/d/1rjCuA0mfH_Csq4sM7IhhGjgNEGduKKvCKOyYUSZi8Uc">slides</a>)</li><li><strong>Workshop (1 h):</strong> Get hands-on with the workshop and enjoy a few surprises. (<a href="https://github.com/dotdc/cursor-workshop">repository</a>)</li><li><strong>Conclusion (15 min):</strong> Key takeaways, going further and open Q&amp;A.</li><li><strong>Networking &amp; Food:</strong> Drinks, snacks, and great conversations with participants, speakers, and organizers.</li></ul><p>The event went really well. Everyone already had Cursor installed and was able to complete the workshop exercises. I was happy to see that most people finished within the allotted time. During networking, I had some great discussions and questions about generative AI tools for coding, and received very positive feedback!</p><h3>Final words</h3><p>It was fun to prepare this workshop, and I’m glad people enjoyed it! Thanks to the other organizers from <a href="https://www.linkedin.com/company/jssophia/">JSSophia</a> and <a href="https://www.linkedin.com/company/gdg-sophia-antipolis/">GDG Sophia-Antipolis</a> for their initiative, <a href="https://www.linkedin.com/in/benmlang/">Ben</a> from Cursor for providing vouchers and swag, and Datadog for hosting the event. See you next time for another one, maybe on <a href="https://modelcontextprotocol.io/">MCP</a> servers!</p><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li></ul><p>👋</p><p><em>Originally published at </em><a href="https://0xdc.me/blog/creating-a-cursor-workshop-developers-enjoy-doing/"><em>https://0xdc.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41242a2373d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an agentic Slackbot with Claude Code]]></title>
            <link>https://medium.com/@dotdc/building-an-agentic-slackbot-with-claude-code-eba0e472d8f4?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/eba0e472d8f4</guid>
            <category><![CDATA[vertex-ai]]></category>
            <category><![CDATA[slackbot]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Thu, 30 Oct 2025 07:59:21 GMT</pubDate>
            <atom:updated>2025-10-30T09:31:24.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Ymuqi5gJa47IveqaqFFTAw.jpeg" /></figure><h3>Introduction</h3><p>It all started during Hivebrite’s PEAK Days 2025, which took place in mid-September 2025, with a hackathon project to explore “how to leverage AI to accelerate incident management.” We quickly brainstormed how we could make something useful for support and on-call engineers, and we quickly imagined an agentic Slackbot that could use existing code and data to summarize information in real time during incidents.</p><p>Slack was the natural platform for our agent because it’s already our central communication hub during incidents. Bringing contextual knowledge directly into the same conversation where engineers coordinate saves time and keeps everyone aligned.</p><h3><strong>Proof of concept</strong></h3><p>During the hackathon, we started building a prototype using <a href="https://claude.com/product/claude-code">Claude Code</a> at the core of the agent. The idea was to create a Slackbot that could be built locally and deployed using the same Claude Code integration (CLI). Claude Code was already used internally at Hivebrite, but nobody had tried to deploy an application to production with Claude Code at its core. Because Claude Code is portable, we could easily embed it in a container and run it on one of our Kubernetes clusters.</p><p>The proof of concept focused on the most impactful feature: “searching in past incidents (postmortems) and summarizing them automatically”. We experimented with <a href="https://modelcontextprotocol.io/docs/getting-started/intro">MCP</a> servers like the <a href="https://github.com/atlassian/atlassian-mcp-server">Atlassian MCP Server</a> and also tried the <a href="https://docs.datadoghq.com/bits_ai/mcp_server/">Datadog’s MCP Server</a>, which were both in preview at the time.</p><p>Because of time constraints, we heavily relied on <a href="https://cursor.com/">Cursor</a> and Claude Code to generate and iterate features quickly, in other words, we were <a href="https://en.wikipedia.org/wiki/Vibe_coding">vibe coding</a>!</p><p>Earlier this year, I built a Python script to export Datadog Postmortems (Notebooks) to our Atlassian Confluence knowledge base. I did this for two reasons:</p><ul><li>Datadog notebooks weren’t searchable</li><li>We wanted to create a <a href="https://dust.tt/">Dust</a> agent trained on past incidents</li></ul><p>The Slackbot integration was the next logical step, an integrated solution that could build upon existing data to automatically fetch relevant knowledge and insights on past incidents, helping reduce the mean time to recovery (MTTR) for our support and on-call engineers.</p><p>When a new incident is reported, Hive Ix posts a summary message directly in the incident Slack channel with:</p><ul><li>A list of similar past incidents with links to their postmortems</li><li>Key context such as affected systems, root cause, and resolution measures</li><li>Links to relevant documentation or dashboards</li></ul><p>When it came to branding, we initially named it Jeff Jr., a funny character inspired by Jeff, one of our teammates!</p><p>Beyond channel interactions, the agent can also be queried directly via private messages or by mentioning <strong>@Jeff Jr.</strong> anywhere on Slack.</p><h3><strong>Building a production-ready Slackbot</strong></h3><p>Turning this hackathon project into a production-ready application had its own challenges.</p><h4><strong>Bot identity</strong></h4><p>While Jeff Jr. was fun, it had one major design flaw, people would easily <strong>@Jeff</strong> instead of <strong>@Jeff Jr.</strong> on Slack, which, let’s be honest, would have driven the real Jeff crazy!</p><p>So I started thinking about a new name, and considering that two of us on the team were fans of <a href="https://en.wikipedia.org/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy">The Hitchhiker’s Guide to the Galaxy</a>, I decided to name it after <a href="https://en.wikipedia.org/wiki/Ford_Prefect_(character)">Ford Prefect</a>, also known as <strong>Ix</strong>.</p><p>That’s how the bot became <strong>Hive Ix</strong>.</p><p>The initial Jeff Jr. logo was generated from a picture of Jeff using ChatGPT and a dedicated prompt. For Hive Ix, I reused that logo and blended it with an image of <a href="https://en.wikipedia.org/wiki/David_Dixon_(actor)">David Dixon</a>, the actor who played Ford Prefect, until I was satisfied with the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ajRmOxgtsDCMmiHzaTZTaQ.jpeg" /><figcaption>Logo evolution from Jeff Jr. to Hive Ix</figcaption></figure><h4><strong>Reworking the codebase</strong></h4><p>Most of the codebase from the hackathon was a mix of existing code and vibe coding generated code. Needless to say, it wasn’t production-ready!</p><p>Following Cyril’s advice, I moved the entire hackathon project into a <strong>legacy-project/</strong> folder and wrote an architecture document in markdown detailing what the real project should look like. That single step saved us a massive amount of time!</p><p>Instead of rewriting everything from scratch, I used that document as a prompt, describing our desired features, libraries and structure. We included examples of input/output, our preferred Go libraries like <a href="https://github.com/rs/zerolog">rs/zerolog</a> and <a href="https://github.com/spf13/viper">spf13/viper</a>, and even shared a reference project to match the organization, code style, comments and CI/CD pipelines.</p><p>The output was a clean Golang application with less than 2,000 lines, that would be easy to read and consistent with our existing codebases.</p><p>One key learning was the importance of crafting <a href="https://anthropic.mintlify.app/en/docs/build-with-claude/prompt-engineering/use-xml-tags">well-structured XML prompts</a> with examples when working with Claude Code. It ensures consistent responses and makes it easier to control the agent’s behavior.</p><p>While I’ve been using AI coding assistants for a while, this was the first time I almost entirely relied on one to build an application. The amazing part is that it felt more like <a href="https://simonwillison.net/2025/Oct/7/vibe-engineering/">vibe engineering</a> than “vibe coding”. I could take ownership of the resulting codebase right away!</p><h4><strong>Additional Features</strong></h4><p>Beyond summarizing past incidents, I expanded Hive Ix with several non-agentic features to integrate deeper into our ecosystem.</p><p>Building upon my Datadog Python scripts, I added automatic polling of Datadog alerts and vendor status pages, posting updates directly in dedicated Slack channels.</p><p>We already had this data in other forms, but the idea was to offer an all-in-one assistant to centralize insights and help engineers detect and resolve issues faster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*usRO3bBLHIJ60DsjC85e3Q.jpeg" /><figcaption>Hive Ix — Slack Notification on GitHub outage</figcaption></figure><h4><strong>Claude Code and Vertex AI</strong></h4><p>While I was mainly working using Cursor, Claude Code remained the brain of Hive Ix. The application depends on Claude Code for its agentic features and uses <a href="https://docs.claude.com/en/docs/claude-code/mcp">MCP servers</a> alongside our own Python scripts as <a href="https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview">tools</a>.</p><p>Pseudo-code showing how Hive Ix calls Claude Code:</p><pre>// Passing prompt to Claude Code<br>cmd := exec.Command(&quot;claude&quot;, &quot;-p&quot;, prompt)</pre><p>Because we had Google Cloud Platform credits for Vertex AI, we decided to use Claude Code through Vertex AI.</p><p>Anthropic’s Claude models are available in Google Cloud’s <a href="https://console.cloud.google.com/vertex-ai/model-garden">Vertex AI Model Garden</a>, allowing us to use Claude models at a lower cost!</p><p>To enable the model, you must first activate it in the Model Garden as it’s not yet possible through the Terraform provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZvJZUg-CpYMs-11uPcQtA.jpeg" /><figcaption>Enabling Claude Sonnet 4.5 model on GCP Model Garden</figcaption></figure><h4><strong>Kubernetes integration</strong></h4><p>This part was quite straightforward. The Hive Ix repository builds and pushes its Docker image to <a href="https://console.cloud.google.com/artifacts">GCP Artifact Registry</a>. We then created a simple Helm chart to deploy the application on a Kubernetes cluster. The secret and service account were managed through Terraform, using <a href="https://docs.cloud.google.com/kubernetes-engine/docs/concepts/workload-identity">GKE Workload Identity</a> with the (<a href="https://cloud.google.com/vertex-ai/docs/general/access-control#aiplatform.user">roles/aiplatform.user</a>) permission to access Vertex AI.</p><blockquote>ℹ️ Vertex AI APIs must be enabled on your GCP project.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*EBdFS3yY0Y26m3yf_WfY4Q.jpeg" /><figcaption>Hive Ix — Kubernetes Logs</figcaption></figure><h3><strong>What’s Next</strong></h3><p>Hive Ix now serves as a genuinely useful assistant for our support and SRE teams. There are a few areas we plan to improve in the near future, such as refining the summary prompts to produce more consistent and structured outputs (Claude Code loves to elaborate!).</p><p>We also plan to migrate from Atlassian’s MCP Server to our own implementation. This will allow us to plug into our internal Dust agents and extend Hive Ix’s knowledge and capabilities even further!</p><h3>Final words</h3><p>Building Hive Ix was a great way to experiment with <a href="https://claude.ai/code">Claude Code</a>, turning a hackathon idea into a real assistant that helps engineers resolve incidents faster. It showed how AI tools combined with solid engineering practices can accelerate innovation.</p><p>Special thanks to Cyril for the crash course in agentic application design!</p><p>I hope this article gave you useful insights into applying AI to a real-world use case like incident management!</p><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li><li>Twitter : <a href="https://twitter.com/0xDC_">https://twitter.com/0xDC_</a></li></ul><p>👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eba0e472d8f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leverage Grafana annotations]]></title>
            <link>https://medium.com/@dotdc/leverage-grafana-annotations-fafaed599218?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/fafaed599218</guid>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[loki]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Tue, 18 Feb 2025 23:00:08 GMT</pubDate>
            <atom:updated>2025-02-19T07:14:31.397Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAz9sX9nWSvd18wipNWZww.jpeg" /></figure><h3>Introduction</h3><p>Grafana annotations can help you and your team track key events like deployments, incidents, marketing campaigns or planned traffic spikes in your dashboards. In larger teams, not everyone knows what happened and when, annotations make it easy for SREs, QA engineers and developers to correlate graph data points with important events, which makes troubleshooting easier and faster.</p><h3>Prerequisites</h3><p>You’ll need a running Grafana instance with Admin privileges and a service account token with the Editor or Admin role.</p><p>To create a service account, go to: <a href="https://grafana.domain.tld/org/serviceaccounts">https://grafana.domain.tld/org/serviceaccounts</a></p><ul><li>Click on Add service account</li><li>Give the service account a name (e.g. annotations_sa), and the Editor role.</li><li>Create a token using the Add service account token button, then Generate token.</li></ul><p>Save the token somewhere or export it on your terminal:</p><pre>export GRAFANA_TOKEN=glsa_OlX64rUBFgWD0FpwyuZDtvgBGjqWNQQk_aed22945</pre><p>For <a href="https://0xdc.me/blog/leverage-grafana-annotations/#logs-annotations">logs annotations</a>, you’ll also need a running <a href="https://github.com/grafana/loki">Grafana Loki</a> instance.</p><h3>What is an annotation?</h3><blockquote><em>Annotations provide a way to mark points on a visualization with rich events. They are visualized as vertical lines and icons on all graph panels. When you hover over an annotation, you can get event description and event tags. The text field can include links to other systems with more detail.</em></blockquote><blockquote><em>Source: </em><a href="https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/#add-an-annotation"><em>Grafana documentation — Annotate visualizations</em></a></blockquote><h3>Simple annotations</h3><p>Every Grafana dashboard should have a <a href="https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/#built-in-query">built-in query</a> for annotations.</p><p>Here’s the default annotations field from Grafana’s dashboard <a href="https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/">JSON model</a>:</p><pre>{<br>  &quot;annotations&quot;: {<br>    &quot;list&quot;: [<br>      {<br>        &quot;builtIn&quot;: 1,<br>        &quot;datasource&quot;: {<br>          &quot;type&quot;: &quot;grafana&quot;,<br>          &quot;uid&quot;: &quot;-- Grafana --&quot;<br>        },<br>        &quot;enable&quot;: true,<br>        &quot;hide&quot;: true,<br>        &quot;iconColor&quot;: &quot;rgba(0, 211, 255, 1)&quot;,<br>        &quot;name&quot;: &quot;Annotations &amp; Alerts&quot;,<br>        &quot;type&quot;: &quot;dashboard&quot;<br>      }<br>    ]<br>  },</pre><p>The Grafana documentation explain <a href="https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/#add-an-annotation">how to manually add annotations to dashboards</a>.<br>It should work out-of-the-box, as soon as you have the Editor role.</p><h3>Custom annotations</h3><p>Being able to annotate dashboards is nice, but you can also configure your Grafana dashboards to display annotations with custom tags. If you manage dashboards, you can configure them to have extra annotations source.</p><p>For example, here’s a JSON model with a custom terraform tag as an annotation source:</p><pre>{<br>  &quot;annotations&quot;: {<br>    &quot;list&quot;: [<br>      {<br>        // Removed for readability<br>      },<br>      {<br>        &quot;datasource&quot;: {<br>          &quot;type&quot;: &quot;datasource&quot;,<br>          &quot;uid&quot;: &quot;grafana&quot;<br>        },<br>        &quot;enable&quot;: true,<br>        &quot;hide&quot;: false,<br>        &quot;iconColor&quot;: &quot;#5c4ee5&quot;,<br>        &quot;name&quot;: &quot;terraform&quot;,<br>        &quot;target&quot;: {<br>          &quot;limit&quot;: 100,<br>          &quot;matchAny&quot;: false,<br>          &quot;tags&quot;: [<br>            &quot;terraform&quot;<br>          ],<br>          &quot;type&quot;: &quot;tags&quot;<br>        }<br>      },</pre><p>To create your own, open a Grafana dashboard, then click on: Edit &gt; Settings &gt; Annotations &gt; New query.</p><p>On the form, make sure to select -- Grafana -- as the data source, and to filter by Tags.<br>Feel free to configure everything else to fit your needs.</p><p>If running on a Kubernetes cluster, expose the Grafana service on a terminal:</p><pre>kubectl port-forward svc/kube-prometheus-stack-grafana -n monitoring 3000:80</pre><p>Then send an annotation to Grafana using curl:</p><pre>export GRAFANA_TOKEN=&quot;glsa_OlX64rUBFgWD0FpwyuZDtvgBGjqWNQQk_aed22945&quot;<br><br># Send an annotation to Grafana<br>curl -X POST http://localhost:3000/api/annotations \<br>  -H &quot;Authorization: Bearer ${GRAFANA_TOKEN}&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>  &quot;time&quot;: &#39;$(date +%s%3N)&#39;,<br>  &quot;tags&quot;: [&quot;terraform&quot;],<br>  &quot;text&quot;: &quot;event=terraform-apply, stack=istio, env=dev&quot;,<br>  &quot;isRegion&quot;: false<br>}&#39;basb</pre><p>You should now see the custom annotation in your dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*qN03n-yzUAELC3BDXUxd2Q.png" /><figcaption>Screenshot: Custom Grafana annotation.</figcaption></figure><h3>Region annotations</h3><p>Region annotations are similar, but they have a start time and end time to define a region.<br>You can set the start time with time and the end time with timeEnd:</p><pre>export GRAFANA_TOKEN=&quot;glsa_OlX64rUBFgWD0FpwyuZDtvgBGjqWNQQk_aed22945&quot;<br><br># Send a region annotation to Grafana<br>curl -X POST http://localhost:3000/api/annotations \<br>  -H &quot;Authorization: Bearer ${GRAFANA_TOKEN}&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>  &quot;time&quot;: &#39;$(date +%s%3N -d &quot;10 minutes ago&quot;)&#39;,<br>  &quot;timeEnd&quot;: &#39;$(date +%s%3N)&#39;,<br>  &quot;tags&quot;: [&quot;oncall&quot;],<br>  &quot;text&quot;: &quot;event=oncall, alert_name=High5xxErrors, app=rise-back env=prod&quot;,<br>  &quot;isRegion&quot;: true<br>}&#39;</pre><p>Here’s how a region annotation should look like in your dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*54MJnwDyP8uHnpcUOj7qkg.png" /><figcaption>Screenshot: Region Grafana annotation.</figcaption></figure><h3>Logs annotations</h3><p>Instead of relying on internal Grafana annotations, you can also use another datasource to display annotations.<br>We’ll use Grafana Loki.</p><p>To do this, open a Grafana dashboard, then click on: Edit &gt; Settings &gt; Annotations &gt; New query.<br>On the form, make sure to select a working Loki data source and set a &#39;Query&#39; for your annotation logs.<br>We&#39;ll use: {job=&quot;grafana-annotations&quot;}.</p><p>Upon save, you should see the following in your dashboard JSON model:</p><pre>{<br>  &quot;annotations&quot;: {<br>    &quot;list&quot;: [<br>      {<br>        // Removed for readability<br>      },<br>      {<br>        &quot;datasource&quot;: {<br>          &quot;type&quot;: &quot;loki&quot;,<br>          &quot;uid&quot;: &quot;P8E80F9AEF21F6940&quot;<br>        },<br>        &quot;enable&quot;: true,<br>        &quot;expr&quot;: &quot;{job=\&quot;grafana-annotations\&quot;}&quot;,<br>        &quot;hide&quot;: false,<br>        &quot;iconColor&quot;: &quot;orange&quot;,<br>        &quot;instant&quot;: false,<br>        &quot;name&quot;: &quot;Loki Annotations&quot;<br>      }<br>    ]</pre><p>Since UIDs are tied to a specific Grafana instance, it’s recommended to create a dashboard variable instead.</p><p>To do so, open a Grafana dashboard, then click on: Edit &gt; Settings &gt; Variables &gt; New variable.<br>On the form, make sure you set &#39;Select variable type&#39; to Data source, and data source &#39;Type&#39; to Loki.</p><p>Upon save, you should see the following variable in your dashboard JSON model:</p><pre>{<br>  &quot;templating&quot;: {<br>    &quot;list&quot;: [<br>      {<br>        &quot;current&quot;: {},<br>        &quot;name&quot;: &quot;datasource_loki&quot;,<br>        &quot;options&quot;: [],<br>        &quot;query&quot;: &quot;loki&quot;,<br>        &quot;refresh&quot;: 1,<br>        &quot;regex&quot;: &quot;&quot;,<br>        &quot;type&quot;: &quot;datasource&quot;<br>      }<br>    ]<br>  },</pre><p>You can then update the Loki uid field to use the ${datasource_loki} variable in annotations:</p><pre>{<br>  &quot;annotations&quot;: {<br>    &quot;list&quot;: [<br>      {<br>        // Removed for readability<br>      },<br>      {<br>        &quot;datasource&quot;: {<br>          &quot;type&quot;: &quot;loki&quot;,<br>          &quot;uid&quot;: &quot;${datasource_loki}&quot;<br>        },<br>        &quot;enable&quot;: true,<br>        &quot;expr&quot;: &quot;{job=\&quot;grafana-annotations\&quot;}&quot;,<br>        &quot;hide&quot;: false,<br>        &quot;iconColor&quot;: &quot;orange&quot;,<br>        &quot;instant&quot;: false,<br>        &quot;name&quot;: &quot;Loki Annotations&quot;<br>      }<br>    ]</pre><p>If running on a Kubernetes cluster, expose your Loki service on a terminal:</p><pre># Expose the Loki service if running on a Kubernetes cluster<br>kubectl port-forward svc/loki-gateway -n monitoring 3100:80</pre><p>Then send an annotation log to Loki using curl:</p><pre># Send a log to Grafana Loki<br>curl -X POST http://localhost:3100/loki/api/v1/push \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>    &quot;streams&quot;: [<br>      {<br>        &quot;stream&quot;: {<br>          &quot;job&quot;: &quot;grafana-annotations&quot;,<br>          &quot;env&quot;: &quot;dev&quot;,<br>          &quot;stack&quot;: &quot;loki&quot;<br>        },<br>        &quot;values&quot;: [<br>          [&quot;&#39;&quot;$(date +%s%N)&quot;&#39;&quot;, &quot;[INFO] Just another annotation sent to Loki&quot;]<br>        ]<br>      }<br>    ]<br>  }&#39;</pre><p>You should now see the annotation from your Loki logs on your dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*m_kEFOy5BITUvaR1A67wmA.png" /><figcaption>Screenshot: Grafana annotation from Loki logs.</figcaption></figure><h3>Conclusion</h3><p>Whether you’re tracking deployments, incidents or other important events, Grafana annotations provide an efficient way to correlate events with dashboard data. You can customize and automate annotations for events that matter to you, such as: pull request merges, Terraform apply operations or email campaign launches. Leveraging Grafana annotations will make troubleshooting on Grafana easier and faster!</p><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li><li>Mastodon : <a href="https://hachyderm.io/@0xDC">https://hachyderm.io/@0xDC</a></li><li>Twitter : <a href="https://twitter.com/0xDC_">https://twitter.com/0xDC_</a></li></ul><p>👋</p><p><em>Originally published at </em><a href="https://0xdc.me/blog/leverage-grafana-annotations/"><em>https://0xdc.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fafaed599218" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Favorite books on my 2024 reading list]]></title>
            <link>https://medium.com/@dotdc/favorite-books-on-my-2024-reading-list-736f55efccd8?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/736f55efccd8</guid>
            <category><![CDATA[books]]></category>
            <category><![CDATA[book-recommendations]]></category>
            <category><![CDATA[book-review]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Sun, 19 Jan 2025 13:43:53 GMT</pubDate>
            <atom:updated>2025-01-19T13:43:53.335Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gpmuBvNzQxkGHy7HxwBKA.jpeg" /></figure><p>This article features my favorite tech or work-related reads from 2024.</p><h3>The Culture Map</h3><p>Author: <a href="https://x.com/erinmeyerinsead">Erin Meyer</a><br>Publish Date: May 27, 2014</p><p>I have been working with multicultural teams for the past few years, and I was curious to see how this book could improve my understanding of cultural differences and enhance my communication skills in such teams. I was happily surprised and learned a lot from the concepts described in the book!</p><p>The book defines and explores the following aspects of cultural differences:</p><ul><li>Communicating: low-context vs. high-context communication</li><li>Evaluating: direct negative feedback vs. indirect negative feedback</li><li>Persuading: principles-first vs. applications-first approaches</li><li>Leading: egalitarian vs. hierarchical leadership styles</li><li>Deciding: consensual vs. top-down decision-making</li><li>Trusting: task-based vs. relationship-based trust</li><li>Disagreeing: confrontational vs. non-confrontational approaches</li><li>Scheduling: linear-time vs. flexible-time approaches</li></ul><p>I highly recommend this book to anyone seeking to improve their understanding of cultural differences and how they influence teamwork, communication and leadership.</p><p>Favorite Quote:</p><blockquote><em>“Speaking of cultural differences leads us to stereotype and therefore put individuals in boxes with ‘general traits.’ Instead of talking about culture, it is important to judge people as individuals, not just products of their environment.” p.13</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DlxdufMTzTrG-4yC-Whv-Q.jpeg" /><figcaption>Book: The Culture Map</figcaption></figure><h3>Where Wizards Stay Up Late</h3><p>Authors: <a href="https://x.com/katiehafner">Katie Hafner</a> and Matthew Lyon<br>Publish Date: January 21, 1998</p><p>The book is about the bold, visionary, and fascinating history of the creation of the internet! It covers the people, events, decisions and work which contributed to the development of what we now call the internet. It is full of details and amazing anecdotes, such as the creation of the Interface Message Processor (IMP), the first Request for Comments (RFC), the use of the “@” symbol in email addresses and much more!</p><p>I highly recommend it to anyone interested in the history of computing and the origins of the internet.</p><p>Favorite Quote:</p><blockquote><em>“I decided it was worth the risk to spend $25,000 on an unknown machine for an unknown purpose” p.84</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TJaxiWX9svC3IwCUKmFE2Q.jpeg" /><figcaption>Book: Where Wizards Stay Up Late</figcaption></figure><h3>Géopolitique du numérique : l’impérialisme à pas de géants</h3><p>Author: <a href="https://www.linkedin.com/in/ophelie-coelho">Ophélie Coelho</a><br>Publish Date: January 21, 1998</p><p>The title of this book can be translated to “Geopolitics of the digital world: imperialism in giant leaps.” The book explains how Big Tech has taken control of the digital world, building modern empires and managing critical internet infrastructure.</p><p>I like the analyses and insights provided by this book, especially around internet infrastructure like the submarine cable map and their owners. Although the book was published very recently, things are going so fast that it already lacks at least two chapters. For instance, Silicon Valley is changing, and the impact of generative AI is yet to come. Big Tech is also preparing for the future: <a href="https://www.technologyreview.com/2024/09/26/1104516/three-mile-island-microsoft/">Microsoft is about to restart Three Mile Island</a>, <a href="https://blog.google/outreach-initiatives/sustainability/google-kairos-power-nuclear-energy-agreement/">Google is betting on small modular reactors</a> (SMR), and <a href="https://heatmap.news/technology/amazon-x-energy-nuclear-deal">Amazon is doing the same thing</a>.</p><p>I’m curious to see how things will evolve in the coming years!</p><p>Favorite Quote (translated):</p><blockquote><em>“In France, all the presidents of the Fifth Republic have faced this issue, each with their own technological mascot: De Gaulle and Pompidou with the giant computers of the ‘Plan Calcul’, Giscard d’Estaing with the </em><a href="https://en.wikipedia.org/wiki/Minitel"><em>Minitel</em></a><em>, Mitterrand with computing in schools, Chirac with broadband, Sarkozy with the iPad, Hollande with the ‘Grande École du Numérique,’ and Macron with the ‘Start-up Nation’. Most of these initiatives ended in failures that were more or less significant.” p.126</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-UPEXiLbE_oyLoS2Jteyg.jpeg" /><figcaption>Book: Géopolitique du numérique : l’impérialisme à pas de géants</figcaption></figure><h3>Chevaliers d’Internet et pirates informatiques</h3><p>Authors: Yoann Vandoorselaere, <a href="https://www.linkedin.com/in/langlois">Philippe Langlois</a>, Alexandre Golovanivsky<br>Publish Date: March 23, 1999</p><p>I came across this book while visiting <a href="https://www.texplained.com/">Texplained</a> offices, and was curious enough to pick up a copy. The book title can be translated to “Knights of the Internet and computer hackers”, it covers the authors’ stories, sharing their passion, motivations and reflections on their hacking activities. Throughout the book, you’ll read about <a href="https://en.wikipedia.org/wiki/World-NET">World-NET</a>, the <a href="https://www.2600.com/">2600: The Hacker Quarterly</a> meetings, the “ <a href="https://en.wikipedia.org/wiki/Kevin_Mitnick">Free Kevin</a> “ movement and much more from that era!</p><p>Reading this book felt like traveling back in time.</p><p>Favorite Quote #1 (translated):</p><blockquote><em>“The elders know that the boundaries between good and evil are not as clear-cut as one might utopically believe in the beginning.” p.154</em></blockquote><p>Favorite Quote #2 (translated):</p><blockquote><em>“To “set an example”, the two malicious students spent seven days in prison for “theft of electrical energy and machine time”!!” p.159</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mDSmurre9ZAMF8HWHiNmgA.jpeg" /><figcaption>Book: Chevaliers d’Internet et pirates informatiques</figcaption></figure><h3>Hackers: Heroes of the Computer Revolution</h3><p>Author: <a href="https://x.com/StevenLevy">Steven Levy</a><br>Publish Date: 1984</p><p>It felt very special to finally read this book, which had been on my family’s bookshelf throughout my childhood. It covers the rise of hackers, programmers and hardware engineers who shaped computing culture and technology from the 1950s to the 1980s.</p><p>While the entire book is a delight, the “Game Hackers” section especially resonated with me. As an adventure game enthusiast and longtime <a href="https://en.wikipedia.org/wiki/Sierra_Entertainment">Sierra On-Line</a> fan, reading the wild stories from the early days was absolutely mind-blowing! The industry was so different back then! Now, I’m thrilled to dive into the full story in <a href="https://kensbook.com/">Not All Fairy Tales Have Happy Endings</a>!</p><p>A must-read!</p><p>Favorite Quote #1:</p><blockquote><em>“If you try a few times and give up, you’ll never get there. But if you keep at it&amp;mldr; There’s a lot of problems in the world which can really be solved by applying two or three times the persistence that other people will.” p.83</em></blockquote><p>Favorite Quote #2:</p><blockquote><em>“The computer is a magic box. It’s a tool. It’s an art form. It’s the ultimate martial art&amp;mldr; There’s no bullshit in there. Without truth, the computer won’t work. You can’t bullshit a computer, God damn it, the bit is there or the bit ain’t there.” p.184</em></blockquote><p>Does any of these books resonate with you?</p><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li><li>Mastodon : <a href="https://hachyderm.io/@0xDC">https://hachyderm.io/@0xDC</a></li><li>Twitter : <a href="https://twitter.com/0xDC_">https://twitter.com/0xDC_</a></li></ul><p>👋</p><p><em>Originally published at </em><a href="https://0xdc.me/blog/favorite-books-on-my-2024-reading-list/"><em>https://0xdc.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=736f55efccd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Terraflow, a CI/CD orchestrator to scale Terraform]]></title>
            <link>https://medium.com/@dotdc/creating-terraflow-a-ci-cd-orchestrator-to-scale-terraform-3965b3f8931f?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/3965b3f8931f</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[terragrunt]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Wed, 30 Oct 2024 15:35:36 GMT</pubDate>
            <atom:updated>2024-12-03T12:06:12.392Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EAjLoi9ljs27_TkdbJL_Pw.png" /></figure><p><strong>Introduction</strong></p><p>Managing Terraform and Terragrunt at scale can be challenging! My team was spending much time identifying affected stacks and dealing with plan and apply processes, leading to increased drift risks. Existing solutions like Atlantis, Digger, and Spacelift didn’t fully meet our needs, so we decided to build our own! This article details why and how we developed Terraflow to have stack detection, manage dependencies, and simplify our deployment workflows.</p><p>Some refer to tools like Terraflow as <a href="https://itnext.io/spice-up-your-infrastructure-as-code-with-tacos-1a9c179e0783">TACOS</a>, which stands for Terraform Automation and Collaboration Software. TACOS frameworks are designed specifically to tackle the challenges of operating IaC at scale by streamlining automation, collaboration, and control across infrastructure deployments.</p><p><strong>Context</strong></p><p>At <a href="https://hivebrite.io/">Hivebrite</a>, we have a moderately big monorepo which contains IaC templates, Terraform modules, Terraform models (profiles), and Terragrunt stacks. When making changes to this repository, everyone has to manually identify the affected stacks and then run the plan and apply operations. The scale and complexity make it really hard to not generate drift between the desired state and the live platforms.</p><p>Additionally, our Terragrunt operations are wrapped with a custom Makefile, which is responsible for starting a pre-configured container that contains all the necessary binaries, Terraform providers, observability plugins, and audit logs. This greatly reduces compatibility with existing “at scale” Terraform solutions.</p><p><strong>Tool comparison</strong></p><p>In order to suit our needs, we’ve primarily focused on open-source options but also decided to include one enterprise solution for comparison. This is not an exhaustive comparison, as there are many more tools such as <a href="https://terrateam.io/">Terrateam</a>, <a href="https://www.scalr.com/">Scalr</a>, <a href="https://www.hashicorp.com/products/terraform/pricing">Terraform Cloud</a>, <a href="https://www.env0.com/">Env0</a>…</p><p><strong>TL;DR</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vve6SUC4_td8AA2K" /></figure><p><strong>Atlantis</strong></p><p><a href="https://github.com/runatlantis/atlantis">Atlantis</a> is the most used open-source pull request automation tool for Terraform. It has support for Terragrunt and custom plan/apply scope, but still lacks drift detection. The main concern we had was the fact that it doesn’t have stack detection, which means no way to detect which stacks need to be updated when we make changes in our Terraform modules and models.</p><p><strong>Digger</strong></p><p><a href="https://github.com/diggerhq/digger">Digger</a> is an open-source Terraform orchestration tool for teams. It was <a href="https://github.com/diggerhq/digger/commit/985690d44ea3f4358c0d03b518c2f6db6f470ccd">originally written in Python</a>, but they quickly <a href="https://github.com/diggerhq/digger/commit/6791d0f827bc0ebff77dd8ebe1df9605da917cea">switched to Golang</a>. It supports Terragrunt and has Drift Detection on its paid offering, but it currently lacks support for custom plan/apply scope. Like Atlantis, Digger cannot detect which stacks need to be updated when we make changes in our Terraform modules and models. The Slack integration is not completely done, but they’re working on getting it right. They also have several paid plans that seem way cheaper than their competitors.</p><p>Good to know, all their offerings have no limits on private runners, resources under management or concurrency!</p><p><strong>Spacelift</strong></p><p><a href="https://spacelift.io/">Spacelift</a> is “The Most Flexible IaC Management Platform, and a sophisticated CI/CD platform for OpenTofu, Terraform, Terragrunt, CloudFormation, Pulumi, Kubernetes, and Ansible”.</p><p>It is a commercial solution with the opinionated approach that <a href="https://medium.com/spacelift/why-you-shouldnt-manage-terraform-with-generic-ci-cd-tools-4dd874ca7096">you shouldn’t manage Terraform with generic CI/CD tools</a>.</p><p>While they have a great product and most features we needed, the pricing model based on the number of concurrent workers was a huge blocker. You don’t pay for what you use, but for the maximum concurrent parallel workers you need!</p><p><strong>Making a choice</strong></p><p>All projects were actively developed and had a large or large enough community to engage with. Considering all the pros and cons, we decided to solve the problem ourselves!</p><p>The reasons behind this decision was mainly tied to:</p><ul><li><strong>Time:</strong> we believe it’s quicker to build a custom solution to solve this problem than what it would take to adopt, and contribute the missing part on an existing project. Also, this gives us the luxury to choose the interface.</li><li><strong>Reduced Risk:</strong> due to the custom nature of our repository, nothing guarantees that we would be able to merge our specific use-case in an upstream project.</li><li><strong>Quality:</strong> better integration with our existing code, we don’t need to adapt or change what we already have, just build an additional wrapper around it.</li><li><strong>Knowledge:</strong> baking a custom solution gives us a better understanding of how things work.</li></ul><p><strong>Creating Terraflow</strong></p><blockquote>Terraflow is an internal, non-open-source tool. While much of this article is based on it, some details have been modified to simplify examples and protect sensitive company information.</blockquote><p>The project started as a proof of concept to address our specific IaC needs. It quickly gained traction within the team, evolving into a widely-used solution. The name “Terraflow” was chosen by the team after several ideas were proposed. With the help of generative AI, we managed to create a visual identity for Terraflow in no time using <a href="http://artguru.ai/">Artguru.ai</a> to generate a dinosaur, <a href="https://www.textstudio.com/logo/oreo-text-effect-1712">TextStudio</a> for the Oreo style title.</p><p>I began identifying the essential features we needed, along with additional nice-to-haves. Once prioritized, I organized them into a release plan that provided a logical development path.</p><p>Desired features:</p><ul><li>Parallel Execution</li><li>GitHub Integration</li><li>Terragrunt Support</li><li>Drift Detection</li><li>PR Stack Detection (blast radius of a change)</li><li>Custom plan/apply scope</li><li>Custom Commands Support</li><li>Dependency tree</li><li>Slack integration</li><li>Ease of use (stack detection, rollout, logs, summary…)</li></ul><p>I won’t cover everything in this article because there’s too much to cover, but I’ll go through the most interesting parts.</p><p><strong>Workflow</strong></p><p>Terraflow runs within our CI/CD pipelines and when a new GitHub Pull Request is opened, we want to have the ability to see which stacks are affected by a particular change. We also want to have an easy way to do plan and apply commands on these affected stacks.</p><p>Here’s the basic workflow:</p><ol><li>Open a GitHub pull request</li><li>Stack detection will give you the list of affected stacks and commands to apply.</li><li>Run commands manually or using predefined GitHub labels on the GitHub pull request.</li><li>Merge the GitHub pull request</li></ol><p><strong>Stack detection</strong></p><p>What we call stack detection is the static analysis of our change and repository in order to have the list of stacks affected by our change on a pull request. The first step is to get the list of changed files between the current commit (HEAD) of the pull request’s branch and the master branch. To do that, we’re using the <strong>git diff — name-only master…HEAD</strong> command.</p><p>For reference, here’s the repository architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*UhEggEWcwKIaIX_j" /></figure><p>For each file, we check to which part it belongs (stacks, models, modules, secrets, other), then make a recursive static analysis of the repository to see which stacks can be affected by this file.</p><p>While we iterate over changed files, we fill a <strong>PROJECTS</strong> array with the affected stacks per environment.</p><ul><li>For each <strong>secrets</strong>, we check by which <strong>modules</strong> and <strong>models</strong> it is used.</li><li>For each <strong>modules</strong> and <strong>models</strong>, we check by which <strong>modules</strong>, <strong>models</strong> and <strong>stacks</strong> they are used.</li><li>For each <strong>stacks</strong>, we append it to the list.</li><li>All other files are generally excluded from the stack detection.</li></ul><p>Stack detection example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/0*l9UqOBJY5sODc5ML" /></figure><p>Or when there’s no affected stack by a change:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/0*mgD274uKt0pEOlBU" /></figure><p><strong>Dependency tree</strong></p><p>When changes on a pull request affect multiple components, Terraflow ensures they’re applied in the correct order.</p><p>Let’s take this example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/0*OVW3E7gLGVSRxKaY" /></figure><p>If we need to update Kubernetes, Istio, App A and App B at the same time, Terraflow will:</p><ul><li>Apply Kubernetes first, since everything depends on it</li><li>Apply Istio once Kubernetes is ready</li><li>Apply App A and App B in parallel, since Istio is now ready</li></ul><p>This grouping strategy prevents deployment failures and race conditions by ensuring each component has its dependencies properly set up before being deployed.</p><p>To solve this problem, we conducted some research and ultimately found that <a href="https://breakingcode.wordpress.com/2013/03/11/an-example-dependency-resolution-algorithm-in-python/">this article</a> provided valuable insights that greatly assisted us in building our solution.</p><p>To build this dependency tree, Terraflow maintains a table of stacks and their dependencies. It repeatedly scans this table to identify stacks that have no remaining dependencies, which can be safely processed. These independent stacks are moved to a separate group for processing. After each scan, if no stacks can be marked as independent, it indicates a circular dependency exists where stacks are waiting on each other. This process continues until either all stacks are properly grouped or a dependency loop is detected.</p><p><strong>Running commands</strong></p><p>Terraflow takes a different approach than Atlantis and Digger to run commands. Instead of relying on pull request comments, it uses pre-defined GitHub labels to control deployments to specific environments.</p><p>The basic format is <strong>${action}-${env}</strong>, but we have more that are more fine-grained.</p><p>Basic labels:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*2Uuuo5sII-x1c-cz" /></figure><p>While anyone can add labels to a pull request, the apply commands will only run if:</p><ul><li>label starts with <strong>plan-</strong> or <strong>apply-</strong></li><li>it was added by a <a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners">code owner</a>.</li><li>the pull request has at least two approvals.</li></ul><p>Once a label is added to a pull request, Terraflow runs commands in parallel using <a href="https://docs.python.org/3/library/multiprocessing.html">multiprocessing</a> within each execution group to speed up deployment. We initially chose multiprocessing because it was easy to get up and running, and it worked well for most cases.</p><p>However, performance falls short on pull requests with several hundred stacks to apply, so we’re planning to replace it with a fully distributed approach!</p><blockquote>To re-run commands, we can either re-execute a workflow or remove and re-add the desired label.</blockquote><p>Once all the commands have been executed, logs are uploaded to a private S3 bucket and Terraflow will post a summary as a comment on the pull request.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/0*cCfxABEpC74pmvor" /></figure><p>Legend:</p><ul><li>🟢 = resource(s) to add</li><li>🟡 = resource(s) to change</li><li>🔴 = resource(s) to destroy</li><li>oo = Output Only, no change to resource(s) but output(s) have changed.</li><li>🏁 = Icon for the “Result” column</li><li>✅ = Command successful (return code = 0)</li><li>❌ = Command failed (return code &gt;= 1)</li><li>📄 = Icon for the “Logs” column</li></ul><p><strong>merge-apply vs apply-merge</strong></p><p>Terraflow currently only supports the apply-and-merge process because it better suits our needs. We didn’t find any case where it falls short in our use-case, but we might have to adapt in the future.</p><p>If you want to learn more about merge-apply vs apply-merge, I recommend reading <a href="https://itnext.io/pains-in-terraform-collaboration-249a56b4534e">pains in terraform collaboration</a>.</p><p><strong>TL;DR</strong></p><blockquote><em>After the approval, the PR has two more things to finish: merge the code from feature to main branch, and apply the commit to all workspaces. Deciding the order of the two activities is subtle. Neither way feels ideal at a glance:</em></blockquote><blockquote><strong><em>merge-and-apply:</em></strong><em> if we merge the code first to main branch. The new commit on main branch will drive deployment. Given the stateful nature, we should assume a good chance of failure in the apply action. Therefore, we will have to go through the iterative journey along the main branch, via numerous PRs and merges. The main branch in this case is treated like a chatty scratchpad rather than a seriously guarded golden copy.</em></blockquote><blockquote><strong><em>apply-and-merge:</em></strong><em> if we apply the commits from feature branch first, we can take the iterative journey along the feature branch associated with the pull request, which will keep the main branch cleaner. The apply-and-merge approach handles the risks introduced by the stateful nature in an elegant way. However, now awaiting us in the next step is the risk of merge conflict. If merge problems occur, we’d have to go over PR again with unwanted apply actions.</em></blockquote><p><strong>Conclusion</strong></p><p>By building Terraflow, we developed a tool that integrates seamlessly into our workflow, automates stack detection, and manages dependencies efficiently. While it doesn’t aim to match every feature of other tools, Terraflow is purpose-built to meet our specific needs, and that’s exactly what matters for us!</p><p>After using Terraflow for three months, we’ve learned a lot! While I already work with python on scripts and small web projects, it was the biggest project I made in this language and the first time I created a package using <a href="https://github.com/python-poetry/poetry">Poetry</a>. I led the architecture, design, and most of the coding. Now that the tool is fully functional and initial issues are emerging, two additional team members have stepped in to help address these and continue to push Terraflow forward.</p><p>On the technical side, we’re considering switching to <a href="https://developer.hashicorp.com/terraform/tutorials/cli/plan#apply-a-saved-plan">apply using saved plans</a> to make operations safer and faster. We also plan to add <a href="https://www.runatlantis.io/docs/locking.html">PR-level locks</a>, while it hasn’t been a major blocker due to effective team communication, this feature would improve our workflow even further. Although we may adapt Terraflow over time, it has already significantly increased deployment speed and reduced toil, leading to improved team performance.</p><p><strong>Final words</strong></p><p>I hope this article has been helpful and offers insights into tackling similar challenges in your own IaC workflows! If you need something similar, I recommend checking out <a href="https://digger.dev/">Digger</a>! I had a great discussion with their team, they have a great open-source product and their paid offerings are more affordable than the competition!</p><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li><li>Mastodon : <a href="https://hachyderm.io/@0xDC">https://hachyderm.io/@0xDC</a></li><li>Twitter : <a href="https://twitter.com/0xDC_">https://twitter.com/0xDC_</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*sW63xRhX8pENnt58TghqYA.png" /><figcaption>👋</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3965b3f8931f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An updated set of Grafana dashboards for Kubernetes]]></title>
            <link>https://medium.com/@dotdc/an-updated-set-of-grafana-dashboards-for-kubernetes-f5d6e4ff5072?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5d6e4ff5072</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[o11y]]></category>
            <category><![CDATA[grafana]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 19:48:36 GMT</pubDate>
            <atom:updated>2024-12-03T12:07:17.715Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-NaFWwmu2k5PpNd7dwqcCQ.png" /></figure><h3>Introduction</h3><p>Two years ago, I published <a href="https://0xdc.me/blog/a-set-of-modern-grafana-dashboards-for-kubernetes/">A set of modern Grafana dashboards for Kubernetes</a> to share the dashboards I created for Kubernetes with the community. In this article, I’ll provide an update on the project and walk through the main changes that have been made since then.</p><h3>Project’s updates</h3><p>The <a href="https://github.com/dotdc/grafana-dashboards-kubernetes">dotdc/grafana-dashboards-kubernetes</a> project has evolved significantly over the last two years! Following several retweets, both the original article and the project saw a noticeable increase in traffic, which also brought several new contributors. I was surprised to see so many people from all around the world <a href="https://github.com/search?q=dotdc%2Fgrafana-dashboards-kubernetes&amp;type=code">using my dashboards</a> in their home labs or in companies such as Rakuten, Orange, Swisscom, and Nokia. Some projects even directly embedded the dashboards, such as <a href="https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-k8s-stack/hack/sync_grafana_dashboards.py#L48">Victoria Metrics</a>, the <a href="https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/tree/master/blueprints/gke/autopilot/bundle/monitoring/dashboards">GCP Cloud Foundation Fabric</a> and the <a href="https://github.com/microsoft/azure_arc/blob/main/azure_jumpstart_ag/artifacts/monitoring/grafana-cluster-global.json">Microsoft Azure Arc Jumpstart</a>.</p><p>Here are the current project statistics:</p><ul><li>~5 million dashboards downloads (<a href="https://grafana.com/grafana/dashboards/?plcmt=top-nav&amp;cta=downloads&amp;search=dotdc">grafana.com</a> only!)</li><li>2293 GitHub stars</li><li>337 forks</li><li>26 contributors</li></ul><figure><img alt="Star History Chart" src="https://cdn-images-1.medium.com/max/1024/1*JUeRVJdZ2dRnx2igdD9F1w.png" /><figcaption><a href="https://star-history.com/#dotdc/grafana-dashboards-kubernetes">Star History Chart</a></figcaption></figure><h3>Changes</h3><h3>General changes</h3><p>Following community demand, the project now has proper <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/releases">releases</a> that are automatically generated using a semantic releaser, which leverages <a href="https://www.conventionalcommits.org/en/v1.0.0/">conventional commits</a> to create versions following <a href="https://semver.org/">semantic versioning</a>.</p><p>Additionally, all dashboards now include a cluster variable support, which was implemented with a safe and straightforward solution as documented in <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/issues/15">issue #15</a>. This enables users of tools like <a href="https://github.com/thanos-io/thanos">Thanos</a>, <a href="https://github.com/grafana/mimir">Mimir</a>, or any other federated or highly available setups to enjoy enhanced compatibility.</p><p>Furthermore, new panels have been added to visualize CPU throttling across all “views” dashboards.</p><h3>k8s-views-pods.json</h3><p>Building on ideas from <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/issues/21">issue #21</a> and further work, k8s-views-pods.json has received a major update! Among the changes are several new information panels displaying priority class, QoS class, last terminated reason, and last terminated exit code.</p><p>Additionally, two new panels have been added: one compares CPU requests and limits to actual CPU usage, and the other does the same for memory. This helps to better visualize container resource usage and simplifies container sizing.</p><figure><img alt="Screenshot: updated k8s-views-pods.json" src="https://cdn-images-1.medium.com/max/1024/1*ZXPFir9jSSqcs4BGYxM5qA.png" /><figcaption>Screenshot: updated k8s-views-pods.json</figcaption></figure><h3>k8s-addons-prometheus.json</h3><p>The project now includes a dashboard for Prometheus with panels related to Prometheus instances, TSDB, query engine, resources, storage, and network.</p><figure><img alt="Screenshot: k8s-addons-prometheus.json" src="https://cdn-images-1.medium.com/max/1024/1*HmvV8occ8rZzar4NW9bDuw.png" /><figcaption>Screenshot: k8s-addons-prometheus.json</figcaption></figure><h3>k8s-addons-trivy-operator.json</h3><p>The k8s-addons-starboard-operator.json which used the Giant Swarm <a href="https://github.com/giantswarm/starboard-exporter">starboard-exporter</a> has been replaced in favor of k8s-addons-trivy-operator.json, based on metrics from the <a href="https://github.com/aquasecurity/trivy-operator">trivy-operator</a> of Aqua Security.</p><figure><img alt="Screenshot: k8s-addons-trivy-operator.json" src="https://cdn-images-1.medium.com/max/1024/1*Cl-PqPUiXEoS28jX_aoGrA.png" /><figcaption>Screenshot: k8s-addons-trivy-operator.json</figcaption></figure><h3>Changelog</h3><p>k8s-views-global.json:</p><ul><li>added throttled cpu (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/0427a7f1881c10c200173501170c38bac2ba926b">0427a7f</a>)</li><li>added cluster variable (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/3d998472b5ccd9ddcde72e080c9c323be496a752">3d99847</a>)</li></ul><p>k8s-views-namespaces.json:</p><ul><li>added throttled cpu panels (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/dbf01b17628642bda8e02bf9283f95ca2363f79b">dbf01b1</a>)</li><li>ability to filter on a specific deployments, statefulsets or deamonsets (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/d173be73556bc98dc46950aebb2995fdde61be89">d173be7</a>)</li><li>added cluster variable (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/7ac58e53a4a0c2380a504cd233ead36977d18cc2">7ac58e5</a>)</li></ul><p>k8s-views-nodes.json:</p><ul><li>added links from nodes to pods (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/50d1aa6d0c1cffacffdb126b891ab8074af70d9f">50d1aa6</a>)</li><li>added throttled cpu panels (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/d223755205136267557aef67702579c98ba72dd9">d223755</a>)</li></ul><p>k8s-views-pods.json:</p><ul><li>rework the pods dashboard with ideas (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/9d11d498a61fc4155deb7fa35eddcb1554c84e80">9d11d49</a>)</li><li>added throttled cpu panels (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/d223755205136267557aef67702579c98ba72dd9">d223755</a>)</li><li>added links from pods to nodes (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/df42ae511ca17e5667459d5f3bfdd1abed104676">df42ae5</a>)</li><li>added oom and restarts (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/ab6201685e2309b368ab1876a94c84c4f316fb17">ab62016</a>)</li><li>added cluster variable (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/7ac58e53a4a0c2380a504cd233ead36977d18cc2">7ac58e5</a>)</li><li>added multi pod select (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/03281bf6b40cdfdf669f7b0090ea4e30302c28eb">03281bf</a>)</li></ul><p>Other changes:</p><ul><li>Semantic releases (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/b7d3553a34b3742db92cb37b1b094ad1cf2129c6">b7d3553</a>)</li><li>Added ArgoCD deployment (<a href="https://github.com/dotdc/grafana-dashboards-kubernetes/commit/35188264afcf3684d9aa1b19ffadefeb2373e4c4">3518826</a>)</li><li>Many bug fixes and small improvements</li></ul><h3>Final words</h3><p>I hope that this article was useful and that it gave additional information over the <a href="https://0xdc.me/blog/a-set-of-modern-grafana-dashboards-for-kubernetes/">original article</a>!</p><p>It has been truly rewarding to receive <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/issues?q=is%3Aissue+is%3Aclosed">feedback</a>, <a href="https://www.reddit.com/r/kubernetes/comments/1ctwivj/comment/l4f13xy/?utm_source=share&amp;utm_medium=web3x&amp;utm_name=web3xcss&amp;utm_term=1&amp;utm_content=share_button">compliments</a>, <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/issues/107">ideas</a>, and engage in <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/issues/80">technical discussions</a> with the community. This ultimately led me to join the <a href="https://grafana.com/community/champions/">Grafana Champion</a> program. Thank you! ❤️</p><p>Your feedback and suggestions are always welcome, so feel free to contribute to this project:</p><ul><li>Give a <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/stargazers">GitHub ⭐</a> if you like it</li><li>Create an <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/issues">Issue</a> to make a feature request, report a bug or share an idea.</li><li>Create a <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/pulls">Pull Request</a> if you want to share code or anything useful to this project.</li></ul><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li><li>Mastodon : <a href="https://hachyderm.io/@0xDC">https://hachyderm.io/@0xDC</a></li><li>Twitter : <a href="https://twitter.com/0xDC_">https://twitter.com/0xDC_</a></li></ul><p>👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5d6e4ff5072" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git hooks management with pre-commit and lefthook]]></title>
            <link>https://medium.com/@dotdc/git-hooks-management-with-pre-commit-and-lefthook-c2232ecc4c7e?source=rss-dcd0622a4145------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2232ecc4c7e</guid>
            <category><![CDATA[lefthook]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[pre-commit]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[code-quality]]></category>
            <dc:creator><![CDATA[David Calvert]]></dc:creator>
            <pubDate>Wed, 12 Jun 2024 22:07:34 GMT</pubDate>
            <atom:updated>2024-12-03T12:07:41.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4LO3uKHgqFocYvW6nF1Avw.jpeg" /></figure><h3>Introduction</h3><p>In modern software development, maintaining code quality and consistency is important. Unlike other approaches, using git hooks for this matter has the advantage of providing immediate feedback. The <a href="https://github.com/pre-commit/pre-commit">pre-commit</a> and <a href="https://github.com/evilmartians/lefthook">lefthook</a> projects are two popular options for managing git hooks. In this article, I’ll compare their features, ease of use, community support, and performance to help you decide which tool is best suited for your project.</p><h3>TL;DR</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*fnSGYxragRzVLKyJvjt-MA.png" /></figure><h3>Pre-commit</h3><p>Pre-commit is a versatile git hooks manager written in Python and was created in 2014. Its primary goal is to catch and address issues such as missing semicolons, trailing whitespace, and debug statements before code review, allowing reviewers to focus on the architecture and logic of changes. The installation and configuration are designed to be user-friendly, enabling teams to quickly set up and enforce coding standards. Pre-commit supports running various <a href="https://pre-commit.com/#supported-git-hooks">git hooks</a>, commands, and scripts, and provides flexible options for matching and excluding patterns.</p><p>The big advantage of pre-commit is that it allows you to easily create remote hooks, or reuse existing <a href="https://pre-commit.com/hooks.html">community hooks</a>.<br>If you want to see a real-world example, check out the <a href="https://github.com/dotdc/grafana-dashboards-kubernetes/blob/master/.pre-commit-config.yaml">pre-commit configuration</a> on the <a href="https://github.com/dotdc/grafana-dashboards-kubernetes">dotdc/grafana-dashboards-kubernetes</a> project.</p><p>On the downside, pre-commit runs hooks sequentially, which means one hook after another. The lack of option to execute them in parallel can have a significant impact on large repositories. It’s important to keep this in mind for performance considerations, especially when using pre-commit in CI pipelines.</p><p>Here’s an example that illustrates the issue.</p><p>Configuration file:</p><pre># .pre-commit-config.yaml<br>repos:<br>  - repo: local<br>    hooks:<br>      - id: command-1<br>        name: command-1<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br><br>      - id: command-2<br>        name: command-2<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br><br>      - id: command-3<br>        name: command-3<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br><br>      - id: command-4<br>        name: command-4<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system<br><br>      - id: command-5<br>        name: command-5<br>        entry: bash -c &quot;sleep 1&quot;<br>        language: system</pre><p>Execution:</p><pre>$ time pre-commit run<br>command-1................................................................Passed<br>command-2................................................................Passed<br>command-3................................................................Passed<br>command-4................................................................Passed<br>command-5................................................................Passed<br><br>real    0m5.149s<br>user    0m0.101s<br>sys     0m0.050s</pre><p>As we can see, hooks are processed sequentially, leading to increased processing times when multiple hooks are involved.</p><p>For more information on pre-commit, check out <a href="https://pre-commit.com/">https://pre-commit.com</a>.</p><h3>Lefthook</h3><p>Written in Go, lefthook is a powerful git hooks manager that debuted in 2019. Given their shared goals, lefthook and pre-commit share many features. Lefthook also offers straightforward <a href="https://github.com/evilmartians/lefthook/blob/master/docs/install.md">installation</a>, <a href="https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md">configuration</a> and ease of use.</p><p>While lefthook has a beta <a href="https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md#remotes">remotes</a> feature, which enables the use of remote hooks, this capability is currently limited to flat reuse and lacks advanced options for configuring remote hooks. On this point, lefthook is behind pre-commit, which offers configurable remote hooks and a large catalog of <a href="https://pre-commit.com/hooks.html">community hooks</a>.</p><p>On the other hand, lefthook has a significant advantage in performance, especially with its support for concurrent execution. Like pre-commit, hooks run sequentially by default, but you can enable parallel execution using the <a href="https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md#parallel">parallel</a> parameter.</p><p>Let’s adapt the configuration we previously created to lefthook’s format and observe the differences.</p><p>Configuration file:</p><pre># .lefthook.yml<br>pre-commit:<br>  parallel: true<br>  commands:<br>    command-1:<br>      run: sleep 1<br>    command-2:<br>      run: sleep 1<br>    command-3:<br>      run: sleep 1<br>    command-4:<br>      run: sleep 1<br>    command-5:<br>      run: sleep 1</pre><p>Execution:</p><pre>$ time lefthook run pre-commit<br>╭───────────────────────────────────────╮<br>│ 🥊 lefthook v1.6.15  hook: pre-commit │<br>╰───────────────────────────────────────╯<br>sync hooks: ✔️  (pre-commit)<br>┃  command-3 ❯ <br><br>┃  command-2 ❯ <br><br>┃  command-1 ❯ <br><br>┃  command-5 ❯ <br><br>┃  command-4 ❯ <br><br>  ────────────────────────────────────<br>summary: (done in 1.00 seconds)       <br>✔️   command-2<br>✔️   command-3<br>✔️   command-1<br>✔️   command-5<br>✔️   command-4<br><br>real    0m1.016s<br>user    0m0.014s<br>sys     0m0.017s</pre><p>As we can see, lefthook completed the tasks in 1.016s, whereas pre-commit took 5.149s, which highlights lefthook’s faster performance.</p><p>To have more information on lefthook, check out <a href="https://evilmartians.com/opensource/lefthook">https://evilmartians.com/opensource/lefthook</a>.</p><h3>Using both</h3><p>I was curious to see if it was possible to use both simultaneously. I wouldn’t necessarily recommend it, but it can be done with a small trick! If you’re interested, I’ve explained how to do that in the <a href="https://github.com/dotdc/test-lefthook-and-pre-commit">dotdc/test-lefthook-and-pre-commit</a> repository.</p><p>Example:</p><pre>$ time git ci -am&quot;feat: test both&quot;<br>[HOOKS] Running lefthooks hooks<br>╭───────────────────────────────────────╮<br>│ 🥊 lefthook v1.6.15  hook: pre-commit │<br>╰───────────────────────────────────────╯<br>┃  command-5 ❯ <br><br>┃  command-2 ❯ <br><br>┃  command-1 ❯ <br><br>┃  command-4 ❯ <br><br>┃  command-3 ❯ <br><br>  ────────────────────────────────────<br>summary: (done in 1.01 seconds)       <br>✔️   command-5<br>✔️   command-2<br>✔️   command-1<br>✔️   command-4<br>✔️   command-3<br>[HOOKS] Running pre-commit hooks<br>command-1............................................................Passed<br>command-2............................................................Passed<br>command-3............................................................Passed<br>command-4............................................................Passed<br>command-5............................................................Passed<br>[main 35c5dfd] feat: test both<br> 1 file changed, 2 insertions(+), 5 deletions(-)<br><br>real    0m6.308s<br>user    0m0.163s<br>sys     0m0.051s</pre><h3>Final Words</h3><p>In this article, we’ve compared pre-commit and lefthook, two tools designed to streamline git hooks management. Lefthook has better performance due to concurrent execution support, whereas pre-commit offers a smoother start due to its extensive collection of community hooks. Testing both will allow you to find the one that suits your project best, and either choice will be a good one.</p><p>You can follow me <a href="https://medium.com/@dotdc">here on Medium,</a> or on:</p><ul><li>GitHub : <a href="https://github.com/dotdc">https://github.com/dotdc</a></li><li>LinkedIn : <a href="https://www.linkedin.com/in/0xDC">https://www.linkedin.com/in/0xDC</a></li><li>Bluesky : <a href="https://bsky.app/profile/0xdc.me">https://bsky.app/profile/0xdc.me</a></li><li>Mastodon : <a href="https://hachyderm.io/@0xDC">https://hachyderm.io/@0xDC</a></li><li>Twitter : <a href="https://twitter.com/0xDC_">https://twitter.com/0xDC_</a></li></ul><p>👋</p><p><em>Originally published at </em><a href="https://0xdc.me/blog/git-hooks-management-with-pre-commit-and-lefthook/"><em>https://0xdc.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2232ecc4c7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>