<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: incident.io</title>
    <description>The latest articles on DEV Community by incident.io (@incident_io).</description>
    <link>https://dev.to/incident_io</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F831734%2F3a501d42-0c49-47b8-aad7-3684bf2e9457.jpg</url>
      <title>DEV Community: incident.io</title>
      <link>https://dev.to/incident_io</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/incident_io"/>
    <language>en</language>
    <item>
      <title>3 common pitfalls of post-mortems</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Wed, 27 Jul 2022 12:34:33 +0000</pubDate>
      <link>https://dev.to/incident_io/3-common-pitfalls-of-post-mortems-20m0</link>
      <guid>https://dev.to/incident_io/3-common-pitfalls-of-post-mortems-20m0</guid>
      <description>&lt;p&gt;&lt;em&gt;Small confession: we currently use the term 'post-mortem' in incident.io despite preferring the term 'incident debrief'. Unless you have particularly serious incidents, the link to death here really isn't helping anyone. However, we're optimising for familiarity, so we're sticking to the term 'post-mortem' here.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ask any engineer and they'll tell you that a post-mortem is a positive thing (despite the scary name). Being able to reflect on an incident helps us learn from our mistakes and do better next time. Your return only increases when future engineers and decision makers are able to access the record of events.&lt;/p&gt;

&lt;p&gt;However, one does not simply follow a post-mortem guide and reap the benefits; post-mortems are all too easily executed badly.&lt;/p&gt;

&lt;h2&gt;
  
  
  They can waste time
&lt;/h2&gt;

&lt;p&gt;Most obviously, you might not need a post-mortem at all. It's common to skip post-mortems for low-severity incidents, but for one-in-a-million events or those that are out of your control (eg. a &lt;a href="https://incident.io/blog/third-party-outages"&gt;provider is down&lt;/a&gt;), you may want to apply the same rule. The energy invested in preventing the incident can outweigh the pain incurred by the incident itself.&lt;/p&gt;

&lt;p&gt;Secondly, compiling information can take a lot of human time. I've seen engineers spend hours trying to find the exact timestamps, or pour over the best way to describe what happened. There is pressure to fill all the fields in a post-mortem template, otherwise it won't be signed off as "done".&lt;/p&gt;

&lt;p&gt;With proper tooling, automation can be used to compile the important information, freeing up a responder's time for thinking about the important questions like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; What did we learn (eg. we need better observability)?&lt;/li&gt;
&lt;li&gt; What were the mitigators (eg. off-peak timing meant that impact was low)?&lt;/li&gt;
&lt;li&gt; Are there any patterns between this incident and previous incidents (eg. the same service fails easily)?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The discussions might not be helpful
&lt;/h2&gt;

&lt;p&gt;To get the most out of a post-mortem, it's important to establish the level on which an incident is reflected on. The classic gotcha is: contributors assume that the post-mortem is a place to work out how to fix X so that it doesn't happen again. But that would be on the lowest level of reflection - you could also look at how to prevent this &lt;em&gt;class&lt;/em&gt; of incidents, or step back and ask if your existing solution needs a whole re-think. There's no point fixing a leaky sink in a burning building. Your post-mortem should help you discover what the problem really is.&lt;/p&gt;

&lt;p&gt;Post-mortems are meant to be blameless, meaning they focus on &lt;em&gt;how&lt;/em&gt; a mistake was made rather than &lt;em&gt;who&lt;/em&gt; made it. But they can easily get too retrospective, focusing on &lt;em&gt;what could have been&lt;/em&gt; if a decision was made differently. If someone has a bee in their bonnet about how a particular service was built, and that service went down, you'll likely end up with a rant. Post-mortem discussions need steering so they are only looking forward.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nothing changes afterwards
&lt;/h2&gt;

&lt;p&gt;A post-mortem normally results in action points. This is great, but where are these tasks of work meant to lie alongside all the other tickets for this sprint? How do we prioritise them? I've seen entire lists of "Action points" lay dormant in post-mortem documents whilst everyone tries to recover from the incident &lt;em&gt;and&lt;/em&gt; pick up everything else they were meant to get done. Just like any planning meeting, action points should be drawn up into an issue tracker like Linear/Jira, and ongoing work should be re-prioritised if needs be.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some final words
&lt;/h2&gt;

&lt;p&gt;Given the negative tone of most of this, I'll have to round off by reiterating that I do find post-mortems incredibly useful. When the laboursome bits are automated, the discussion is steered, and action points are seamlessly plugged into a team's roadmap, what you have left is a brainstorming session on a tricky problem. And that'll take any engineer's fancy.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Tracing Gorm queries with OpenCensus &amp; Google Cloud Tracing</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Thu, 07 Jul 2022 14:37:00 +0000</pubDate>
      <link>https://dev.to/incident_io/tracing-gorm-queries-with-opencensus-google-cloud-tracing-3l0k</link>
      <guid>https://dev.to/incident_io/tracing-gorm-queries-with-opencensus-google-cloud-tracing-3l0k</guid>
      <description>&lt;p&gt;At &lt;a href="http://incident.io/" rel="noopener noreferrer"&gt;incident.io&lt;/a&gt; we use &lt;a href="http://gorm.io/" rel="noopener noreferrer"&gt;gorm.io&lt;/a&gt; as the ORM library for our Postgres database, it's a really powerful tool and one I'm very glad for after years of working with hand-rolled SQL in Go &amp;amp; Postgres apps. You may have seen from our &lt;a href="https://incident.io/blog/tracing" rel="noopener noreferrer"&gt;other blog posts&lt;/a&gt; that we're heavily invested in tracing, specifically with Google Cloud Tracing via &lt;a href="https://opencensus.io/" rel="noopener noreferrer"&gt;OpenCensus&lt;/a&gt; libraries. A huge amount of our application's time is spent talking to Postgres through gorm, so we wanted to get a better view of that in our tracing stack.&lt;/p&gt;

&lt;p&gt;Luckily Gorm has perfect hooks for us to pull tracing out of through the &lt;a href="https://gorm.io/docs/write_plugins.html#Callbacks" rel="noopener noreferrer"&gt;Callbacks API&lt;/a&gt;, this allows us to provide Gorm with functions that get called at specific parts of the query lifecycle, either allowing you to change query behaviour in a traditional middleware approach, or in our case, pull out data for observability.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func beforeQuery(scope *gorm.DB) {
    // do stuff!
}

db.Callback().
    Create().
    Before("gorm:query").
    Register("instrumentation:before_query", beforeQuery)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our goal in this post is to introduce tracing spans to our Gorm queries, in order to do that we need to catch both the start and end events, and deal with the spans accordingly. In these examples I'm going to be using the tracing tools provided by &lt;a href="http://go.opencensus.io/trace" rel="noopener noreferrer"&gt;go.opencensus.io/trace&lt;/a&gt; which feeds into Google Cloud Tracing, but other tracing libraries should behave similarly.&lt;/p&gt;

&lt;p&gt;Now we have a function called when a query starts, we need to begin our span:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func beforeQuery(scope *gorm.DB) {
    db.Statement.Context = startTrace(
    db.Statement.Context,
    db,
    operation,
  )
}

func startTrace(
  ctx context.Context,
  db *gorm.DB,
) context.Context {
    // Don't trace queries if they don't have a parent span.
    if span := trace.FromContext(ctx); span == nil {
        return ctx
    }

    ctx, span := trace.StartSpan(ctx, "gorm.query")
    return ctx
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then we need to end the span too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func afterQuery(scope *gorm.DB) { endTrace(scope) }

func endTrace(db *gorm.DB) {
    span := trace.FromContext(db.Statement.Context)
    if span == nil || !span.IsRecordingEvents() {
        return
    }

    var status trace.Status

    if db.Error != nil {
        err := db.Error
        if err == gorm.ErrRecordNotFound {
            status.Code = trace.StatusCodeNotFound
        } else {
            status.Code = trace.StatusCodeUnknown
        }

        status.Message = err.Error()
    }
    span.SetStatus(status)
    span.End()
}

db.Callback().
    Query().
    After("gorm:query").
    Register("instrumentation:after_query", afterQuery)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can see all of our gorm queries in our traces, nice!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fincident.io%2Fstatic%2F44b33b9cf0a5103364b2c3032213483f%2F74cfa%2Ftraces-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fincident.io%2Fstatic%2F44b33b9cf0a5103364b2c3032213483f%2F74cfa%2Ftraces-1.png" title="some gorm traces" alt="some gorm traces"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However they're not super clear about what we're actually doing, let's see if we can make these spans a little more informative, by adding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  table name &amp;amp; query fingerprint¹ to the span name.&lt;/li&gt;
&lt;li&gt;  the line of code that called us&lt;/li&gt;
&lt;li&gt;  the WHERE params from select queries&lt;/li&gt;
&lt;li&gt;  number of rows affected&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;¹ A query fingerprint is a unique identifier for a query regardless of formatting &amp;amp; variables, so you can uniquely identify queries that will behave the same in your database.&lt;/p&gt;

&lt;p&gt;let's extend our code from earlier:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func startTrace(ctx context.Context, db *gorm.DB) context.Context {
    // Don't trace queries if they don't have a parent span.
    if span := trace.FromContext(ctx); span == nil {
        return ctx
    }

    // start the span
    ctx, span := trace.StartSpan(ctx, fmt.Sprintf("gorm.query.%s", db.Statement.Table))

    // set the caller of the gorm query, so we know where in the codebase the
    // query originated.
    //
    // walk up the call stack looking for the line of code that called us. but
    // give up if it's more than 20 steps, and skip the first 5 as they're all
    // gorm anyway
    var (
        file string
        line int
    )
    for n := 5; n &amp;lt; 20; n++ {
        _, file, line, _ = runtime.Caller(n)
        if strings.Contains(file, "/gorm.io/") {
            // skip any helper code and go further up the call stack
            continue
        }
        break
    }
    span.AddAttributes(trace.StringAttribute("caller", fmt.Sprintf("%s:%v", file, line)))

    // add the primary table to the span metadata
    span.AddAttributes(trace.StringAttribute("gorm.table", db.Statement.Table))
    return ctx
}

