Skip to main content

Real architecture · Senior

Netflix Kayenta (automated canary)

Real production architecture. Key points: statistical comparison between baseline and canary.

17 min read · Source: Netflix · Content reviewed on October 23, 2026

Short answer

Real production architecture. Key points: statistical comparison between baseline and canary. Kayenta is an automated canary analysis (ACA) platform, open-sourced by Netflix in partnership with Google. The launch post describes it as a crucial component of delivery at the company, because it reduces the risk of changes in the production environment.

01 · CONTEXT

Reducing the risk of a change in production

Kayenta is an automated canary analysis (ACA) platform, open-sourced by Netflix in partnership with Google. The launch post describes it as a crucial component of delivery at the company, because it reduces the risk of changes in the production environment.

Um canary is a new version of the software deployed to a small subset of users, alongside the stable version. Traffic is split so that part of the requests goes to the canary, which makes it possible to discover problems quickly without affecting most users.

Canary quality is evaluated by comparing key metrics of the old and new versions. If there is significant degradation, the canary is aborted and all traffic returns to the stable version.

  1. Starting point: users reach the load balancer, which forwards requests to the production service.

    Architecture diagram: Production service with a single version
    CLUsers
    NWLoad balancer
    CPProduction service
    NWMetrics store
    CPContinuous delivery
  2. The service publishes metrics, and continuous delivery deploys new versions. What is missing is deciding how a new version would be compared with the current one.

    Architecture diagram: Production service with a single version
    CLUsers
    NWLoad balancer
    CPProduction service
    NWMetrics store
    CPContinuous delivery

The rest of the case shows how Netflix answers that question: which clusters it creates, what it compares, and who decides.

02 · THE PROBLEM

When the canary was a manual analysis

Canary analysis started as a manual process. A developer or release engineer looked at graphs and logs from the baseline and canary servers to see how close the metrics were, such as HTTP status codes, response times, and exception counts. If the data looked reasonable, the person manually decided to move forward or roll back.

Netflix writes that the approach did not scale and was not reliable. Each canary meant several hours staring at graphs and digging through logs, which made it hard to deploy more than once or twice a week, and comparing graphs visually made it hard to see subtle differences between canary and baseline.

The first attempt at automation was a script specific to the application being measured. The company then tried to generalize the process and created the first version of automated canary analysis, of which Kayenta is an evolution.

03 · THREE CLUSTERS

Production, baseline, and canary

In Netflix's process, three clusters serve the same traffic in different amounts. A typical setup uses a load balancer to include the baseline and canary instances in the regular instance pool.

  1. Users reach the load balancer, which splits the traffic among the clusters.

    Architecture diagram: Production, baseline, and canary
    CLUsers
    NWLoad balancer
    CPProduction cluster
    CPBaseline cluster
    CPCanary cluster
    CPSpinnaker
    NWTime-series database
  2. Production receives most of the traffic and runs the current version, unchanged.

    Architecture diagram: Production, baseline, and canary
    CLUsers
    NWLoad balancer
    CPProduction clustercurrent version
    CPBaseline cluster
    CPCanary cluster
    CPSpinnaker
    NWTime-series database
  3. The baseline runs the same code and configuration version as production and receives a small share of the traffic.

    Architecture diagram: Production, baseline, and canary
    CLUsers
    NWLoad balancer
    CPProduction cluster
    CPBaseline clustersame version
    CPCanary cluster
    CPSpinnaker
    NWTime-series database
  4. The canary runs the proposed changes and receives a small share of the traffic.

    Architecture diagram: Production, baseline, and canary
    CLUsers
    NWLoad balancer
    CPProduction cluster
    CPBaseline cluster
    CPCanary clusterproposed version
    CPSpinnaker
    NWTime-series database
  5. Spinnaker manages the lifecycle of the baseline and canary clusters.

    Architecture diagram: Production, baseline, and canary
    CLUsers
    NWLoad balancer
    CPProduction cluster
    CPBaseline cluster
    CPCanary cluster
    CPSpinnaker
    NWTime-series database
  6. Metrics are stored in a time-series database, with tags that identify whether the data came from the canary or the baseline.

    Architecture diagram: Production, baseline, and canary
    CLUsers
    NWLoad balancer
    CPProduction cluster
    CPBaseline cluster
    CPCanary cluster
    CPSpinnaker
    NWTime-series database
ClusterWhat runsInstances
ProductionCurrent version, unchangedAny number of instances
BaselineSame code and configuration version as productionTipicamente 3
CanaryProposed code or configuration changesTipicamente 3

