<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Armory Docs – Canary Analysis in Spinnaker</title><link>/continuous-deployment/spinnaker-user-guides/canary/</link><description>Recent content in Canary Analysis in Spinnaker on Armory Docs</description><generator>Hugo -- gohugo.io</generator><atom:link href="/continuous-deployment/spinnaker-user-guides/canary/index.xml" rel="self" type="application/rss+xml"/><item><title>Continuous-Deployment: Use the Static Baseline Judge with Canary Analysis in Spinnaker</title><link>/continuous-deployment/spinnaker-user-guides/canary/staticbaselinejudge/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/canary/staticbaselinejudge/</guid><description>
&lt;p>Before you can start using canary deployments, you need to enable Kayenta, the Spinnaker&lt;sup>TM&lt;/sup> service for canary deployments. For more information, see the &lt;a href="/continuous-deployment/armory-admin/kayenta-configure/"}>Configure Automated Canary Deployments in Spinnaker&lt;/a> guide.&lt;/p>
&lt;h2 id="overview-of-the-static-judge">Overview of the static Judge&lt;/h2>
&lt;p>Most metric stores (DataDog, NewRelic, AppDynamics, etc.) have a way for users to set thresholds. When a threshold is exceeded, an alarm or event gets triggered. This alarm or event API can usually be queried. However, Graphite doesn’t natively support setting thresholds (although it supports it with third party plugins). Therefore, you need to set these thresholds in Spinnaker.&lt;/p>
&lt;p>We created a Judge (StaticBaselineJudge-v1.0) that allows you to set a static baseline parameter. When running a Canary Analysis, Spinnaker takes the value of this parameter and uses it to compare against the canary data.&lt;/p>
&lt;h2 id="configuring-the-static-baseline-judge">Configuring the Static Baseline Judge&lt;/h2>
&lt;p>On the Canary Configuration page when creating a new Config, you can select the &lt;em>StaticBaselineJudge-v1.0&lt;/em> or regular &lt;em>NetflixACAJudge-v1.0&lt;/em>.&lt;/p>
&lt;figure>
&lt;img src="/images/static_baseline_dropdown_judges_options.png"/>
&lt;/figure>
&lt;p>&lt;strong>Select the Static Judge&lt;/strong>&lt;/p>
&lt;p>To input the metric value needed, edit the config as JSON.&lt;/p>
&lt;figure>
&lt;img src="/images/static_baseline_metric_json_edit_button.png"/>
&lt;/figure>
&lt;p>Set the following property:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">&amp;#34;extendedProperties&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;staticBaseline&amp;#34;: &lt;/span>&lt;span style="color:#bd93f9">300&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;figure>
&lt;img src="/images/static_baseline_metric_json_edit.png"/>
&lt;/figure>
&lt;p>You need to do this for each metric you want to compare against a Static Baseline.
By default, if this property is not set, then the judge performs the same analysis that NetflixACAJudge-v1.0 does.&lt;/p>
&lt;p>That means you can have multiple metrics in your Canary Config: ones that make use of the Static Baseline and others that use the regular Judge.&lt;/p>
&lt;p>As an example of this, the following Canary Config has two metrics defined, one is setting the staticBaseline parameter and the other is not:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;applications&amp;#34;: &lt;/span>[
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;training&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;classifier&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;groupWeights&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Group 1&amp;#34;: &lt;/span>&lt;span style="color:#bd93f9">100&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;configVersion&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;1&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;createdTimestamp&amp;#34;: &lt;/span>&lt;span style="color:#bd93f9">1569534009252&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;createdTimestampIso&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;2019-09-26T21:40:09.252Z&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;description&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;judge&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;judgeConfigurations&amp;#34;: &lt;/span>{},
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;name&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;StaticBaselineJudge-v1.0&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;metrics&amp;#34;: &lt;/span>[
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;analysisConfigurations&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;canary&amp;#34;: &lt;/span>{},
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;extendedProperties&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;staticBaseline&amp;#34;: &lt;/span>&lt;span style="color:#bd93f9">300&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;groups&amp;#34;: &lt;/span>[
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;Group 1&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;name&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;canary&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;query&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;customInlineTemplate&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;PromQL:avg(container_spec_cpu_period{namespace=\&amp;#34;${location}\&amp;#34;})&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;labelBindings&amp;#34;: &lt;/span>[],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;metricName&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;container_network_receive_bytes_total&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;resourceType&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;aws_ec2_instance&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;serviceType&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;prometheus&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;type&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;prometheus&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;scopeName&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;default&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;analysisConfigurations&amp;#34;: &lt;/span>{},
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;groups&amp;#34;: &lt;/span>[
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;Group 1&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;name&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;Regular Canary&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;query&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;customInlineTemplate&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;PromQL:avg(container_spec_cpu_period{namespace=\&amp;#34;${location}\&amp;#34;})&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;serviceType&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;prometheus&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;type&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;prometheus&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;scopeName&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;default&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;name&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;karlo-canario&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;templates&amp;#34;: &lt;/span>{},
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;updatedTimestamp&amp;#34;: &lt;/span>&lt;span style="color:#bd93f9">1572365396680&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;updatedTimestampIso&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;2019-10-29T16:09:56.680Z&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>When running the above Canary Config on a Canary Stage, the value &amp;ldquo;300&amp;rdquo; gets used as the Baseline parameter for the analysis.&lt;/p>
&lt;figure>
&lt;img src="/images/static_baseline_canary_result.png"/>
&lt;/figure></description></item><item><title>Continuous-Deployment: Use Automatic Canary Analysis in Spinnaker</title><link>/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use/</guid><description>
&lt;h2 id="overview-of-kayenta-for-automated-canary-analysis">Overview of Kayenta for automated canary analysis&lt;/h2>
&lt;p>Kayenta is the Spinnaker service that performs automated canary analysis. The goal of Kayenta is to provide the end user with confidence that a deployment is safe through automation and intelligence.&lt;/p>
&lt;p>Kayenta uses real-time data sources to validate that a canary is good or bad. Kayenta supports the following real-time data sources:&lt;/p>
&lt;ul>
&lt;li>DataDog&lt;/li>
&lt;li>Stackdriver (Google)&lt;/li>
&lt;li>Prometheus&lt;/li>
&lt;li>New Relic&lt;/li>
&lt;li>Dynatrace&lt;/li>
&lt;li>AWS CloudWatch&lt;/li>
&lt;/ul>
&lt;h2 id="before-you-begin">Before you begin&lt;/h2>
&lt;p>Before you can start using canary deployments, you need to enable Kayenta, the Spinnaker&lt;sup>TM&lt;/sup> service for canary deployments. For more information, see the &lt;a href="/continuous-deployment/armory-admin/kayenta-configure/"}>Configure Automated Canary Deployments in Spinnaker&lt;/a> guide.&lt;/p>
&lt;h2 id="configuring-kayenta-on-an-app">Configuring Kayenta on an app&lt;/h2>
&lt;p>When Kayenta is enabled for your instance, you should see a &lt;strong>Canary&lt;/strong> option in your app&amp;rsquo;s config section:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-10-23-at-3.25.33-PM.png"/>
&lt;/figure>
&lt;p>Check &lt;strong>Canary&lt;/strong> and save.&lt;/p>
&lt;p>If you don&amp;rsquo;t see this option in your application config, make sure you&amp;rsquo;ve &lt;a href="https://www.spinnaker.io/guides/user/canary/">configured Kayenta&lt;/a>.&lt;/p>
&lt;p>You can also find more information about Kayenta in &lt;a href="/continuous-deployment/armory-admin/kayenta-configure/">Automated Canary Deployments&lt;/a>.&lt;/p>
&lt;h2 id="canary-configs">Canary configs&lt;/h2>
&lt;blockquote>
&lt;p>You may need to refresh your browser page to see your changes.&lt;/p>
&lt;/blockquote>
&lt;p>Your menubar should show &lt;strong>Delivery&lt;/strong> and you should see the option for &lt;strong>Canary Configs&lt;/strong> as a hover, or as a submenu element:&lt;/p>
&lt;figure>
&lt;img src="/images/[069c7e1865637f78eb92a091172c92da]_Image-2018-04-18-at-12.45.18-PM.png"/>
&lt;/figure>
&lt;p>Click on &lt;strong>Canary Configs&lt;/strong> and &lt;strong>Add configuration&lt;/strong>. You should see form similar to this:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-18-at-12.56.54-PM.png" width="80%" height="80%"/>
&lt;/figure>
&lt;p>&lt;strong>Configuration Name&lt;/strong>: Spaces are not allowed, only alphanumerics, hyphens and
underscores. This name is displayed as an option in the canary stage configuration later, so choose a meaningful name.&lt;/p>
&lt;p>&lt;strong>Metric Store&lt;/strong>: If you only configured one metrics store, this is set for you. Otherwise, you can choose from the options. The default is the one you referenced in the environment file.&lt;/p>
&lt;p>&lt;strong>Description&lt;/strong>: Free form text to help your coworkers know what this canary is doing.&lt;/p>
&lt;p>If you see the following error &lt;code>The was an error saving your config: 400&lt;/code> when you are trying to save your canary config, add the following setting in your &lt;code>SpinnakerService&lt;/code> manifest:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">profiles&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">gate&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">services&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">kayenta&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">canaryConfigStore&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="groups">Groups&lt;/h2>
&lt;p>A Canary Config can contain multiple groups of metrics, and each group can
contain multiple metrics. By default &amp;ldquo;Group 1&amp;rdquo; is set up for you to add to;
you can rename the group by clicking on the group and then clicking on the
pencil icon next to it.&lt;/p>
&lt;p>A group that has no metrics in it will be removed when the configuration is
saved. If you create an extra group or want to delete an existing one, just
be sure you&amp;rsquo;ve removed all the metrics from that group before saving.&lt;/p>
&lt;p>Grouping is used to add different weights to the importance of different
metrics or groups of metrics (see &amp;ldquo;Scoring&amp;rdquo; below).&lt;/p>
&lt;h2 id="add-metric">Add metric&lt;/h2>
&lt;p>When you add a metric, the UI will be slightly different depending on what
Metric Store you selected earlier. The DataDog dialog looks like:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-18-at-1.11.59-PM.png"/>
&lt;/figure>
&lt;p>The Stackdriver dialog looks like:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-18-at-1.12.46-PM.png"/>
&lt;/figure>
&lt;p>The New Relic dialog looks like:
&lt;figure>
&lt;img src="/images/NewRelicMetricsDialog.png"/>
&lt;/figure>
&lt;/p>
&lt;p>In all cases, the Name is free-form and used to label the results and graphs.&lt;/p>
&lt;p>By default the &amp;ldquo;Fail on&amp;rdquo; selection of &amp;ldquo;either&amp;rdquo; means the comparison of canary
and baseline metrics will be marked as a failure if the canary&amp;rsquo;s data is
either significantly greater or less than the baseline&amp;rsquo;s data. You can select
&amp;ldquo;increase&amp;rdquo; if you only want to fail when the canary&amp;rsquo;s metrics are significantly
higher than the baseline (useful for things like error counts, memory and CPU
usage, etc, where a significant improvement is not a failure), or, conversely,
select &amp;ldquo;decrease&amp;rdquo; for the opposite (useful for metrics that measure things
where bigger numbers are always better).&lt;/p>
&lt;h3 id="datadog-metrics">DataDog metrics&lt;/h3>
&lt;p>For DataDog, the metric is simply the aggregation function you wish to use
(avg, min, max, sum), a colon, and the name of the metric. You can use the
&lt;a href="https://app.datadoghq.com/metric/explorer">DataDog Metrics Explorer&lt;/a> to find
these names:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-18-at-1.20.25-PM.png"/>
&lt;/figure>
&lt;p>For example, if you wanted to measure the average amount of CPU used, you could
enter &lt;code>avg:system.cpu.user&lt;/code>.&lt;/p>
&lt;h3 id="stackdriver-metrics">Stackdriver metrics&lt;/h3>
&lt;p>Please refer to the &lt;a href="https://www.spinnaker.io/guides/user/canary/config/#create-metric-groups-and-add-metrics">Spinnaker Kayenta documentation&lt;/a> for information
on configuring Stackdriver metrics.&lt;/p>
&lt;h3 id="new-relic-metrics">New Relic metrics&lt;/h3>
&lt;p>Use a NRQL Select statement (without the WHERE clause) to specify the metric to measure.
You can use &lt;a href="https://newrelic.com/products/insights">New Relic Insights&lt;/a> to find the available events and metrics. Please refer to the &lt;a href="https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/nrql-syntax-components-functions">NRQL documentation&lt;/a> for more information.&lt;/p>
&lt;h2 id="filter-templates">Filter templates&lt;/h2>
&lt;p>Please refer to the &lt;a href="https://spinnaker.io/docs/guides/user/canary/config/filter-templates/">Spinnaker Kayenta documentation&lt;/a> for information on configuring
Filter Templates. They are completely optional and may not be necessary for
your application.&lt;/p>
&lt;h2 id="scoring">Scoring&lt;/h2>
&lt;p>After adding some metrics to groups, you should see each non-empty groups in
this section, with scores defaulted to &amp;ldquo;0&amp;rdquo;. You&amp;rsquo;ll need to edit these scores
to sum to 100 (if you&amp;rsquo;ve only created a single group, just set it to 100).&lt;/p>
&lt;p>When the canary runs for a given interval, all the metrics are evaluated and
each metric is given a pass/fail based on the deviation from the baseline
metric. Within a group, each metric is evenly balanced (so if a group has
two metrics, and one fails and one passes, the group is scored at 50%; if
it had only one metric, it would score either 100% for a pass or 0% for a
fail).&lt;/p>
&lt;p>Each group is then scored their Metric Group Weight proportional to the
success of the metrics in the group. A group with a weight of 40 and a
50% failure rate would score a total of 20 (50% of 40). The score of each
group is added together for a final interval score. It&amp;rsquo;s this total score
that is compared to the Thresholds evaluation. If the total is above the
&amp;ldquo;Marginal&amp;rdquo; level, the canary will continue to run; if it&amp;rsquo;s less than the
Marginal level, the canary will stop and record a failed stage immediately.&lt;/p>
&lt;p>If the canary runs to completion, and all the intervals scored above &amp;ldquo;Pass&amp;rdquo;,
the stage will be considered a success. If &lt;em>any&lt;/em> interval fell into the
grey area between Marginal and Pass, the stage will end with a failure,
although it will not have been pre-emptively cancelled. This is intended to
allow someone to look at the marginal responses and make their own evaluation
of whether or not the pipeline should continue.&lt;/p>
&lt;h2 id="configuring-a-canary-analysis-stage">Configuring a Canary Analysis stage&lt;/h2>
&lt;p>If everything is configured properly, you should be able to create a stage
of Type &amp;ldquo;Canary Analysis&amp;rdquo;. The stage form should look like this:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-18-at-1.48.11-PM.png"/>
&lt;/figure>
&lt;p>&lt;em>Analysis Type&lt;/em>: &amp;ldquo;Real Time&amp;rdquo; (default) or &amp;ldquo;Retrospective&amp;rdquo;. If you select
Retrospective, you&amp;rsquo;ll see two additional fields appear, where you will set
the start and end time of the evaluation. This is the time period that will
be examined on &lt;em>every&lt;/em> execution of this stage, so it&amp;rsquo;s most useful for
examining historical data, or just testing your configs before applying them
to live systems.&lt;/p>
&lt;p>&lt;em>Config Name&lt;/em>: Here you select which Canary Config (which we created in the
previous section) to use.&lt;/p>
&lt;p>&lt;em>Delay&lt;/em>: It may be useful to wait a few minutes after the previous deploy
stages have completed, to let the systems get into a stable running state,
before checking metrics. This field disappears if you&amp;rsquo;ve chosen to do a
Retrospective analysis.&lt;/p>
&lt;p>&lt;em>Interval&lt;/em>: This defines the time between metrics inspections. If this is
set to 30, for example, the metrics will be compared only twice during a
1-hour canary; if set to 5, it would be inspected 12 times during a 1-hour
canary (see Lifetime, below).&lt;/p>
&lt;p>&lt;em>Lookback Type&lt;/em>: &amp;ldquo;Growing&amp;rdquo; (default) or &amp;ldquo;Sliding&amp;rdquo;. If set to &amp;ldquo;Growing&amp;rdquo;,
the metrics are queried from the start of the canary up to the time of the
interval. If set to &amp;ldquo;Sliding&amp;rdquo; (and you set the look back duration), it will
only look at the metrics for that sliding window of time.&lt;/p>
&lt;p>&lt;em>Metric Scopes&lt;/em>: See below for details on this section.&lt;/p>
&lt;p>&lt;em>Step&lt;/em>: How many seconds between each metric datapoint to query. NOTE: For
DataDog, this field is ignored (DataDog does not let you define the interval)&lt;/p>
&lt;p>&lt;em>Lifetime&lt;/em>: How many hours to let this canary analysis run before making a
final determination. Note that if any single interval falls below a
&amp;ldquo;Marginal&amp;rdquo; score, the analysis will stop immediately.&lt;/p>
&lt;p>&lt;em>Scoring Thresholds&lt;/em>: These are defaulted to whatever is configured in
the Canary Config &amp;ndash; however, you can adjust these scores on a per-pipeline
basis if desired.&lt;/p>
&lt;p>&lt;em>Metrics Account&lt;/em>: Select which account to use for metrics (if you&amp;rsquo;ve
configured multiple). NOTE: If you&amp;rsquo;ve configured multiple metrics
providers, like DataDog AND Stackdriver, be sure you&amp;rsquo;ve selected an account
that matches the Canary Config&amp;rsquo;s Metric Store. The UI currently does not
prevent you from selecting, for example, a Stackdriver account here, after
selecting a Canary Config based on Datadog.&lt;/p>
&lt;p>&lt;em>Storage Account&lt;/em>: Select which account to use for storing the metrics data
and graphs.&lt;/p>
&lt;p>&lt;em>Scope Name&lt;/em>: Select Default for now.&lt;/p>
&lt;h3 id="metric-scopes">Metric scopes&lt;/h3>
&lt;p>This section gets filled in differently, depending on which metrics provider
you&amp;rsquo;re using, and how you&amp;rsquo;ve set up your pipeline prior to this stage. For
DataDog, as an example, the intention is to provide the tag:value pairs
you&amp;rsquo;ve set up on your instances, identifying the different clusters, hosts,
etc. that you&amp;rsquo;re comparing. For example, if you&amp;rsquo;re using AWS Autoscaling
Groups to cluster your baseline and canary instances, you would enter
something like &lt;code>autoscaling_group:myapp-v001&lt;/code> for the baseline and
&lt;code>autoscaling_group:myapp-v002&lt;/code> for the canary. You can further refine
the results by appending further tag:value pairs separated by commas,
such as &lt;code>autoscaling_group:myapp-v001,region:us-west-2&lt;/code>.&lt;/p>
&lt;p>For DataDog, the two Location fields are unused and can be safely left
blank. For Stackdriver (and other metrics sources) they are required fields.&lt;/p>
&lt;p>For NewRelic, use the &amp;ldquo;Add Field&amp;rdquo; button in the &amp;ldquo;Extended Params&amp;rdquo; section to specify the &lt;code>_location_key&lt;/code> and &lt;code>_scope_key&lt;/code> for your application, both of which are appended to the NRQL query as &amp;lsquo;WHERE&amp;rsquo; clauses and will differ between the canary and baseline. When using the Kubernetes V2 provider, its recommended to install the &lt;a href="https://github.com/newrelic/k8s-metadata-injection">New Relic Kubernetes Metadata Injection&lt;/a> service to provider Kubernetes specific attributes on Transactions to make it easier to differentiate between the canary and baseline.
![Extended Params for New Relic](/images/NewRelicExtendedParams.png&amp;quot; &amp;gt;}}&lt;/p>
&lt;p>For more information on configuring these scopes, please refer to the
&lt;a href="https://www.spinnaker.io/guides/user/canary/stage/#define-the-canary-stage">Spinnaker Kayenta Documentation&lt;/a>.&lt;/p>
&lt;h3 id="automating-canary-analysis-in-a-pipeline">Automating Canary Analysis in a pipeline&lt;/h3>
&lt;p>The Kayenta stage lets you run canary analysis against pretty much anything, so
it&amp;rsquo;s hard to prescribe a specific usage that would best fit your scenario. To
give you a head start, though, take a look at this pipeline:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-20-at-2.08.37-PM.png"/>
&lt;/figure>
&lt;p>After configuration (where you would set up your automated triggers, for
example), the steps are:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Identify Baseline (Find Image from Cluster Configuration)&lt;/p>
&lt;p>In this stage, we want to find our baseline, based on what&amp;rsquo;s currently in
production. We select our production cluster and then look for the
&amp;ldquo;Oldest&amp;rdquo; enabled Server Group. This will later be referenced to act as our
baseline server group for the canary.&lt;/p>
&lt;figure>
&lt;img src="/images/[16ee274765420799d2f010fb44ac1208]_Image-2018-04-20-at-2.24.15-PM.png"/>
&lt;/figure>
&lt;/li>
&lt;li>
&lt;p>Bake&lt;/p>
&lt;p>This is where we actually bake the Canary image, otherwise just like any
other bake stage.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Deploy Canary (Deploy)&lt;/p>
&lt;p>Here we deploy the baked image to our cluster. The important note here
is that we select the &amp;ldquo;None&amp;rdquo; strategy &amp;ndash; we don&amp;rsquo;t want Spinnaker to do
anything to the existing server group yet, we want to run the new image
alongside the old image.&lt;/p>
&lt;figure>
&lt;img src="/images/[3683fd1f7f0f72a94e511d9b65f5dce5]_Image-2018-04-20-at-2.22.42-PM.png"/>
&lt;/figure>
&lt;/li>
&lt;li>
&lt;p>Canary Analysis&lt;/p>
&lt;p>We configure our canary analysis stage as described above. In this
example, we can get the baseline server group name using SpEL:&lt;/p>
&lt;p>&lt;code>${ #stage('Identify Baseline')['context']['artifacts'][0]['metadata']['sourceServerGroup'] }&lt;/code>&lt;/p>
&lt;p>(For Datadog, we want to prepend &lt;code>autoscaling_group:&lt;/code> to
this so we get the correct Datadog tag.)&lt;/p>
&lt;p>The canary server group can be retrieved with the SpEL:&lt;/p>
&lt;p>&lt;code>${ deployedServerGroups[0].serverGroup }&lt;/code>&lt;/p>
&lt;p>(again, we prepend &lt;code>autoscaling_group:&lt;/code> to construct the tag for Datadog)&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-20-at-2.19.17-PM.png"/>
&lt;/figure>
&lt;p>We also need to be sure that we don&amp;rsquo;t stop the pipeline execution if the
canary fails &amp;ndash; we want to be able to &amp;ldquo;clean up&amp;rdquo; after a failure, so we
don&amp;rsquo;t keep the bad canary alive longer than we need to:&lt;/p>
&lt;figure>
&lt;img src="/images/[41b5e2d8d228eae3e13bdbfaa4b307c6]_Image-2018-04-20-at-2.37.35-PM.png"/>
&lt;/figure>
&lt;/li>
&lt;li>
&lt;p>Destroy Canary on Failure (Destroy Server Group)&lt;/p>
&lt;p>The first of two options after the Canary Analysis, we run this conditional
on the Canary Analysis stage being in any state other than &lt;code>SUCCEEDED&lt;/code> &amp;ndash;
when the canary fails to pass its testing, we want to remove the failed
canary server group. So here we destroy the &amp;ldquo;Newest Server Group&amp;rdquo; (the
canary) and clean up, leaving the existing good cluster intact.&lt;/p>
&lt;figure>
&lt;img src="/images/[d8482e840534fe6d2dfa2f4d377f499b]_Image-2018-04-20-at-2.27.00-PM.png"/>
&lt;/figure>
&lt;figure>
&lt;img src="/images/Image-2018-04-20-at-3.38.20-PM.png"/>
&lt;/figure>
&lt;/li>
&lt;li>
&lt;p>Promote Canary on Success (Destroy Server Group)&lt;/p>
&lt;p>If our canary survives the coal mine, we want to deprecate the older code
in favor of the cluster. In this simplistic version, we&amp;rsquo;re presuming both
clusters are the same size, so all we need to do is remove the old cluster;
a real production pipeline would probably need to resize the canary before
removing the old cluster. It&amp;rsquo;s the same basic logic as the previous stage,
except we are destroying the &amp;ldquo;Oldest Server Group&amp;rdquo; (the same way we ID&amp;rsquo;d
the baseline in the first stage), conditional on the Canary Analysis stage
ending with &lt;code>SUCCEEDED&lt;/code>:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-20-at-2.32.44-PM.png"/>
&lt;/figure>
&lt;figure>
&lt;img src="/images/Image-2018-04-20-at-3.39.14-PM.png"/>
&lt;/figure>
&lt;/li>
&lt;li>
&lt;p>Check Preconditions&lt;/p>
&lt;p>The purpose of this stage here is to simply fail the pipeline if the canary
fails to pass. Since we are ignoring the failure on the Canary Analysis
stage in order to proceed to our cleanup/promotion stages, we want this
stage to fail if the canary failed. Here we just check that the Canary
Analysis stage succeeded (and if it did not, it will fail the pipeline).&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2018-04-20-at-2.35.22-PM.png"/>
&lt;/figure>
&lt;/li>
&lt;/ol>
&lt;p>This should give you some idea of how you might want to integrate the Kayenta
Canary Analysis stage into your production pipelines, and automate your
deployments!&lt;/p></description></item><item><title>Continuous-Deployment: Use Canary Analysis with AWS CloudWatch</title><link>/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-cloudwatch/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-cloudwatch/</guid><description>
&lt;p>&lt;img src="/images/proprietary.svg" alt="Proprietary">&lt;/p>
&lt;!-- add note in case redirect from search engine results click doesn't work -->
&lt;p>You can access the AWS Cloudwatch content in the AWS CloudWatch Metrics Plugin &lt;a href="/plugins/aws-cloudwatch/overview/">guide&lt;/a>.&lt;/p></description></item><item><title>Continuous-Deployment: Use Canary Analysis with Dynatrace in Spinnaker</title><link>/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-dynatrace/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-dynatrace/</guid><description>
&lt;p>&lt;img src="/images/proprietary.svg" alt="Proprietary">&lt;/p>
&lt;p>Before you can start using canary deployments, you need to enable Kayenta, the Spinnaker&lt;sup>TM&lt;/sup> service for canary deployments. For more information, see the &lt;a href="/continuous-deployment/armory-admin/kayenta-configure/"}>Configure Automated Canary Deployments in Spinnaker&lt;/a> guide.&lt;/p>
&lt;h2 id="dynatrace-configuration">Dynatrace configuration&lt;/h2>
&lt;p>To enable Dynatrace, add the following &lt;code>dynatrace&lt;/code> entry to &lt;code>kayenta-local.yml&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kayenta&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">dynatrace&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accounts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: my-dynatrace-account
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">endpoint&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">baseUrl&lt;/span>: &amp;lt;Your Dynatrace url&amp;gt; https://xxxxxxxx.live.dynatrace.com
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">apiToken&lt;/span>: &amp;lt;Your Dynatrace apiToken&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">supportedTypes&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - METRICS_STORE
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="canary-configs">Canary configs&lt;/h2>
&lt;p>In the UI, you need to create a new canary config for the metrics you are interested in.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/canary/canary_config_dynatrace.png"/>
&lt;/figure>
&lt;p>Add your Dynatrace query in the &lt;strong>Dynatrace USQL&lt;/strong> field.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/canary/canary_config_dynatrace_query.png"/>
&lt;/figure>
&lt;h2 id="pipeline-configs">Pipeline configs&lt;/h2>
&lt;p>In your canary stage, set up the canary config you just created. Then use the application values from Dynatrace to fill in the &lt;strong>Baseline + Canary Pair&lt;/strong> and &lt;strong>MetricScope&lt;/strong> fields.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/canary/canary_stage_dynatrace.png"/>
&lt;/figure></description></item></channel></rss>