func endTrace(db *gorm.DB) {
    // get the span from the context
    span := trace.FromContext(db.Statement.Context)
    if span == nil || !span.IsRecordingEvents() {
        return
    }

    // set the span status, so we know if the query was successful
    var status trace.Status
    if db.Error != nil {
        err := db.Error
        if err == gorm.ErrRecordNotFound {
            status.Code = trace.StatusCodeNotFound
        } else {
            status.Code = trace.StatusCodeUnknown
        }

        status.Message = err.Error()
    }
    span.SetStatus(status)

    // add the number of affected rows &amp;amp; query string to the span metadata
    span.AddAttributes(
        trace.Int64Attribute("gorm.rows_affected", db.Statement.RowsAffected),
        trace.StringAttribute("gorm.query", db.Statement.SQL.String()),
    )
    // Query fingerprint provided by github.com/pganalyze/pg_query_go
    fingerprint, err := pg_query.Fingerprint(db.Statement.SQL.String())
    if err != nil {
        fingerprint = "unknown"
    }

    // Rename the span with the fingerprint, as the DB handle
    // doesn't have SQL to fingerprint before being executed
    span.SetName(fmt.Sprintf("gorm.query.%s.%s", db.Statement.Table, fingerprint))

    // finally end the span
    span.End()
}

func afterQuery(scope *gorm.DB) {
    // now in afterQuery we can add query vars to the span metadata
    // we do this in afterQuery rather than the trace functions so we
    // can re-use the traces for non-select cases where we wouldn't want
    // to record the vars as they may contain sensitive data

    // first we extract the vars from the query &amp;amp; map them into a
  // human readable format
    fieldStrings := []string{}
    if scope.Statement != nil {
        fieldStrings = lo.Map(scope.Statement.Vars, func(v any i int) string {
            return fmt.Sprintf("($%v = %v)", i+1, v)
        })
    }
    // then add the vars to the span metadata
    span := trace.FromContext(scope.Statement.Context)
    if span != nil &amp;amp;&amp;amp; span.IsRecordingEvents() {
        span.AddAttributes(
            trace.StringAttribute("gorm.query.vars", strings.Join(fieldStrings, ", ")),
        )
    }
    endTrace(scope)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now we end up with super rich easy to scan spans, making it much easier to understand what our app is spending it's time doing, yay!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fincident.io%2Fstatic%2Ff4652a51aa4d408f9dea2775856c2ed8%2F0a47e%2Ftraces-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fincident.io%2Fstatic%2Ff4652a51aa4d408f9dea2775856c2ed8%2F0a47e%2Ftraces-2.png" title="some nicer traces!" alt="some nicer traces!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gorm offers callbacks for a bunch of different bits of the query lifecycle, and you can add specific behaviour for all of them, we currently trace create, delete, update, and query separately, but if you want to go further you can check out the &lt;a href="https://gorm.io/docs/write_plugins.html" rel="noopener noreferrer"&gt;gorm docs&lt;/a&gt;! . You can find all of the code from this post &lt;a href="https://gist.github.com/arussellsaw/bbedfdefee119b4600ce085b773da4b9" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Please remember, you could end up tracing some sensitive data if you're not careful. So make sure to sanitise your query vars if applicable. One good practice is to only trace SELECT queries, as they're typically done via IDs, as opposed to any sensitive information.&lt;/p&gt;

</description>
      <category>database</category>
      <category>go</category>
      <category>googlecloud</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Handling third-party provider outages</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Thu, 30 Jun 2022 13:10:16 +0000</pubDate>
      <link>https://dev.to/incident_io/handling-third-party-provider-outages-7a0</link>
      <guid>https://dev.to/incident_io/handling-third-party-provider-outages-7a0</guid>
      <description>&lt;p&gt;There are a handful of providers that large parts of the internet rely on: Google, AWS, Fastly, Cloudflare. While these providers can boast five or even six nines of availability, they're not perfect and - like everyone - they occasionally go down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thinking about availability
&lt;/h2&gt;

&lt;p&gt;For customers to get value from your product or service, it has to be &lt;em&gt;available&lt;/em&gt;. That means that all the systems required to deliver the service are working, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Your code or any systems that you control or run&lt;/li&gt;
&lt;li&gt;  Anything that your systems depend on (i.e. third party providers)&lt;/li&gt;
&lt;li&gt;  Whatever your customer needs to access your service (e.g. an internet connection, or mobile)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's a great paper &lt;a href="https://queue.acm.org/detail.cfm?id=3096459"&gt;The Calculus of Service Availability&lt;/a&gt; that tries applying maths to how people interpret availability. It points out that in order for a system to provide a certain availability, For a system to provide a certain availability, any third parties that it depends on need to have an order of magnitude higher availability (e.g. for a system to provide 99.99%, its dependencies need to have ~99.999%).&lt;/p&gt;

&lt;p&gt;In practise, this means that there are some services which need significantly higher availability than others.&lt;/p&gt;

&lt;p&gt;As a consumer grade service provider (e.g. an e-commerce site), a 99.99% availability is likely to be sufficient. Above this, the consumers dependencies (of which you have no control) such as their internet connection or device are collectively less reliable. This means that investment to significantly improve availability beyond this point isn't particularly valuable.&lt;/p&gt;

&lt;p&gt;By contrast, if you're a cloud provider, your customers are relying on you having a significantly higher availability guarantee so that they can serve their customers while building on top of your platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  How much is availability worth to you?
&lt;/h2&gt;

&lt;p&gt;In general, most consumer systems can afford a small amount of unexpected downtime without world-ending consequences: in fact, most customers won't notice, as their connection and device is likely less reliable. Given achieving more reliability is extremely expensive, it's important you know when to stop, as the time you save can be invested in delivering product features that your customers will genuinely value.&lt;/p&gt;

&lt;p&gt;Multi-cloud is a great example. Multi-cloud is a shorthand for building a platform that runs on both multiple cloud providers (e.g. AWS, GCP, Azure etc.). This is the only way to be resilient to a full cloud provider outage - you need a whole second cloud provider that you can lean on instead.&lt;/p&gt;

&lt;p&gt;This is an incredibly expensive thing to do. It increases the complexity of your system, meaning that engineers have to understand multiple platforms whenever they're thinking about infrastructure. You become limited to just the feature set that is shared by both cloud providers, meaning that you end up missing out on the full benefits of neither.&lt;/p&gt;

&lt;p&gt;You've also introduced a new component - whatever is doing the routing / load balancing between the two cloud providers. To improve your availability using multi-cloud, this new component has to have significantly higher availability than the underlying cloud providers: otherwise you're simply replacing one problem with another.&lt;/p&gt;

&lt;p&gt;Unless you have very specific needs, you'll do better purchasing high availability products from the best-in-class providers than building your own.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---sTIVLSM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nipbogxaz9buh94ai53y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---sTIVLSM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nipbogxaz9buh94ai53y.png" alt="Image description" width="880" height="786"&gt;&lt;/a&gt;&lt;br&gt;
See the original Tweer &lt;a href="https://twitter.com/mipsytipsy/status/1439430232927182848?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1439430232927182848%7Ctwgr%5E%7Ctwcon%5Es1_&amp;amp;ref_url=https%3A%2F%2Fincident.io%2Fblog%2Fthird-party-outages"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're interested in reading more, there's a great &lt;a href="https://www.lastweekinaws.com/blog/multi-cloud-is-the-worst-practice/"&gt;write-up&lt;/a&gt; from Corey Quinn on the trade-offs on multi-cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Big provider outages are stressful
&lt;/h2&gt;

&lt;p&gt;Being on the receiving end of a big provider outage is stressful: you can be completely down with very limited recovery options apart from 'wait until the provider fixes it'.&lt;/p&gt;

&lt;p&gt;In addition, it's likely that some of your tools are also down as they share dependencies on the third party. When Cloudflare goes down, it takes a large percentage of the internet with it. AWS is the same. That can increase panic and further complicate your response.&lt;/p&gt;

&lt;p&gt;So how should we think about these kinds of incidents, and how do we manage them well?&lt;/p&gt;

&lt;h2&gt;
  
  
  Prioritise the things you can control
&lt;/h2&gt;

&lt;p&gt;Your site is down. Instead of desperately trying to fix things to bring your site back up, you are ... waiting. What should you be doing?&lt;/p&gt;

&lt;h3&gt;
  
  
  Choose high availability products
&lt;/h3&gt;

&lt;p&gt;As we discussed above, availability is something that cloud providers are really very good at. The easiest thing you can usually do to improve availability is to use the products that cloud providers build for exactly this reason.&lt;/p&gt;

&lt;p&gt;Most cloud providers offer multi-zone or multi-region features which you can opt into (for a price) and vastly decrease the likelihood of these outages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understand the impact
&lt;/h3&gt;

&lt;p&gt;As with all incidents, it's important to understand the impact of the outage on your customers. Take the time to figure out what is and isn't working - perhaps it's not a full outage, but a service degradation. Or there are some parts of your product which aren't impacted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Talk to your customers
&lt;/h3&gt;

&lt;p&gt;If you can, find a way to tell your customers what's going on. Ideally via your usual channels, but if those are down then find another way: social media or even old-fashioned emails.&lt;/p&gt;

&lt;p&gt;Translate the impact into something your customers can easily understand. What can they do, what can't they do. Where can they follow along (maybe the third party's status page) to find out more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can you mitigate the impact?
&lt;/h3&gt;