It would also be possible to use the production cluster instead of creating a baseline, but comparing a freshly created canary with a long-running production could give unreliable results. Creating a fresh baseline guarantees metrics free of the effects of long-running processes.

Spinnaker, the company's continuous delivery platform, runs one or more iterations of the analysis and decides to continue, roll back, or, in some cases, ask for manual intervention. If the version is considered safe, the deploy proceeds; if not, Spinnaker aborts the canary and all traffic goes to production.

04 · KAYENTA

Metric retrieval and judgment

Kayenta is responsible for assessing the risk of a canary and checking whether there is significant degradation between baseline and canary. It is split into two main stages: metric retrieval and judgment.

  1. The Spinnaker pipeline triggers the analysis through Kayenta's REST endpoint.

    Architecture diagram: Automated canary analysis with Kayenta
    CPSpinnaker pipeline
    CPKayenta
    NWMetrics sources
    CPJuiz
    DBResults store
  2. Kayenta reads the query configuration and combines it with a scope to query a metrics source.

    Architecture diagram: Automated canary analysis with Kayenta
    CPSpinnaker pipeline
    CPKayenta
    NWMetrics sources
    CPJuiz
    DBResults store
  3. The retrieval results are passed to the judge for analysis.

    Architecture diagram: Automated canary analysis with Kayenta
    CPSpinnaker pipeline
    CPKayenta
    NWMetrics sources
    CPJuiz
    DBResults store
  4. The judge produces a decision: the canary passed or failed.

    Architecture diagram: Automated canary analysis with Kayenta
    CPSpinnaker pipeline
    CPKayenta
    NWMetrics sources
    CPJuizdecision
    DBResults store
  5. Spinnaker uses the score to decide whether the canary continues or rolls back.

    Architecture diagram: Automated canary analysis with Kayenta
    CPSpinnaker pipeline
    CPKayenta
    NWMetrics sources
    CPJuiz
    DBResults store
  6. The output of retrieval and judgment is archived, which makes it possible to run new judges over data already collected.

    Architecture diagram: Automated canary analysis with Kayenta
    CPSpinnaker pipeline
    CPKayenta
    NWMetrics sources
    CPJuiz
    DBResults store

During retrieval, Kayenta reads a configuration file that defines the metric queries and combines each one with a scope, that is, a cluster and a time range. Metrics are typically stored in a time-series database, with tags that identify whether the data came from the canary or the baseline. Among the sources supported at the time of the post were Prometheus, Stackdriver, Datadog, and Netflix's Atlas, and different sources can be combined in a single analysis.

Judgment stageWhat it does
Data validationEnsures that baseline and canary data exist before the analysis
Data cleaningHandles missing values according to the metric type
Metric comparisonClassifies each metric as Pass, High, or Low
Score calculationIndicates how similar the canary is to the baseline

The main comparison algorithm uses confidence intervals, computed with the Mann-Whitney U test, to classify whether a significant difference exists. The High classification indicates that the canary's metric is significantly higher than the baseline's.

The final score is the ratio of metrics classified as Pass to the total number of metrics: for example, 9 of 10 metrics at Pass result in a score of 90%. Netflix says more complex methodologies exist, but that it prefers techniques that are simple to understand.

The canary report details the result per metric and shows the input data. In one example from the post, the score is 58%, with several metrics classified as High. For Netflix, having a detailed view of why a canary failed is crucial to building confidence in the system.

05 · RESULTS

Flexibility, adoption, and what to take into the interview

Because the output of retrieval and judgment is archived, it is possible to run new comparison algorithms and new judges over data already collected. Metrics sources, judges, configuration storage, and results storage are pluggable.

Kayenta offers a REST endpoint for CRUD operations on configurations and for fetching results. Despite its tight integration with Spinnaker, it can run without the other Spinnaker components, with Redis as its only dependency.

According to Netflix, Kayenta is much more flexible than the previous solution and easier to configure. The company removed much of the complexity of defining thresholds and manual adjustments, relying on better algorithms. At the time of the post, migration from the legacy system was in progress, and Kayenta was running about 30% of canary judgments in production, an average of 200 per day.

Frequently asked questions

What is Netflix Kayenta (automated canary)?

Real production architecture. Key points: statistical comparison between baseline and canary.

What does the Netflix Kayenta (automated canary) design cover?

It is organized in these sections: Reducing the risk of a change in production, When the canary was a manual analysis, Production, baseline, and canary, Metric retrieval and judgment, and Flexibility, adoption, and what to take into the interview.

How long is Netflix Kayenta (automated canary) and what level is it?

It takes about 17 minutes to read and is rated Senior level.

Now design it yourself

Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.