Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(cloudwatch): Add docs for the new CloudWatch Metrics plugin #2256

Merged
merged 6 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,26 @@

## Kayenta Overview

Kayenta is the Spinnaker service that performs Automated Canary Analysis (ACA). The goal of Kayenta is to provide the end user with confidence that a deployment is safe through automation and intelligence. For information about how to use Canary deployments, see {{< linkWithTitle "kayenta-canary-use" >}}.
Kayenta is the Spinnaker service that performs automated canary analysis. The goal of Kayenta is to provide you with confidence that a deployment is safe through automation and intelligence.

## Enable Kayenta

Add the following to your `SpinnakerService` manifest:

```yaml
spec:
spinnakerConfig:
config:
canary:
enabled: true # Enable/disable canary analysis
```

## Configure Kayenta

The following example is a `SpinnakerService` manifest. The example config uses Datadog as the metrics provider and stores canary configs and analysis in a GCS bucket:

> For information about how to configure other providers see [Canary Config]({{< ref "canary-op-config" >}}) unless you use Dynatrace or AWS CloudWatch. If you use one of those as the metrics provider, see [Use Canary Analysis with Dynatrace]({{< ref "kayenta-canary-dynatrace" >}}) or [Use Canary Analysis with AWS CloudWatch]({{< ref "kayenta-canary-cloudwatch" >}}).

```yaml
apiversion: spinnaker.io/{{< param operator-extended-crd-version >}}
apiversion: spinnaker.armory.io/{{< param operator-extended-crd-version >}}
kind: SpinnakerService
metadata:
name: spinnaker
Expand Down Expand Up @@ -66,3 +76,10 @@
gcp-sa.json: |
<JSON CONTENT HERE. WATCH YOUR SPACING>
```

For an overview of how to configure metrics providers see [Canary Config]({{< ref "continuous-deployment/installation/armory-operator/op-manifest-reference/canary-op-config" >}}). For Dynatrace and AWS Cloudwatch providers, see [Use Canary Analysis with Dynatrace]({{< ref "continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-dynatrace" >}}) or [AWS CloudWatch Integration Plugin]({{< ref "plugins/aws-cloudwatch/overview.md" >}}).


## {{% heading "nextSteps" %}}

Check warning on line 83 in content/en/continuous-deployment/armory-admin/kayenta-configure.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/continuous-deployment/armory-admin/kayenta-configure.md#L83

[Google.Headings] '{{% heading "nextSteps" %}}' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '{{% heading \"nextSteps\" %}}' should use sentence-style capitalization.", "location": {"path": "content/en/continuous-deployment/armory-admin/kayenta-configure.md", "range": {"start": {"line": 83, "column": 4}}}, "severity": "WARNING"}

For information about how to use canary deployments, see {{< linkWithTitle "continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use" >}}.
Original file line number Diff line number Diff line change
Expand Up @@ -52,44 +52,6 @@ canary:
accounts:
```

### AWS

```yaml
- name:
enabled:
accounts:
- name:
bucket:
region:
rootFolder:
profileName:
endpoint:
accessKeyId:
secretAccessKey:
supportedTypes:
- METRICS_STORE
- CONFIGURATION_STORE
- OBJECT_STORE
s3Enabled:
```

- `name`: aws
- `enabled`: true or false
- `accounts`:
- `name`: account name
- `bucket`: The name of a storage bucket that your specified account has access to. If you specify a globally unique bucket name that doesn't exist yet, Kayenta will create that bucket for you.
- `region`: The region to use.
- `rootFolder`: The root folder in the chosen bucket to place all of the canary service's persistent data in (Default: kayenta).
- `profileName`: The profile name to use when resolving AWS credentials. Typically found in ~/.aws/credentials (Default: default).
- `endpoint`: The endpoint used to reach the service implementing the AWS api. Typical use is with Minio.
- `accessKeyId`: The default access key used to communicate with AWS.
- `secretAccessKey`: The secret key used to communicate with AWS. Supports encrypted value.
- `supportedTypes`: One of: `METRICS_STORE`, `METRICS_STORE`, `OBJECT_STORE`
- METRICS_STORE
- CONFIGURATION_STORE
- OBJECT_STORE
- `s3Enabled`: true or false; whether or not to enable S3 as a persistent store (Default: `false`).

### Datadog

```yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,76 +1,12 @@
---
title: Use Canary Analysis with AWS CloudWatch
manualLinkRelRef: "plugins/aws-cloudwatch/overview.md"
exclude_search: true
description: >
Learn how to configure and use AWS CloudWatch for canary analysis in Spinnaker.
---
![Proprietary](/images/proprietary.svg)
{{< include "user-guide/canary/config-kayenta-frag.md" >}}