&lt;p&gt;Can you change anything about your infrastructure to bypass the broken component? Provide a temporary gateway for someone to access a particular critical service? Ask someone to email you a CSV file which you can manually process?&lt;/p&gt;

&lt;p&gt;This is your chance to think outside the box: it's likely to be for a short time period so you can do things that won't scale.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's going to happen next?
&lt;/h3&gt;

&lt;p&gt;What's going to happen when the third party outage ends: is it business as usual? Have you got a backlog of async work that you need to get through, which might need to be rate limited? Are you going to have data inconsistencies that need to be reconciled?&lt;/p&gt;

&lt;p&gt;Ideally, you'd have some tried and tested methods for disaster recovery which the team is already familiar with and are frequently rehearsed (see &lt;a href="https://incident.io/guide/learn-and-improve/practice-or-it-doesnt-count/"&gt;Practise or it doesn't count&lt;/a&gt; for more details).&lt;/p&gt;

&lt;p&gt;In absence of that, try to forecast as much as you can, and take steps to mitigate the impact of these. Maybe scale up queues ready for the thundering herd, or apply some more aggressive rate limiting. Keep communicating, giving your customers all the information they need to make good decisions.&lt;/p&gt;




&lt;p&gt;After the incident is over, what can we learn?&lt;/p&gt;

&lt;h2&gt;
  
  
  The fallacy of control
&lt;/h2&gt;

&lt;p&gt;Writing a debrief document after a third party outage doesn't feel good:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What happened? Cloudflare went down\&lt;br&gt;
What was the impact? No-one could visit our website\&lt;br&gt;
What did we learn? It's bad when Cloudflare goes down 🤷‍♀️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Incidents that you can control often &lt;em&gt;feel&lt;/em&gt; better than third party incidents where you can't control the outcome. After the incident you can write a post-mortem, learn from it, and get a warm fuzzy feeling that you've improved your product along the way.&lt;/p&gt;

&lt;p&gt;However, in the cold light of day, the numbers are unlikely to support this theory. Unless you have the best SRE team in the world, you aren't going to ship infrastructure products with better availability than a cloud provider.&lt;/p&gt;

&lt;p&gt;Instead, we should again focus on the things that are within our control.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Learn more about post-mortems and incident debriefs in our &lt;a href="https://incident.io/guide/learn-and-improve/post-mortems-and-debriefs"&gt;Incident Management Guide&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How can we best prepare for these kinds of outages?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Understand your dependencies
&lt;/h3&gt;

&lt;p&gt;It's pretty stressful to be trying to figure out what is impacted by a third party outage in the middle of an incident. To avoid that, you need to understand the various dependency chains in advance.&lt;/p&gt;

&lt;p&gt;This is tricky to do as a pen-and-paper exercise: often the most reliable way is to spin up a second environment (that customers aren't using) and start turning bits of the system off.&lt;/p&gt;

&lt;p&gt;Once you've got an understanding of the dependencies, when an incident does happen, you'll be able to focus your attention on the relevant parts of your system.&lt;/p&gt;

&lt;p&gt;As part of this, you can also run &lt;a href="https://incident.io/guide/learn-and-improve/practice-or-it-doesnt-count/#game-day-(1-4pm)"&gt;Game days&lt;/a&gt; to help train responders in disaster recovery. These are the exercises which can produce the disaster recovery plans (and familiarity) which can be so valuable when bringing your systems back online.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid unnecessary components
&lt;/h3&gt;

&lt;p&gt;Sometimes, often for historic reasons, you'll end up relying on multiple third parties where really, one would do the job. Whenever you add a dependency, you significantly reduce your availability. If you can consolidate on fewer appropriately reliable dependencies, it will significantly improve your overall available.&lt;/p&gt;

&lt;p&gt;We can also consider blast radius here: are there ways to make some of your product work while a certain provider is down. This doesn't mean using another provider necessarily, but perhaps you could boot service [x] even if service [y] is unavailable.&lt;/p&gt;

&lt;p&gt;Reducing the number of components is likely to reduce your exposure to these kinds of outages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Be honest about availability
&lt;/h3&gt;

&lt;p&gt;Your availability is always, at best, the availability of all your critical providers, combined. Be honest with yourselves and your customers about what a realistic availability target is within those constraints, and make sure your contracts reflect that.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>sre</category>
      <category>devops</category>
    </item>
    <item>
      <title>Uncovering the mysteries of on-call</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Tue, 28 Jun 2022 12:43:44 +0000</pubDate>
      <link>https://dev.to/incident_io/uncovering-the-mysteries-of-on-call-2d59</link>
      <guid>https://dev.to/incident_io/uncovering-the-mysteries-of-on-call-2d59</guid>
      <description>&lt;p&gt;For the vast majority of organisations, some form of round-the-clock cover is critical to successful business operations. On-call is an essential part of an effective incident response process, yet there is no commonly accepted playbook on how to most effectively structure and &lt;a href="https://incident.io/blog/fair-on-call-compensation"&gt;compensate on-callers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We ran a survey to uncover the mysteries of how on-call works in organisations of different shapes and sizes around the world.&lt;/p&gt;

&lt;p&gt;You can download the full report below, or read on to get a few of the headlines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://incident.io/content/uncovering-the-mysteries-of-on-call"&gt;Download full report&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  TL;DR
&lt;/h1&gt;

&lt;p&gt;We had over 200 responses, ranging from globally recognised tech leaders including Google, Amazon and Airbnb, to small start-ups with fewer than 50 employees. Here are the highlights:&lt;/p&gt;

&lt;p&gt;In nearly 70% of organisations, each team is responsible for their own on-call rota, rather than having a single or multiple centralised on-call teams.&lt;/p&gt;

&lt;p&gt;Over 40% of participants were not compensated for on-call. Interestingly, this was more common in larger organisations (+5,000 people) than in small to mid-sized organisations that participated in the survey.&lt;/p&gt;

&lt;p&gt;Where companies did provide compensation, most paid a fixed amount for time spent on-call (e.g. $X per hour, day or week). But the actual dollar amount paid ranged significantly, from $5 to $1,000 per week, with the average weekly rate at $540.&lt;/p&gt;

&lt;p&gt;The most commonly cited on-call challenges were:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Disrupted personal life (30%)&lt;/li&gt;
&lt;li&gt; Dealing with issues without sufficient context or knowledge (24%)&lt;/li&gt;
&lt;li&gt; Lack of sleep (12%)&lt;/li&gt;
&lt;li&gt; False alerts (10%)&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Need help calculating your on-call compensation?
&lt;/h1&gt;

&lt;p&gt;Our report recommends paying a fixed rate for time spent on-call, calculated down to the minute, regardless of whether or not someone is paged. This helps compensate for the inconvenience and disruption of needing to be available 24/7. From bitter experience, we know that calculating time spent on-call accurately can be tricky, especially when you want to account for weekend rates, holidays and multiple schedules.&lt;/p&gt;

&lt;p&gt;That's why we've just launched an on-call compensation calculator. Just connect your PagerDuty account to incident.io, tell us the rules you use to calculate on-call pay and we'll do the rest.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sw4N3HPr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1200/0%2AmZ7PxvnY3md8dicA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sw4N3HPr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1200/0%2AmZ7PxvnY3md8dicA.png" alt="" width="600" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll be able to automatically generate a report detailing how much on-call pay each member of the team is owed, based on the hours spent holding the pager. Your responders can also see a breakdown of what they're being paid for each shift, making it super transparent for everyone.&lt;/p&gt;

&lt;p&gt;Et voila --- on-call compensation, made easy.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Practical guide to managing incidents</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Thu, 16 Jun 2022 14:36:09 +0000</pubDate>
      <link>https://dev.to/incident_io/practical-guide-to-managing-incidents-3o3m</link>
      <guid>https://dev.to/incident_io/practical-guide-to-managing-incidents-3o3m</guid>
      <description>&lt;p&gt;Every company needs a plan for when things go wrong. I've written these plans many times now, and every time I've wished for a reference that reflects the way companies actually work today.&lt;/p&gt;

&lt;p&gt;So here it is --- our many years of collective knowledge and experience distilled into a &lt;a href="https://incident.io/guide/"&gt;&lt;em&gt;practical guide to incident management&lt;/em&gt;&lt;/a&gt;for your whole organisation.&lt;/p&gt;




&lt;p&gt;If you're looking a quick entry point, or a round-up of the key points in the guide. See &lt;a href="https://incident.io/guide/"&gt;here&lt;/a&gt; for the full guide.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://incident.io/guide/on-call/"&gt;On-call&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;On-call isn't just for engineers:&lt;/strong&gt; consider who else you might need in an emergency; they should be on-call too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Invest in your training process:&lt;/strong&gt; onboarding new on-callers well is critical: each on-call rota should define a clear path to becoming ready to 'be on call', including learning domain specific content as well as your incident response process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pay anyone that's on-call:&lt;/strong&gt; compensate them inconvenience of being on-call. We recommend paying per hour spent on-call, and adjust your compensation based on expectations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Be compassionate and understanding&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Allow on-call teams to define their own schedules that best suit them&lt;/li&gt;
&lt;li&gt;  Use overrides to give on-callers flexibility, and relieve pressure when things get tough&lt;/li&gt;
&lt;li&gt;  Look out for anyone taking too much of the burden&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://incident.io/guide/foundations/"&gt;Foundations&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Create a shared understanding of an incident:&lt;/strong&gt; an incident is anything that takes you away from planned work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Declare more incidents&lt;/strong&gt;: using your incident process frequently means that, when things go really wrong, you're processes will run like a well-oiled machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use 3--5 human-named severities&lt;/strong&gt;: plain-english words such as minor, major and critical are easier for everyone to understand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every incident should have a lead&lt;/strong&gt;: whether there's one responder or 30, someone has to play the lead role and drive the incident to a resolution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Only use the roles you really need&lt;/strong&gt;: you can often lean on actions (and your incident lead) to understand who's doing what.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://incident.io/guide/response/"&gt;Response&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;When you declare an incident:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Create a fresh space which you can use to co-ordinate your response.&lt;/li&gt;
&lt;li&gt;  Announce the incident in a shared space so everyone's in the loop&lt;/li&gt;
&lt;li&gt;  Assemble the team that you need to start investigating&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;As you respond to an incident:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Identify what's broken &amp;amp; understand the impact&lt;/li&gt;
&lt;li&gt;  Mitigate the immediate impact&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;Take a pause&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;  Resolve the issue&lt;/li&gt;
&lt;li&gt;  Close everything off, and assign follow-up actions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Send regular, easy to digest, internal updates:&lt;/strong&gt; using a predictable format helps busy stakeholders get the context that they need. Long gaps between updates can cause confusion or stress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Show your working:&lt;/strong&gt; document your response in an incident channel, even if you're the only one there. It'll help you avoid bad assumptions or mistakes, and helps your team learn from what you've done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep your customers in the loop:&lt;/strong&gt; clear and frequent communication builds trust, and can turn a negative into a positive. Use simple language, tell everyone what you're doing and what they should do in the meantime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure your thinking&lt;/strong&gt;: use questions and theories to methodically work through a problem, being clear about any assumptions you make along the way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calm is contagious&lt;/strong&gt;: take breaks and keep everyone well fed so your incident response can stay on track, even on the bad days.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When you're remote, over-communicate&lt;/strong&gt;: to avoid a fragmented response, make sure everything is in one place (the incident channel) and it's really clear who's doing what.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://incident.io/guide/learn-and-improve/"&gt;Learn and Improve&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Hold a debrief when there's value&lt;/strong&gt;: the responders for an incident should have a good idea whether a debrief will be valuable. If it becomes mandatory 'red tape', they'll become a useless checkbox exercise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make debriefs truly blameless&lt;/strong&gt;: start with the assumption that everyone came to work to do their best, and don't hold individuals accountable for systematic failures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Value the conversation over the artifact&lt;/strong&gt;: having a document is a useful way to share knowledge asynchronously, but the most valuable part of a debrief is usually the conversation that precedes it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use incidents to level up your team&lt;/strong&gt;: they broaden your horizons and teach you how to build resilient systems. Bring junior members into incidents, so that your teams get the full value from them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Be transparent&lt;/strong&gt;: building a transparent culture means that stakeholders and customers will trust you and give you space to fix what's broken.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Practice your incident process&lt;/strong&gt;: just like any other skill, practice makes perfect. Dry-run your incident process regularly to get everyone up-to-speed and find the rough edges while the stakes are low.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Declare early, declare often: why you shouldn’t hesitate to raise an incident</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Mon, 06 Jun 2022 16:02:52 +0000</pubDate>
      <link>https://dev.to/incident_io/declare-early-declare-often-why-you-shouldnt-hesitate-to-raise-an-incident-44kp</link>
      <guid>https://dev.to/incident_io/declare-early-declare-often-why-you-shouldnt-hesitate-to-raise-an-incident-44kp</guid>
      <description>&lt;p&gt;My first &lt;a href="http://incident.io/"&gt;incident.io&lt;/a&gt;-incident happened in my second week here, when I screwed up the process for requesting extra Slack permissions, which made it impossible to install our app for a few minutes. This was a bit embarrassing, but also simple to resolve for someone more familiar with the process, and declaring an incident meant we got there in just a few minutes.&lt;/p&gt;

&lt;p&gt;Declaring the first incident when you start a new job can be intimidating, but it really shouldn't be. Let's look at some common fears, and work out how to address them.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Won't it be loads of work?"
&lt;/h2&gt;

&lt;p&gt;Most organisations have some kind of &lt;a href="https://incident.io/blog/three-pillars-of-great-incident-response"&gt;incident response&lt;/a&gt; procedure that will have a few things you have to do, like working out how many customers this affected, deciding how to make things right with them, and putting in proactive measures to avoid this happening again.&lt;/p&gt;

&lt;p&gt;That can seem like a daunting prospect. Is this issue &lt;em&gt;really worth all that&lt;/em&gt;?&lt;/p&gt;

&lt;p&gt;A safe default should be "yes". If it turns out this issue wasn't so bad after all you should be able to shut down the response pretty quickly. But if it escalates further, you'll be glad you already have the process rolling.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You can find out more about how to &lt;a href="https://incident.io/blog/workflows-your-process-automated"&gt;automate your incident process&lt;/a&gt; in our previous article.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If it does end up being a lot of work, that isn't necessarily a bad thing. As an individual, you're likely to &lt;a href="https://incident.io/blog/incidents-made-me-a-better-engineer"&gt;learn a lot from tackling your first big incident&lt;/a&gt;. As a team or company you've addressed a serious issue proactively.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Will this get me or my team in trouble?"
&lt;/h2&gt;

&lt;p&gt;If the answer is "yes" you should probably be looking for another job.&lt;/p&gt;

&lt;p&gt;As Chris discussed before, &lt;a href="https://incident.io/blog/why-more-incidents-is-no-bad-thing"&gt;having more incidents is not a bad thing&lt;/a&gt; --- it's not in the long-term interests of any organisation to brush small incidents under the rug, because you can never tell which might turn into huge problems later on.&lt;/p&gt;

&lt;p&gt;The same logic applies here too! Most teams that don't have any incidents are either not taking any risks and slowing down delivery, or hiding their problems. Neither of those is a sign of a healthy team.&lt;/p&gt;

&lt;p&gt;That's not to say that managers should set a target number of incidents per team per quarter, but it does mean that managers should be looking at outlier teams that have very &lt;em&gt;few&lt;/em&gt; incidents, as well as those that have more than their fair share. Are they afraid of getting blamed? Are they spending so long making sure everything they deliver is perfectly robust that they forget about their customers? Did they struggle to respond to an earlier incident effectively and need extra help learning how it's done well?&lt;/p&gt;

&lt;h2&gt;
  
  
  "I've never done this before"
&lt;/h2&gt;

&lt;p&gt;There will always be a first time, and it's probably better if the first incident you run isn't a critical "everything is down" one. A major incident is stressful enough without having to learn about your organisation's response processes at the same time.&lt;/p&gt;

&lt;p&gt;Game days, where you run a pretend incident in a non-production environment, are great for learning your incident response process (and honing your debugging skills!), but you have to apply that knowledge to something real sooner or later.&lt;/p&gt;




&lt;p&gt;Even with &lt;a href="https://incident.io/blog/postmortems-with-gergely-orosz"&gt;blameless post-mortems&lt;/a&gt; and very well-run incident response processes, I've seen teams who decide that downtime on a key product isn't an incident because it hadn't been down for &lt;em&gt;that long&lt;/em&gt; and probably no one had noticed.&lt;/p&gt;

&lt;p&gt;When joining a team, especially as a more experienced engineer, part of the experience you bring is about the different cultures you've worked in, including how you respond when things go wrong. This might feel uncomfortable, shifting the culture of a team always does, but the payoff is absolutely worth it.&lt;/p&gt;

</description>
      <category>sre</category>
      <category>devops</category>
    </item>
    <item>
      <title>Now you see me, now you don't: feature-flagging with LaunchDarkly at incident.io</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Thu, 02 Jun 2022 15:23:28 +0000</pubDate>
      <link>https://dev.to/incident_io/now-you-see-me-now-you-dont-feature-flagging-with-launchdarkly-at-incidentio-4i0</link>
      <guid>https://dev.to/incident_io/now-you-see-me-now-you-dont-feature-flagging-with-launchdarkly-at-incidentio-4i0</guid>
      <description>&lt;p&gt;At &lt;a href="http://incident.io/"&gt;incident.io&lt;/a&gt;, we ship &lt;em&gt;fast&lt;/em&gt;. We're talking multiple times a day, every day (yes, including Fridays). Once I merge a pull request (PR), my changes rocket their way into production without me lifting a finger. 💅 It's when we tackle larger projects that this becomes a bit more complicated.&lt;/p&gt;

&lt;p&gt;We recently launched &lt;a href="https://incident.io/changelog/2021-11-02-announcing-announcements"&gt;Announcement Rules&lt;/a&gt;, which let you configure which channels incident announcements are posted in depending on criteria you define. That piece of work took us a few weeks, split over multiple PRs, and we couldn't put a half-finished feature in front of customers.&lt;/p&gt;

&lt;p&gt;It's not a question of putting everything in one PR; the larger a PR gets, the riskier it becomes, as it's more difficult for someone to review confidently and a lot more work to roll back if something goes wrong. We also don't want to work on separate branches for too long, as we need to make sure everything we're building works together seamlessly, and working on a branch for a long time will leave us with a nightmare of merge conflicts when we do finally merge the branch back in.&lt;/p&gt;

&lt;p&gt;We need to be able to deploy tiny bits of a feature consistently, building up to the finished product, and be able to hide those bits from our customers until the feature is ready for its debut. And feature-flagging - the process of enabling and disabling features programatically - allows us to do exactly that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anatomy of a feature flag
&lt;/h2&gt;

&lt;p&gt;In a feature-flagging system, we can control visibility of specific features (in our case, Announcement Rules) by switching them on or off.&lt;/p&gt;

&lt;p&gt;The most common kind of flag is a boolean flag, which can either be enabled or disabled. In its simplest implementation we might have a boolean variable &lt;code&gt;announcementRulesEnabled&lt;/code&gt; which we initialise to &lt;code&gt;false&lt;/code&gt; in production, but set to &lt;code&gt;true&lt;/code&gt; in development so that only we can see it while we work on it. Our app code would check the value of this variable and only display the new feature if it was &lt;code&gt;true&lt;/code&gt;. Once the feature's ready for release, we can set the variable's value to &lt;code&gt;true&lt;/code&gt; in production, thereby enabling the flag.&lt;/p&gt;

&lt;p&gt;You should build the systems that differentiate you from your competition, and buy the ones that don't&lt;/p&gt;

&lt;p&gt;There are a few ways of approaching feature-flagging, including building your own system, or using a third-party one. Having used a few custom-built feature flag systems over the years, I find it's almost always better to buy than to build - I strongly believe you should build the systems that differentiate you from your competition, and buy the ones that don't.&lt;/p&gt;

&lt;p&gt;Feature-flagging is not a differentiator for us, and having another system to maintain would end up costing us more in the long term - especially as you add more dimensions to the flags, such as percentage-based or attribute-based rollouts ("enable this for all users who have this app version"). That's why we opted to use &lt;a href="https://launchdarkly.com/"&gt;LaunchDarkly&lt;/a&gt;, a feature management platform-as-a-service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter LaunchDarkly
&lt;/h2&gt;

&lt;p&gt;Now, I've had plenty of experience integrating third-party libraries into apps, and fighting with poor documentation and strange library behaviour. But we managed to get LaunchDarkly implemented across the backend and frontend in a &lt;em&gt;single day&lt;/em&gt;. It completely surpassed my expectations, and has made the entire feature-flagging process totally seamless. (I promise they're not paying me to say this. It's so good.)&lt;/p&gt;

&lt;p&gt;Helpfully, LaunchDarkly provide SDKs for loads of different platforms and languages, so we were able to wrap their &lt;a href="https://docs.launchdarkly.com/sdk/server-side/go"&gt;Go SDK&lt;/a&gt; in our own &lt;code&gt;featureflags&lt;/code&gt; package which enables us to quickly and easily query a user's feature flags. We have three environments set up on the LaunchDarkly dashboard - development (local), staging and production - and when you create a flag in one, it automatically gets populated across all of them.&lt;/p&gt;

&lt;p&gt;Using a wrapper for the SDK allows us to reduce repetition and keep the list of flag names in one place (no passing in typo-riddled strings, thanks). To make this even more robust, we plan to add a check in CircleCI to compare the list of flags we get back from LaunchDarkly with the constants in the &lt;code&gt;featureflags&lt;/code&gt; library, to make sure they actually exist in the dashboard.&lt;/p&gt;

&lt;p&gt;When the backend starts up we initialise the LaunchDarkly client as a singleton. Our code can then pass in the currently authenticated user's user ID and organisation ID to the library to get back a scoped client which we can query directly for specific flags.&lt;/p&gt;

&lt;p&gt;This wrapper allows us to inject a feature flag client, making it easy to inject a mock client for testing. Whenever you're building features behind a flag, it's really important to test both the enabled and disabled versions of the code, to make sure both paths work as expected. I can think of many times in the past where we've written extensive tests for a new feature, but not covered the case where it's turned off (and subsequently realised that path is completely broken, and we had no idea because we were all using our local environments with the flag enabled).&lt;/p&gt;

&lt;p&gt;In our web UI, we use the &lt;a href="https://docs.launchdarkly.com/sdk/client-side/react"&gt;LaunchDarkly React SDK&lt;/a&gt;. Once a user logs in, we initialise the LaunchDarkly client with that user's ID, organisation ID, and any other attributes we want to be able to feature-flag against. The LaunchDarkly SDK gives us a handy React hook to easily access a user's flags, so we can make sure who isn't feature-flagged won't see the Announcements link in the settings menu.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reaping the benefits
&lt;/h2&gt;

&lt;p&gt;Implementing feature flagging has enabled us to continue moving quickly while still staying in control of what we put in front of customers. Most of what we do is on the organisation level rather than targeting individual users, so we're much more likely to turn features on for specific organisations. It means we can ask a subset of our customer organisations to beta test a feature, and get fast feedback before we launch to everyone.&lt;/p&gt;

&lt;p&gt;Right now we're relying on boolean flags, but as the complexity of our organisation and customer base grows, so will the complexity of our flags. It's reassuring to know we won't need to make changes to our implementation to accommodate that. LaunchDarkly gives us the flexibility to add custom attributes for users when we initialise the client; in the future we could feature-flag against anything we wanted, and use string-based or even JSON-based flags if we needed to.&lt;/p&gt;

&lt;p&gt;I suppose you could say we're looking forward to hiding even more new and exciting features from our customers... not least for the intensely satisfying experience of ceremonially flipping a switch to release something new!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>tooling</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to empower your team to own incident response</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Mon, 23 May 2022 13:57:33 +0000</pubDate>
      <link>https://dev.to/incident_io/how-to-empower-your-team-to-own-incident-response-341i</link>
      <guid>https://dev.to/incident_io/how-to-empower-your-team-to-own-incident-response-341i</guid>
      <description>&lt;p&gt;Responding to and managing incidents feels fairly straightforward when you're in a small team. As your team grows, it becomes harder to figure out the ownership of your services, especially during critical times. In those moments, you need everyone to know exactly what their role is in order to recover fast.&lt;/p&gt;

&lt;p&gt;Moving to &lt;a href="http://incident.io/"&gt;incident.io&lt;/a&gt; as the 7th engineer, from a scaleup of around 70 engineers, has given me a new perspective on what it means to own your code. Switching from somewhere with a centralised platform team who hold the pager and coordinate response, to being part of the on-call rotation has been really eye-opening.&lt;/p&gt;

&lt;p&gt;Previously I worked in a team that was working towards a &lt;em&gt;you build it, you run it&lt;/em&gt; approach. The intention was to give delivery teams autonomy and control over their own services -- from creation all the way through to monitoring. As delivery teams grew, incident response became complicated. When the first responders didn't have context on the code it could be really hard to identify the root of a problem. This is magnified as systems become more varied and complex. Incident channels could have 20 people in before anyone relevant was identified and looped in. That's a lot of people interrupted from their flow without adding much value.&lt;/p&gt;

&lt;p&gt;Personally, having a disconnect between the code I wrote and what was going on in production gave me a lack of confidence. I felt like I didn't understand the platform or how it worked since I didn't look at my code's journey beyond clicking "merge". It's easy to not fully understand the importance of quality and reliability when your bugs aren't waking you up at night.&lt;/p&gt;

&lt;p&gt;It's &lt;em&gt;really&lt;/em&gt; hard to get engineers excited about ownership when it's been someone else's job for a long time. Teams feel uncomfortable about the idea of their 9-5 job description changing, evening and weekend pagers are scary and companies understandably do not want to come across as adding extra responsibilities without clear communication of why this will actually save time.&lt;/p&gt;

&lt;p&gt;It's hard but worthwhile to push past this. The core sense of ownership is vital to maintaining an empowered and skilled workforce of engineers that care about what they build. These are some suggestions for what can work to get engineers back to being excited about ownership.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start small
&lt;/h2&gt;

&lt;p&gt;The idea of 24/7 support is scary. When you're used to being shielded it's easy to feel like you can't deal with incidents independently, especially at 4am.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Find the path (or team) of least resistance.
&lt;/h3&gt;

&lt;p&gt;Is there a team that has a good monitoring approach already? Or a smaller product area with a clear sense of ownership? Even a team with just a few engineers who feel excited about the idea. It's easy to get the momentum going when there's a head start.&lt;/p&gt;

&lt;p&gt;It's vital to encourage this publicly and loudly to start a culture change where other teams follow the example.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Don't drop people in the deep end.
&lt;/h3&gt;

&lt;p&gt;Handing over a pager 9-5 is a great way to test the sensitivity of alerts without consequences. It's nice to have the security of dealing with things when others are around, to give you the confidence to take it alone in the future.&lt;/p&gt;

&lt;p&gt;Define clear expectations that teams should handle their code within working hours. Document what support is available, and where people can turn if things go wrong. Setting up pairs of engineers to collaborate for the first couple of rotations can go along way in making things feel less scary.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Keep it simple
&lt;/h3&gt;

&lt;p&gt;Declaring and managing incidents should be easy. If your team uses Slack, make sure they don't have to leave it in order to coordinate response. Using an incident management tool like &lt;a href="https://incident.io/"&gt;incident.io&lt;/a&gt; means people can raise incidents, deal with them, and escalate directly from Slack.&lt;/p&gt;

&lt;p&gt;Configuring an expected incident flow through a tool like this goes a long way in supporting engineers to make the right decisions under pressure, removing the &lt;em&gt;"am I doing this right"&lt;/em&gt; worry. Maintaining a clear timeline of what decisions were made in previous incidents and when is a great resource to show people scenarios they might encounter as they onboard into incident response. Keep note of a few past incidents, they're great learning resources for newer engineers to follow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remove the noise
&lt;/h2&gt;

&lt;p&gt;When pagers aren't involved, it's easy to let alerting get messy. I've missed urgent issues before because of a lack of clarity and trust in what is pinging us.&lt;/p&gt;

&lt;p&gt;Invest in streamlining your alerts to &lt;em&gt;only&lt;/em&gt; include things that are "&lt;em&gt;drop everything&lt;/em&gt;" moments.&lt;/p&gt;

&lt;p&gt;Make sure your alerting process is easy to understand and modify. I've been in, ad contributed to situations where monitoring gets messier and messier because people just aren't empowered to fix it themselves.&lt;/p&gt;

&lt;p&gt;Encourage teams to get together and decide what they really care about, and give them time to implement those thoughts in their paging process.&lt;/p&gt;

&lt;p&gt;Google's &lt;a href="https://sre.google/sre-book/monitoring-distributed-systems/#xref_monitoring_golden-signals"&gt;4 golden signals&lt;/a&gt; are a great place to start with knowing what to monitor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Empower everyone
&lt;/h2&gt;

&lt;p&gt;There are naturally some people in each team that are the firefighters. Perhaps they have the most legacy knowledge, understand the platform, and are the first to turn to when things go wrong. You need to be actively working away from relying on these roles and knowledge silos for code ownership to really work. The responsibility to take the pager and triage incidents coming in &lt;em&gt;must&lt;/em&gt; be baked into the culture of the team. Focus on empowering the more hesitant members. The aim should be that anyone and everyone in a team can make sensible decisions about how to deal with incidents on the fly.&lt;/p&gt;

&lt;p&gt;A good support network and process to follow can really help here. Who can someone turn to if they're stuck? What should the default flow be? How can they get others involved?&lt;/p&gt;

&lt;p&gt;These are all questions I'd want well documented before being responsible for my team's code out of hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  In conclusion
&lt;/h2&gt;

&lt;p&gt;Reaching an effective culture of end-to-end code ownership is difficult. Big cultural change can be uncomfortable. It's crucial to be empathetic and understand that technical solutions will only go so far. Keeping people at the heart of the approach is essential to getting empowered supporters behind you and making a real difference.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
      <category>startup</category>
    </item>
    <item>
      <title>Incident postmortem pitfalls</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Mon, 09 May 2022 15:25:50 +0000</pubDate>
      <link>https://dev.to/incident_io/incident-postmortem-pitfalls-55el</link>
      <guid>https://dev.to/incident_io/incident-postmortem-pitfalls-55el</guid>
      <description>&lt;p&gt;We spent some time talking to &lt;a href="https://twitter.com/GergelyOrosz"&gt;Gergely Orosz&lt;/a&gt; about our thoughts on what happens when an incident is over, and you're looking back on how things went.&lt;/p&gt;

&lt;p&gt;If you haven't read it already, grab a coffee, get comfortable, and read Gergely's full article &lt;a href="https://blog.pragmaticengineer.com/postmortem-best-practices/"&gt;Postmortem Best Practices&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But before you do that, here's some bonus material on some of our points.&lt;/p&gt;

&lt;h1&gt;
  
  
  When blameless postmortems actually aren't
&lt;/h1&gt;

&lt;p&gt;I'm sure we can all recall a time when we were sitting in an incident debrief, walking through the timeline, and we've reached the critical point where 'someone' pushed the button that triggered the cascade of events that led to the incident. We all talk in hypotheticals about how 'someone' should have read the docs or consulted someone else, and how if that had happened we wouldn't all be here at all.&lt;/p&gt;

&lt;p&gt;It's about starting from an assumption of good intent.&lt;/p&gt;

&lt;p&gt;This is unequivocally not how good debriefs happen. Being blameless doesn't mean we need to tiptoe around the problem and avoid using names. It's more nuanced than that.&lt;/p&gt;

&lt;p&gt;It's about the starting point for an investigation being based on the premise that everyone arrived at work on that day to do all the right things.&lt;/p&gt;

&lt;p&gt;It's about starting from an assumption of good intent and sharing personal accounts of the events that unfolded. They might well have been the person that pushed the button, but why did that make sense to them in this instance? How many times has the button been pushed where everything worked exactly as intended?&lt;/p&gt;

&lt;p&gt;If we understand the specific motivations of the folks who were there when this was happening, we stand to learn the most about the situation, and ultimately turn that into actionable follow-ups or knowledge that can be shared.&lt;/p&gt;

&lt;h1&gt;
  
  
  Incidents are always going to happen again
&lt;/h1&gt;

&lt;p&gt;If you've spent time in incident debriefs, especially big ones with senior leaders, you'll likely be familiar with questions like "how are we going to prevent incidents like this from happening in future?". Cue a room full of engineers rolling their eyes.&lt;/p&gt;

&lt;p&gt;How do we prevent this from ever happening again?&lt;/p&gt;

&lt;p&gt;There is a class of incident where we &lt;em&gt;can&lt;/em&gt; reasonably expect the likelihood of recurrence to be almost zero. If a disk on a server fills and brings down our service, we can add both technical controls to prevent this happening, and detective alerts that'll warn us if we're close to having a similar issue. It's going to be hard (though not impossible!) for that same incident to happen again, and everyone walks away from the debrief happy.&lt;/p&gt;

&lt;p&gt;Now take the scenario where a feature of a system you didn't know about, behaved in a way you didn't expect, and put you in a situation you couldn't foresee. How do you prevent &lt;em&gt;that scenario&lt;/em&gt; from happening again? By virtue of fixing the issue during the incident, we learned something we didn't know, and we can place some controls in place to reduce the likelihood of that specific thing happening again. But what about the hundred other features of that system we don't know about? Do we prioritise a deep dive on the system to understand everything? And once we've done that, how many other systems do we need to do the same on?&lt;/p&gt;

&lt;p&gt;The point here isn't that we should throw our hands in the air and give up. Everyone wants to drive towards better service, fewer incidents and happier customers, but you need to get comfortable with the fact you can't prevent everything. Trying to do so will likely tie you knots on low value work, with little to no guarantee that it'll actually pay off.&lt;/p&gt;

&lt;p&gt;Ultimately, by fixing the issue (ideally using &lt;a href="https://incident.io/"&gt;incident.io&lt;/a&gt;, and out in the open) you've already done the best thing you can to stop this happening again; you've learned something.&lt;/p&gt;

&lt;h1&gt;
  
  
  Take time before you commit to all the actions
&lt;/h1&gt;

&lt;p&gt;It's easy to get carried away in a debrief and generate 37 action items to tackle that 5 minutes of downtime you experienced. Incidents shine a light on a particular problem and combined with recency bias (i.e. this is most important because it's fresh in my memory), it's easy to get lured into prioritising a bunch of work that really shouldn't be done.&lt;/p&gt;