## CloudWatch configuration
<!-- add note in case redirect from search engine results click doesn't work -->

To enable [CloudWatch](https://aws.amazon.com/cloudwatch/), update the AWS configuration entry in your `kayenta-local.yml` file. Make sure `METRICS_STORE` is listed under `supportedTypes`. Add the `cloudwatch` entry with `enabled: true`.

The example below uses S3 as the object store and CloudWatch as the metrics store.

```yaml
kayenta:
aws:
enabled: true
accounts:
- name: monitoring
bucket: <your-s3-bucket>
region: <your-region>
# Kayenta can assume a role when connecting to Cloudwatch using the iamRole configs
# iamRoleArn: <your-role-ARN> # For example arn:aws:iam::042225624470:role/theRole
# iamRoleExternalId: Optional. For example 12345
# iamRoleArnTarget: <your-role-ARN-target> # For example arn:aws:iam::042225624470:role/targetcloudwatchaccount
# iamRoleExternalIdTarget: <your-ExternalID> # Optional. For example 84475
rootFolder: kayenta
roleName: default
supportedTypes:
- OBJECT_STORE
- CONFIGURATION_STORE
- METRICS_STORE
cloudwatch:
enabled: true
s3:
enabled: true
```

## Canary configs

In the UI, you need to create a new canary config for the metrics you are interested in.

{{< figure src="/images/user-guides/canary/cloudwatch/canary_config_cloudwatch.png" >}}

Add your Cloudwatch MetricStat JSON in the **Template** field.

```json
{
"Metric": {
"Namespace": "kayenta",
"MetricName": "integration.test.cpu.value",
"Dimensions": [
{
"Name": "scope",
"Value": "myapp-prod-canary-2"
},
{
"Name": "namespace",
"Value": "prod-namespace-2"
}
]
},
"Period": 300,
"Stat": "Average",
"Unit": "None"
}
```

{{< figure src="/images/user-guides/canary/cloudwatch/canary_config_cloudwatch_query.png" >}}

## Pipeline configs

In your canary stage, set up the canary config you just created. Then use the application values from CloudWatch to fill in the **Baseline + Canary Pair** and **MetricScope** fields.

{{< figure src="/images/user-guides/canary/cloudwatch/canary_stage_cloudwatch.png" >}}
You can access the AWS Cloudwatch content in the AWS CloudWatch Metrics Plugin [guide]({{< ref "plugins/aws-cloudwatch/overview.md" >}}).
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,55 @@
Learn how to configure and use Kayenta for Automatic Canary Analysis in Spinnaker.
---

{{< include "user-guide/canary/config-kayenta-frag.md" >}}

## Overview of Kayenta for Automated Canary Analysis
## Overview of Kayenta for automated canary analysis

Kayenta is the Spinnaker service that performs Automated Canary Analysis (ACA). The goal of Kayenta is to provide the end user with confidence that a deployment is safe through automation and intelligence.
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.

Kayenta uses real-time data sources to validate that a canary is good or bad. Today, Kayenta supports the following real-time data sources:
Kayenta uses real-time data sources to validate that a canary is good or bad. Kayenta supports the following real-time data sources:

* DataDog
* Stackdriver (Google)
* Prometheus
* New Relic
* Dynatrace (Armory feature)
* CloudWatch (Armory feature)
* Dynatrace
* AWS CloudWatch
aimeeu marked this conversation as resolved.
Show resolved Hide resolved

## Configuring Kayenta on an application
## {{% heading "prereq" %}}

Check warning on line 24 in content/en/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use.md#L24

[Google.Headings] '{{% heading "prereq" %}}' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '{{% heading \"prereq\" %}}' should use sentence-style capitalization.", "location": {"path": "content/en/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use.md", "range": {"start": {"line": 24, "column": 4}}}, "severity": "WARNING"}

{{< include "user-guide/canary/config-kayenta-frag.md" >}}

If Kayenta is enabled for your instance, if you go to an application's config
you should see a checkbox to enable Canarying:
## Configuring Kayenta on an app

When Kayenta is enabled for your instance, you should see a **Canary** option in your app's config section:

{{< figure src="/images/Image-2018-10-23-at-3.25.33-PM.png" >}}

Make sure it's checked and saved.
Check **Canary** and save.

If you don't see this option in your application config, make sure you've [configured Kayenta](https://www.spinnaker.io/guides/user/canary/).

You can also find more information about Kayenta on [Automated Canary Deployments]({{< ref "kayenta-configure" >}}).

In this document, we will quickly run through the process to simply get you going.
You can also find more information about Kayenta in [Automated Canary Deployments]({{< ref "continuous-deployment/armory-admin/kayenta-configure" >}}).

## Canary configs

NOTE: You may need to refresh your browser page to see these changes
after enabling the Canary above.
>You may need to refresh your browser page to see your changes.

Your menubar should show "Delivery" and you should see the option for
"Canary Configs" as a hover, or as a submenu element:
Your menubar should show **Delivery** and you should see the option for **Canary Configs** as a hover, or as a submenu element:

{{< figure src="/images/[069c7e1865637f78eb92a091172c92da]_Image-2018-04-18-at-12.45.18-PM.png" >}}

Click on "Canary Configs" and "Add configuration". You should see a
mostly-blank form:

{{< figure src="/images/Image-2018-04-18-at-12.56.54-PM.png" >}}
Click on **Canary Configs** and **Add configuration**. You should see form similar to this:

*Configuration Name*: Spaces are not allowed, only alphanumerics, hyphens and
underscores. This name will be displayed as an option in the canary stage
configuration later, so we recommend you make it a meaningful name.
{{< figure src="/images/Image-2018-04-18-at-12.56.54-PM.png" width="80%" height="80%" >}}

*Metric Store*: If you only configured one metrics store, this will already
be set for you. Otherwise, you can choose from the options, the default will
be the one you referenced in the environment file.
**Configuration Name**: Spaces are not allowed, only alphanumerics, hyphens and

Check warning on line 52 in content/en/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use.md#L52

[Google.OxfordComma] Use the Oxford comma in ' Spaces are not allowed, only alphanumerics, hyphens and '.
Raw output
{"message": "[Google.OxfordComma] Use the Oxford comma in ' Spaces are not allowed, only alphanumerics, hyphens and '.", "location": {"path": "content/en/continuous-deployment/spinnaker-user-guides/canary/kayenta-canary-use.md", "range": {"start": {"line": 52, "column": 24}}}, "severity": "WARNING"}
underscores. This name is displayed as an option in the canary stage configuration later, so choose a meaningful name.

*Description*: Free form text to help your coworkers know what this canary
is doing.
**Metric Store**: 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.

Note: If you see the following error `The was an error saving your config: 400` when you are trying to save your "Canary Config", add the following setting:
**Description**: Free form text to help your coworkers know what this canary is doing.

In your Armory Operator's `SpinnakerService` manifest, add the following snippet:
If you see the following error `The was an error saving your config: 400` when you are trying to save your canary config, add the following setting in your `SpinnakerService` manifest:

```yaml
apiVersion: spinnaker.armory.io/{{< param operator-extended-crd-version >}}
Expand Down
1 change: 1 addition & 0 deletions content/en/includes/plugins/plugin-compat-matrix.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
| Plugin | Spinnaker | Armory CD |
|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------:|:----------------------------------:|
| [Armory CD-as-a-Service Plugin](https://developer.armory.io/docs/integrations/plugin-spinnaker)<br>The Armory Continuous Deployment-as-a-Service plugin enables performing canary and blue/green deployments in a single stage from Spinnaker to your Kubernetes deployment target using CD-as-a-Service. | 1.24+ | 2.24+<br>(included with Armory CD) |
| {{< linkWithLinkTitle "plugins/aws-cloudwatch/_index.md" >}}<br>{{% getPageDesc "/plugins/aws-cloudwatch/_index.md" %}} | 1.33+ | - |
| {{< linkWithLinkTitle "plugins/aws-event-cache/_index.md" >}}<br>{{% getPageDesc "/plugins/aws-event-cache/_index.md" %}} | 1.28+ | 2.28+ |
| {{< linkWithLinkTitle "plugins/echo-event-filter.md" >}}<br>{{% getPageDesc "/plugins/echo-event-filter.md" %}} | 1.29+ | 2.30+ |
| {{< linkWithLinkTitle "plugins/github-integration/_index.md" >}}<br>{{% getPageDesc "/plugins/github-integration/_index.md" %}} | 1.30+ | 2.30+ |
Expand Down
8 changes: 8 additions & 0 deletions content/en/plugins/aws-cloudwatch/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: AWS CloudWatch Integration Plugin
linkTitle: AWS CloudWatch Integration
description: >
The AWS CloudWatch Integration Plugin for Spinnaker enables using AWS CloudWatch as a metrics provider for your canary deployments in Spinnaker and Armory Continuous Deployment.
---

![Proprietary](/images/proprietary.svg) ![Beta](/images/beta.svg)
19 changes: 19 additions & 0 deletions content/en/plugins/aws-cloudwatch/armory-cd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Enable and Use the AWS CloudWatch Integration Plugin in Armory CD
linkTitle: Armory CD Enable
description: >
Enable and use the AWS CloudWatch Integration Plugin in your Armory Continuous Deployment instance.
---


## {{% heading "prereq" %}}

Check warning on line 9 in content/en/plugins/aws-cloudwatch/armory-cd.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/aws-cloudwatch/armory-cd.md#L9

[Google.Headings] '{{% heading "prereq" %}}' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '{{% heading \"prereq\" %}}' should use sentence-style capitalization.", "location": {"path": "content/en/plugins/aws-cloudwatch/armory-cd.md", "range": {"start": {"line": 9, "column": 4}}}, "severity": "WARNING"}

Before you can start using canary deployments, you need to enable Kayenta, the Spinnaker<sup>TM</sup> service for canary deployments. For more information, see the {{< linkWithTitle "continuous-deployment/armory-admin/kayenta-configure.md" >}} guide.

## Enable AWS CloudWatch as a metrics store

Check warning on line 13 in content/en/plugins/aws-cloudwatch/armory-cd.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/aws-cloudwatch/armory-cd.md#L13

[Google.Headings] 'Enable AWS CloudWatch as a metrics store' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Enable AWS CloudWatch as a metrics store' should use sentence-style capitalization.", "location": {"path": "content/en/plugins/aws-cloudwatch/armory-cd.md", "range": {"start": {"line": 13, "column": 4}}}, "severity": "WARNING"}

{{< readfile "/plugins/aws-cloudwatch/files/enable-cloudwatch-as-metrics.md" >}}

## Use AWS CloudWatch

Check warning on line 17 in content/en/plugins/aws-cloudwatch/armory-cd.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/aws-cloudwatch/armory-cd.md#L17

[Google.Headings] 'Use AWS CloudWatch' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Use AWS CloudWatch' should use sentence-style capitalization.", "location": {"path": "content/en/plugins/aws-cloudwatch/armory-cd.md", "range": {"start": {"line": 17, "column": 4}}}, "severity": "WARNING"}

{{< readfile "/plugins/aws-cloudwatch/files/use-aws-cloudwatch.md" >}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
To enable [AWS CloudWatch](https://aws.amazon.com/cloudwatch/), update the AWS configuration entry in your `kayenta-local.yml` file. Make sure `METRICS_STORE` is listed under `supportedTypes`. Add the `cloudwatch` entry with `enabled: true`.

This example uses S3 as the object store and CloudWatch as the metrics store.

```yaml
kayenta:
aws:
enabled: true
accounts:
- name: monitoring
bucket: <your-s3-bucket>
region: <your-region>
# Kayenta can assume a role when connecting to Cloudwatch using the iamRole configs
# iamRoleArn: <your-role-ARN> # For example arn:aws:iam::042225624470:role/theRole
# iamRoleExternalId: Optional. For example 12345
# iamRoleArnTarget: <your-role-ARN-target> # For example arn:aws:iam::042225624470:role/targetcloudwatchaccount
# iamRoleExternalIdTarget: <your-ExternalID> # Optional. For example 84475
rootFolder: kayenta
roleName: default
supportedTypes:
- OBJECT_STORE
- CONFIGURATION_STORE
- METRICS_STORE
cloudwatch:
enabled: true
s3:
enabled: true
```
3 changes: 3 additions & 0 deletions content/en/plugins/aws-cloudwatch/files/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
headless: true
---
38 changes: 38 additions & 0 deletions content/en/plugins/aws-cloudwatch/files/use-aws-cloudwatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

### Create a canary config

In the UI, you need to create a new canary config for the metrics you are interested in.

{{< figure src="/plugins/aws-cloudwatch/files/canary_config_cloudwatch.png" height="80%" width="80%" >}}

Add your Cloudwatch MetricStat JSON in the **Template** field.

```json
{
"Metric": {
"Namespace": "kayenta",
"MetricName": "integration.test.cpu.value",
"Dimensions": [
{
"Name": "scope",
"Value": "myapp-prod-canary-2"
},
{
"Name": "namespace",
"Value": "prod-namespace-2"
}
]
},
"Period": 300,
"Stat": "Average",
"Unit": "None"
}
```

{{< figure src="/plugins/aws-cloudwatch/files/canary_config_cloudwatch_query.png" height="80%" width="80%" >}}

### Update pipeline configs

In your canary stage, set up the canary config you just created. Then use the app values from AWS CloudWatch to fill in the **Baseline + Canary Pair** and **MetricScope** fields.

{{< figure src="/plugins/aws-cloudwatch/files/canary_stage_cloudwatch.png" height="80%" width="80%" >}}
Loading
Loading