&lt;p&gt;The sad reality is that there's always more than can be done in pretty much every corner of everything we build. But it's important we approach things with perspective and avoid letting the pressure and spotlight on this incident drive us to commit to arguably low-value work.&lt;/p&gt;

&lt;p&gt;The best solution we've found is to introduce a mandatory time gap --- "soak time" --- to let those ideas percolate, and the more rational part of your brain figure out whether they really are the best use of your time.&lt;/p&gt;

&lt;h1&gt;
  
  
  Incidents as a process, not an artefact
&lt;/h1&gt;

&lt;p&gt;Perhaps one of my biggest gripes in the post-incident flow is organisations that value the written incident artefact over all else. As the famous Eisenhower quote goes, "Plans are nothing; planning is everything", and the same is &lt;em&gt;mostly&lt;/em&gt; true of incidents.&lt;/p&gt;

&lt;p&gt;Plans are nothing; planning is everything.&lt;/p&gt;

&lt;p&gt;The postmortem/debrief artefact isn't quite 'nothing', but in our experience, these reports are typically not written to read or convey knowledge, but instead are there to tick a box. The folks in Risk and Compliance need to know that we've asked the five whys and written down the exact times that everything happened because that's how the risks are controlled.&lt;/p&gt;

&lt;p&gt;Personal experiences aside (😅) this is actually pretty common, and if you find yourself here it's useful to remember that --- documents aside --- the process of running debriefs is itself a perfectly effective way to get your money's worth out of incidents.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
    </item>
    <item>
      <title>The three pillars of great incident response</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Wed, 04 May 2022 14:52:48 +0000</pubDate>
      <link>https://dev.to/incident_io/the-three-pillars-of-great-incident-response-e8a</link>
      <guid>https://dev.to/incident_io/the-three-pillars-of-great-incident-response-e8a</guid>
      <description>&lt;p&gt;There's no one-size-fits-all incident response process. Depending on your organisation's shape and size, you'll have different requirements and priorities.&lt;/p&gt;

&lt;p&gt;But the same three pillars form the core of any good process, whether it's for the largest e-commerce giant or a scrappy SaaS startup.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For transparency: we are a Slack-native incident response and management tool that helps hypergrowth companies to automate incident processes, focus on fixing the issue, and learn from incident insights to improve site reliability and fix vulnerabilities. Learn more and see how it works on &lt;/em&gt;&lt;a href="https://incident.io/"&gt;&lt;em&gt;incident.io&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Clarity
&lt;/h1&gt;

&lt;p&gt;You can't fix a problem you don't understand. An incident response team needs to have a clear and shared understanding of what the problem is, and the steps they are taking to resolve it.&lt;/p&gt;

&lt;p&gt;To achieve clarity during an incident, it's important to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Have clear roles so everyone knows who is responsible for what. Context switching between resolving the issue and communicating with stakeholders is tiring and challenging: let everyone do their one job, and do it well.&lt;/li&gt;
&lt;li&gt;  Stay focussed on the problem at hand: don't get distracted by unrelated issues that you discover (ticket them up to look at later).&lt;/li&gt;
&lt;li&gt;  Use actions so everyone knows what is in-flight: this avoids duplication of effort and helps people provide useful context at the right time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  2. Transparency
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Default to transparency
&lt;/h2&gt;

&lt;p&gt;Incidents should be public by default and only made private when absolutely necessary.&lt;/p&gt;

&lt;p&gt;Being transparent means that everyone knows what's happening, as it is happening. That unlocks access to all the context and skills in the whole of your organisation, rather than relying on the incident reporter to pull in all the people that they need. If someone sees something that might be related to the issue, they can let the incident team know instead of wasting valuable time investigating themselves.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Transparency builds trust, both with internal stakeholders and customers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Transparency shatters the illusion of perfection: replacing it with a much more useful '&lt;em&gt;things go wrong here, and we work hard to fix and learn from them&lt;/em&gt;' attitude.&lt;/p&gt;

&lt;p&gt;This can make you feel vulnerable, but that's the only way to build trust with stakeholders. They'll start to feel confident that you'll inform and involve them where needed, and they have more faith in your team's ability to handle difficult situations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Blameless culture
&lt;/h2&gt;

&lt;p&gt;Transparency goes hand-in-hand with a blameless culture where mistakes are learning opportunities, not fireable offences.&lt;/p&gt;

&lt;p&gt;Without this, people will hide their mistakes and won't pull in the more experienced folks needed to help resolve the issue safely: in the worst case, small hiccups can turn into full-blown outages.&lt;/p&gt;

&lt;p&gt;A blameless culture is enabled by humility. This kind of culture is often driven by senior people --- if senior people never make mistakes, junior people will be afraid to admit theirs. Similarly, it's important that people ask for help if they feel out of their depth and need support.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intentionally share information
&lt;/h2&gt;

&lt;p&gt;Transparency isn't just about making it possible for everyone to see the info they need, it's about making it easy for them to see it.&lt;/p&gt;

&lt;p&gt;Think actively about who needs to know: both inside and outside the organisation. Communicate clearly and frequently, providing relevant context to keep people informed.&lt;/p&gt;

&lt;p&gt;Keeping the context in one place makes it easier for people to understand what's happening during the incident, and learn from it afterwards. It's likely that things that you learn in an incident on one team will produce learnings that many people across the organisation will find useful.&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Calm
&lt;/h1&gt;

&lt;p&gt;When responding to incidents, we're only human. Unfortunately, flooding your body with adrenaline doesn't help you make good decisions, or collaborate well with others. Take a breath, grab a glass of water, and situate yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calm comes with trust
&lt;/h2&gt;

&lt;p&gt;Many problems within organisations are rooted in a lack of trust. If you don't trust the people you're working with, you'll be stressed that they might do the wrong thing, or even be doing nothing at all.&lt;/p&gt;

&lt;p&gt;The same applies in reverse: if other people trust you and your team, then they're more likely to give you space to do what needs doing without interrupting or asking for reassurance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calm comes with good tools
&lt;/h2&gt;

&lt;p&gt;If you can easily gather the information that you can verify and share, it's easier to collaborate and problem solve. Having a good &lt;a href="https://incident.io/blog/tracing"&gt;observability&lt;/a&gt; setup, as well as easy access to &lt;a href="https://incident.io/blog/data-stack"&gt;data&lt;/a&gt; is key.&lt;/p&gt;

&lt;p&gt;Ideally, your whole team will be familiar with these tools and use them day-to-day, so the learning curve, while something is going wrong, isn't too steep.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calm comes with energy
&lt;/h2&gt;

&lt;p&gt;Overworked and tired people make bad incident responders. Incident response needs to be distributed across the team; &lt;a href="https://incident.io/blog/no-capes"&gt;share the load&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Everyone should have an extra 10% contingency energy they can use when unexpected things happen, not already be in their overdraft. If someone's involved in a tough incident, try taking other things off their plate to give them time to recover.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calm comes with experience
&lt;/h2&gt;

&lt;p&gt;Having someone who's taken down production before, who's had the 'oh shit' moment, is incredibly valuable.&lt;/p&gt;

&lt;p&gt;Of course, it helps that they're more likely to be able to diagnose and fix the issue. But the real value is that they know that it isn't world-ending.&lt;/p&gt;

&lt;p&gt;That handling incidents well can make customers trust you more, not less, and turn a negative into a positive. That you can admit mistakes, and you won't lose your job.&lt;/p&gt;

&lt;p&gt;Finally, always remember that calm is contagious, just like panic. If a team's leaders are calm, it'll perforate down to everyone around them.&lt;/p&gt;

</description>
      <category>sre</category>
      <category>devops</category>
      <category>security</category>
    </item>
    <item>
      <title>Don't count your incidents, make your incidents count</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Tue, 03 May 2022 12:10:37 +0000</pubDate>
      <link>https://dev.to/incident_io/dont-count-your-incidents-make-your-incidents-count-868</link>
      <guid>https://dev.to/incident_io/dont-count-your-incidents-make-your-incidents-count-868</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;We can't have more than two major incidents per quarter.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It happens all the time: senior folks at your company feel like things are out of control, and they attempt to improve the situation by counting how many incidents you're having.&lt;/p&gt;

&lt;p&gt;And it's not an unreasonable approach --- on the surface, the number of incidents seems like a great measure for how well things are going.&lt;/p&gt;

&lt;p&gt;Whilst setting targets might work in some organisations, it's worth considering whether they provide the signal you expect and whether the implications of doing so have been properly considered. We've had this conversation more times than we can count, so here are a few tips on how to navigate the situation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fewer incidents doesn't mean things are better
&lt;/h3&gt;

&lt;p&gt;The absence of incidents doesn't mean your systems are reliable or things are safe. I've worked in teams where we've had months of smooth sailing, followed by intense periods of seemingly everything being on fire. Nothing materially changed between the two periods. A deeper analysis showed the many contributing factors present throughout. We just got lucky and the perfect storm of latent errors and enabling conditions didn't occur in the first instance.&lt;/p&gt;

&lt;h3&gt;
  
  
  More incidents is no bad thing
&lt;/h3&gt;

&lt;p&gt;Incidents aren't an evil we need to stamp out. In many cases, they're the cost of doing business. We shouldn't encourage failure, but despite our best efforts to maintain high levels of service, surprises will catch us out. When done right, a healthy culture of declaring incidents can be a superpower. I want my teams to feel comfortable sharing when things may be going wrong, be excellent at responding when they do, and democratise knowledge and expertise after the fact --- this is exactly why we build &lt;a href="https://incident.io/"&gt;incident.io&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Targets can drive the wrong behaviour
&lt;/h3&gt;

&lt;p&gt;I've seen people arguing why something is or isn't an incident because they don't want to reset the "days since incident" counter. Equally, I've seen engineers waste time in an incident trying to justify a minor severity rating, rather than major, because they don't want to trigger the company target.&lt;/p&gt;

&lt;p&gt;As stated in Goodhart's Law, &lt;em&gt;"when a measure becomes a target, it ceases to be a good measure"&lt;/em&gt;. If you set a low target with severe consequences, you'll probably meet it, whether that means suppressing reporting, arguing over labels, or some other counterproductive measure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Targeted or not, you're not in control
&lt;/h3&gt;

&lt;p&gt;The vast majority of incidents are outside of our control. At best, a "no incident" goal is un-actionable and ignored. At worst, it can alter behaviour to the detriment of the organisation.&lt;/p&gt;

&lt;p&gt;If you were set a target of not spilling a drink for a year, what would you do differently? Nobody sets out to spill a drink, and when it happens it's not because you're careless, it's just random chance sprinkled with misfortune. Pick a better target, like suggesting I don't run with drinks.&lt;/p&gt;

&lt;h3&gt;
  
  
  There are better alternatives to counting incidents
&lt;/h3&gt;

&lt;p&gt;So you've convinced your leadership team it might be a bad idea, but to seal the deal they're after an alternative. What can you offer in return?&lt;/p&gt;

&lt;p&gt;The best advice is to understand their motivations for the goal. For example, is there a lack of trust between leadership and engineering? Is that fuelled by them seeing incidents, but not seeing the analysis and follow-up that happens afterwards? Perhaps a target around the number incidents which didn't have a debrief would help.&lt;/p&gt;

&lt;p&gt;Whatever the motivation, here are a few options you might want to consider.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measure what you actually care about
&lt;/h3&gt;

&lt;p&gt;You don't &lt;em&gt;really&lt;/em&gt; care about the number of incidents. You care about what that means; whether it's lost revenue, customer satisfaction, or the service you provide --- incidents are just a useful proxy.&lt;/p&gt;

&lt;p&gt;Instead, measure the thing you actually care about like service uptime, the number of times PII data was shared, or the number of failed payments. These are tangible measures that can be targeted and improved.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measure the value you get from incidents
&lt;/h3&gt;

&lt;p&gt;If you can accept that incidents are unavoidable surprises, why not measure how well your org is using them to improve?&lt;/p&gt;

&lt;p&gt;We suggest writing debrief documents that are used to educate, holding sessions to discuss them, and ensuring you're seeing follow up actions through to completion. If you do all of the above, you're likely getting your money's worth. (Pro tip: you can generate incident timelines, post-mortem documents and follow up actions with incident.io with one click directly in Slack)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b49POlDR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vmqb7j1qc3uj9io3q08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b49POlDR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vmqb7j1qc3uj9io3q08.png" alt="Image description" width="880" height="689"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Give them the metrics they want, with the context they need
&lt;/h3&gt;

&lt;p&gt;If you can't convince people not to target the number of incidents, why not provide the metrics they &lt;em&gt;want&lt;/em&gt; but with the context they &lt;em&gt;need&lt;/em&gt; to understand the full picture?&lt;/p&gt;

&lt;p&gt;Rather than "&lt;em&gt;we had 5 major incidents&lt;/em&gt;", share the contributing factors and risks, the commonalities and differences, and what's being done to improve. It's relatively easy to take the heat out of a number by providing some qualitative context. As it happens, there's a great post from the Learning from Incidents blog about this &lt;a href="https://www.learningfromincidents.io/blog/looking-beyond-the-metrics"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you've got any pro tips of your own, we'd love to hear them! Send us an email at &lt;a href="mailto:hello@incident.io"&gt;hello@incident.io&lt;/a&gt;, or find us on Twitter at &lt;a href="https://twitter.com/incident_io"&gt;@incident_io&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
      <category>productivity</category>
      <category>performance</category>
    </item>
    <item>
      <title>Build custom API integrations with incident.io</title>
      <dc:creator>incident.io</dc:creator>
      <pubDate>Wed, 27 Apr 2022 14:46:35 +0000</pubDate>
      <link>https://dev.to/incident_io/build-custom-api-integrations-with-incidentio-nem</link>
      <guid>https://dev.to/incident_io/build-custom-api-integrations-with-incidentio-nem</guid>
      <description>&lt;p&gt;We're building &lt;a href="http://incident.io/"&gt;incident.io&lt;/a&gt; as the single place you turn to when things go wrong. When an issue is disrupting your business-as-usual, the last thing you want is to start opening ten different tools to diagnose and fix it!&lt;/p&gt;

&lt;p&gt;As your central incident hub, we need to give you two powers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Replicating (and possibly automating) your existing processes in incident.io; and&lt;/li&gt;
&lt;li&gt; Keeping &lt;a href="http://incident.io/"&gt;incident.io&lt;/a&gt; in sync with your existing tool stack.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://incident.io/blog/workflows-your-process-automated"&gt;Workflows&lt;/a&gt; cover the former. Workflows are like a mini incident.io Zapier. You can use them to tell us when to page teammates, &lt;a href="https://help.incident.io/en/articles/5948198-keeping-your-customers-in-the-loop"&gt;send updates to your affected customers&lt;/a&gt; and other stakeholders, assign roles and to-dos, and infinitely more.&lt;/p&gt;

&lt;p&gt;What about the latter? We already offer a catalogue of &lt;a href="https://help.incident.io/en/collections/3324010-api-integrations"&gt;native integrations&lt;/a&gt; with on-call solutions (PagerDuty, OpsGenie), issue trackers (e.g. Jira, Linear, GitHub) and communications tools (Statuspage; Zoom; GMeet). We'll continue adding more as we grow: from Datadog or Zendesk to let you declare incidents from those tools; to Backstage or Terraform to sync your service catalog into incident.io. (You can &lt;a href="https://portal.productboard.com/parbp273zuqdg5ixdcaaymrx/tabs/4-the-future"&gt;upvote and request yours&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Today though, we are stepping up our connectedness game by launching the incident.io API!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JLMzSXuF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://incident.io/static/65cd9f1ffcd33c0310895e7d26ebac76/0a47e/declare.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JLMzSXuF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://incident.io/static/65cd9f1ffcd33c0310895e7d26ebac76/0a47e/declare.png" alt="curl request for declaring an incident" title="curl request for declaring an incident" width="600" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the &lt;a href="https://api-docs.incident.io/"&gt;API reference&lt;/a&gt;, or read on to see how our early-access customers have used it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why would I need the API?
&lt;/h2&gt;

&lt;p&gt;Native integrations are a beautiful thing. They are easy to set up, even for non-technical teammates. Sales, Customer Support, BizOps - anyone can plug in their suite of tools without a line of code. They are faster to implement and reduce the need for maintenance on our customers' side.&lt;/p&gt;

&lt;p&gt;However, integrations also have their downfalls. Firstly, they must be built separately for every tool. We are known to ship at the speed of light, but there are &lt;em&gt;a lot&lt;/em&gt; of tools that our customers use - in their engineering teams, and beyond. This means you might have to wait a few months before we integrate natively with that one tool you need.&lt;/p&gt;

&lt;p&gt;Moreover, native integrations have a smaller surface area. They could cover 80% of use cases, and fall short on the outstanding 20%. You might be looking for a functionality that's very specific to your team or company. Or that we simply haven't got round to building yet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://api-docs.incident.io/"&gt;The API&lt;/a&gt; is the answer to both those issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does the incident.io API do?
&lt;/h2&gt;

&lt;p&gt;At the highest level, &lt;a href="https://api-docs.incident.io/"&gt;our API&lt;/a&gt; lets you connect incident.io to any tool in your stack (or even to your own application), and give us instructions via that connection. No more waiting around for that one integration you need, and no more constraints on what you can do: the API world is your oyster!&lt;/p&gt;

&lt;p&gt;It's worth noting at this point that the first version of our API focuses on the three major use cases, namely:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Automatically creating an incident from another system, such as a monitoring tool like Datadog or a ticketing system like Zendesk - see our step-by-step example below&lt;/li&gt;
&lt;li&gt; Exporting incidents and their to-dos (i.e. Actions and Follow-Ups) into a data warehouse or BI tool (Looker, Tableau etc.) to analyse.&lt;/li&gt;
&lt;li&gt; Configuring roles, severities, and custom fields from an external data source like Terraform or your service catalog&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We picked these three because they were the most requested by our existing users, and we wanted to stay focussed on &lt;a href="https://incident.io/blog/breaking-down-complex-projects"&gt;laying solid foundations while building quickly&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Needless to say though, we'll be extending this over time, so we'd &lt;a href="https://incident.io/community"&gt;love to hear&lt;/a&gt; what you'd like to use our API for!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-step example: declaring an incident from Zendesk
&lt;/h2&gt;

&lt;p&gt;Most of our users have a ticketing system like Zendesk to manage their customer support. Inbound tickets are triaged by customer support teammates, and escalated to the engineering teams based on specific criteria (e.g. a certain severity, or a particular incident type such as data breaches).&lt;/p&gt;

&lt;p&gt;In a pre-API world, things could get a little painful to execute that escalation policy. Support team members would have to exit Zendesk. Then head to Slack to manually declare an incident (and remember to &lt;a href="https://incident.io/changelog/2022-03-09"&gt;append the Zendesk ticket link&lt;/a&gt;). We'd work our magic at the point of declaration, and downstream of it.&lt;/p&gt;

&lt;p&gt;In a post-API world, we can add value upstream of the declaration point too: a support agent can declare an incident with one click, straight from within Zendesk. We'll take care of the rest, from declaring the incident in incident.io to pulling in the right teammates, notifying the relevant internal and external stakeholders, spinning up your public Statuspage and much more.&lt;/p&gt;

&lt;p&gt;Here are the few key steps to bringing this flow to life.&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ &lt;a href="https://app.incident.io/settings/api-keys"&gt;Generate an API Key&lt;/a&gt; in incident.io
&lt;/h3&gt;

&lt;p&gt;You'll want to generate a key with &lt;code&gt;Create incidents&lt;/code&gt; enabled. Keep this safe - we'll need it in a minute.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ekJmFK0Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://incident.io/static/f7354da99e630c0eca5132f5a05bb829/0a47e/create-key.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ekJmFK0Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://incident.io/static/f7354da99e630c0eca5132f5a05bb829/0a47e/create-key.png" alt="Screenshot of the create API key modal" title="Screenshot of the create API key modal" width="600" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2️⃣ &lt;a href="https://support.zendesk.com/hc/en-us/articles/4408886797466"&gt;Configure a Zendesk Support trigger&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This lets you choose when Zendesk should escalate a ticket. In this case, we might use a checkbox custom field, which will declare an incident when it's ticked.&lt;/p&gt;

&lt;h3&gt;
  
  
  3️⃣ Add a &lt;a href="https://support.zendesk.com/hc/en-us/articles/4408839108378#topic_dlc_lsz_2pb"&gt;Zendesk webhook&lt;/a&gt; as the action to take when the trigger fires
&lt;/h3&gt;

&lt;p&gt;Configure it to make an HTTP POST request to &lt;code&gt;https://api.incident.io/v1/incidents&lt;/code&gt;. The API Key we generated earlier is used for Bearer token authentication. The request body needs to be JSON that looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "{{ ticket.title }}",
  "idempotency_key": "{{ ticket.id }}",
  "severity_id": "01FCQSP07Z74QMMYPDDGQB9FTG",
  "summary": "From Zendesk: {{ ticket.description }}",
  "visibility": "public",
  "custom_field_entries": [
        {
            "custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
            "values": [
                {
                    "value_link": "{{ ticket.link }}"
                }
            ]
        }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's a couple of special IDs in there you'll need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; The &lt;code&gt;custom_field_id&lt;/code&gt; references a "Zendesk Ticket Link" custom field we've configured. You can find the IDs of your custom fields using the &lt;a href="https://api-docs.incident.io/#operation/Custom%20Fields_List"&gt;List Custom Fields API&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt; The &lt;code&gt;severity_id&lt;/code&gt; references our "Minor" severity. You can find the IDs of your severities using the &lt;a href="https://incident.io/blog/(https://api-docs.incident.io/#operation/Severities_List)"&gt;List Severities API&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it! 🎉 Whenever that trigger fires, you'll get a new incident declared in incident.io. Nice.&lt;/p&gt;

&lt;p&gt;As a bonus: you can configure workflows that only run on your API-generated incidents. For example, you could build a workflow that automatically adds the support agent that declared the incident in Zendesk to the incident's Slack channel.&lt;/p&gt;

&lt;p&gt;To do that, add a Condition based on the API Key that reported the incident. This would look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a-EcXqgK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://incident.io/static/22da90f2d060e274e14bc0ed8aaeaf31/0a47e/workflow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a-EcXqgK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://incident.io/static/22da90f2d060e274e14bc0ed8aaeaf31/0a47e/workflow.png" alt="Screenshot of how to configure a workflow to run only on API-originated incidents" title="Screenshot of how to configure a workflow to run only on API-originated incidents" width="600" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How we built the API
&lt;/h2&gt;

&lt;p&gt;The API for declaring an incident is as permissive as possible: if something's going wrong, it's better that an incident is declared with some missing context than not declared at all. This means that required custom fields won't be enforced, for example.&lt;/p&gt;

&lt;p&gt;We also wanted to avoid accidental spam. If things are going wrong in the middle of the night, the last thing you need is 5 incidents with reminders pinging around. To create an incident with the API, you must specify a unique key which we can deduplicate on. That might be the ID of an alert firing, or the reference for a support ticket. We'll only create one incident for each key, so you don't have to worry about waking up to more incident channels than necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Over to you!
&lt;/h2&gt;

&lt;p&gt;We built our API around these three use-cases for now, but we'll keep expanding it over the coming weeks.&lt;/p&gt;

&lt;p&gt;We'd absolutely love to hear what you build with it, and how you'd like us to extend it.&lt;/p&gt;

&lt;p&gt;There's an &lt;code&gt;#api&lt;/code&gt; channel in the &lt;a href="https://incident.io/community"&gt;incident.io Community&lt;/a&gt;. See you there 👀&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
