Skip to content

Commit

Permalink
Replaced AWS CloudWatch with Amazon CloudWatch. (#18463)
Browse files Browse the repository at this point in the history
  • Loading branch information
florence-crl committed Apr 10, 2024
1 parent 255b045 commit 968512f
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/current/cockroachcloud/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Cluster Operators can perform a variety of cluster functions:
- [Export a cluster's logs]({% link cockroachcloud/export-logs.md %}).
- [Export a cluster's metrics]({% link cockroachcloud/export-metrics.md %}).
- [View and configure a cluster's Egress Rules]({% link cockroachcloud/egress-perimeter-controls.md %}).
- [Configure the export of metrics to DataDog or AWS CloudWatch]({% link cockroachcloud/export-metrics.md %}).
- [Configure the export of metrics to DataDog or Amazon CloudWatch]({% link cockroachcloud/export-metrics.md %}).

This role can be considered a more restricted alternative to [Cluster Administrator](#cluster-administrator), as it grants all of the permissions of that role, except that it does **not** allow users to:

Expand Down
44 changes: 22 additions & 22 deletions src/current/cockroachcloud/export-metrics-advanced.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Export Metrics From a CockroachDB Advanced Cluster
summary: Export Metrics From a CockroachDB Advanced Cluster to AWS CloudWatch, Datadog, or Prometheus
summary: Export Metrics From a CockroachDB Advanced Cluster to Amazon CloudWatch, Datadog, or Prometheus
toc: true
docs_area: manage
cloud: true
---

CockroachDB {{ site.data.products.advanced }} users can use the [Cloud API]({% link cockroachcloud/cloud-api.md %}) to configure metrics export to [AWS CloudWatch](https://aws.amazon.com/cloudwatch/), [Datadog](https://www.datadoghq.com/), or [Prometheus](https://prometheus.io/). Once the export is configured, metrics will flow from all nodes in all regions of your CockroachDB {{ site.data.products.advanced }} cluster to your chosen cloud metrics sink.
CockroachDB {{ site.data.products.advanced }} users can use the [Cloud API]({% link cockroachcloud/cloud-api.md %}) to configure metrics export to [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/), [Datadog](https://www.datadoghq.com/), or [Prometheus](https://prometheus.io/). Once the export is configured, metrics will flow from all nodes in all regions of your CockroachDB {{ site.data.products.advanced }} cluster to your chosen cloud metrics sink.

{{site.data.alerts.callout_success}}
To export metrics from a CockroachDB {{ site.data.products.core }} cluster, refer to [Monitoring and Alerting](https://www.cockroachlabs.com/docs/{{site.current_cloud_version}}/monitoring-and-alerting) instead of this page.
{{site.data.alerts.end}}

Exporting metrics to AWS CloudWatch is only available on CockroachDB {{ site.data.products.advanced }} clusters which are hosted on AWS. Metrics export to Datadog and Prometheus is supported on all CockroachDB {{ site.data.products.advanced }} clusters.
Exporting metrics to Amazon CloudWatch is only available on CockroachDB {{ site.data.products.advanced }} clusters which are hosted on AWS. Metrics export to Datadog and Prometheus is supported on all CockroachDB {{ site.data.products.advanced }} clusters.

{{site.data.alerts.callout_info}}
{% include_cached feature-phases/preview.md %}
Expand All @@ -26,7 +26,7 @@ To configure and manage metrics export for your CockroachDB {{ site.data.product

Cloud metrics sink | Metrics export endpoint
------------------ | ----------------------------------------------------
AWS Cloudwatch | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/cloudwatch`
Amazon CloudWatch | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/cloudwatch`
Datadog | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/datadog`
Prometheus | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/prometheus`

Expand All @@ -38,29 +38,29 @@ Method | Required permissions | Description
--- | --- | ---
`GET` | `ADMIN`, `EDIT`, or `READ` | Returns the current status of the metrics export configuration.
`POST` | `ADMIN` or `EDIT` | Enables metrics export, or updates an existing metrics export configuration.
`DELETE` | `ADMIN` | Disables metrics export, halting all metrics export to AWS CloudWatch, Datadog, or Prometheus.
`DELETE` | `ADMIN` | Disables metrics export, halting all metrics export to Amazon CloudWatch, Datadog, or Prometheus.

See [Service accounts]({% link cockroachcloud/managing-access.md %}#manage-service-accounts) for instructions on configuring a service account with these required permissions.

## Enable metrics export

<div class="filters clearfix">
<button class="filter-button" data-scope="aws-metrics-export">AWS CloudWatch</button>
<button class="filter-button" data-scope="aws-metrics-export">Amazon CloudWatch</button>
<button class="filter-button" data-scope="datadog-metrics-export">Datadog</button>
<button class="filter-button" data-scope="prometheus-metrics-export">Prometheus</button>
</div>

<section class="filter-content" markdown="1" data-scope="aws-metrics-export">

Exporting metrics to AWS CloudWatch is only available on CockroachDB {{ site.data.products.advanced }} clusters which are hosted on AWS. If your CockroachDB {{ site.data.products.advanced }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead.
Exporting metrics to Amazon CloudWatch is only available on CockroachDB {{ site.data.products.advanced }} clusters which are hosted on AWS. If your CockroachDB {{ site.data.products.advanced }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead.

{{site.data.alerts.callout_info}}
Enabling metrics export will send around 250 metrics per node to AWS CloudWatch. Review the [AWS CloudWatch documentation](https://aws.amazon.com/cloudwatch/pricing/) to gauge how this adds to your AWS CloudWatch spend.
Enabling metrics export will send around 250 metrics per node to Amazon CloudWatch. Review the [Amazon CloudWatch documentation](https://aws.amazon.com/cloudwatch/pricing/) to gauge how this adds to your Amazon CloudWatch spend.
{{site.data.alerts.end}}

Perform the following steps to enable metrics export from your CockroachDB {{ site.data.products.advanced }} cluster to AWS CloudWatch.
Perform the following steps to enable metrics export from your CockroachDB {{ site.data.products.advanced }} cluster to Amazon CloudWatch.

1. Create the desired target AWS CloudWatch log group by following the [Create a log group in CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#Create-Log-Group) instructions. If you already have a log group created, you may skip this step. When your CockroachDB {{ site.data.products.advanced }} cluster emits metrics to AWS CloudWatch, they are written to this log group.
1. Create the desired target Amazon CloudWatch log group by following the [Create a log group in CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#Create-Log-Group) instructions. If you already have a log group created, you may skip this step. When your CockroachDB {{ site.data.products.advanced }} cluster emits metrics to Amazon CloudWatch, they are written to this log group.

1. Find your CockroachDB {{ site.data.products.advanced }} cluster ID:

Expand Down Expand Up @@ -124,7 +124,7 @@ Perform the following steps to enable metrics export from your CockroachDB {{ si

Where:
- `{your_aws_acct_id}` is the AWS Account ID of the AWS account where you created the `CockroachCloudMetricsExportRole` role, **not** the cloud provider account ID of your CockroachDB {{ site.data.products.advanced }} cluster from step 3. You can find your AWS Account ID on the AWS [IAM page](https://console.aws.amazon.com/iam/).
- `{log_group_name}` is the target AWS CloudWatch log group you created in step 1.
- `{log_group_name}` is the target Amazon CloudWatch log group you created in step 1.

This defines the set of permissions that the CockroachDB {{ site.data.products.advanced }} metrics export feature requires to be able to write metrics to CloudWatch.

Expand All @@ -145,7 +145,7 @@ Perform the following steps to enable metrics export from your CockroachDB {{ si
- `{secret_key}` is your CockroachDB {{ site.data.products.advanced }} API key. See [API Access]({% link cockroachcloud/managing-access.md %}) for instructions on generating this key.
- `{aws_region}` is your AWS region, like `us-east-1`.
- `{role_arn}` is the ARN for the `CockroachCloudMetricsExportRole` role you copied in step 7. If you used a different role name there, be sure to use your role name in place of `CockroachCloudMetricsExportRole` in the above command.
- `{log_group_name}` is the target AWS CloudWatch log group you created in step 1. This **must** be the same group name you provided in step 6.
- `{log_group_name}` is the target Amazon CloudWatch log group you created in step 1. This **must** be the same group name you provided in step 6.

Specifying an AWS region (to `{aws_region}`) that you do not have a cluster in, or a region that only partially covers your cluster's nodes will result in missing metrics.

Expand All @@ -160,7 +160,7 @@ Perform the following steps to enable metrics export from your CockroachDB {{ si

Run the command periodically until the command returns a status of `ENABLED`, at which point the configuration across all nodes is complete, and metrics will begin appearing in CloudWatch under the log group you created in step 1. Since the configuration is applied to cluster nodes in a rolling fashion, you may see some metrics appear even before the `GET` command returns an `ENABLED` status.

1. Once metrics export has been enabled, you can access metrics from your CockroachDB {{ site.data.products.advanced }} cluster directly in [AWS CloudWatch](https://console.aws.amazon.com/cloudwatch/home).
1. Once metrics export has been enabled, you can access metrics from your CockroachDB {{ site.data.products.advanced }} cluster directly in [Amazon CloudWatch](https://console.aws.amazon.com/cloudwatch/home).

</section>

Expand Down Expand Up @@ -328,14 +328,14 @@ A subset of CockroachDB metrics require that you explicitly [enable percentiles]
## Monitor the status of a metrics export configuration

<div class="filters clearfix">
<button class="filter-button" data-scope="aws-metrics-export">AWS CloudWatch</button>
<button class="filter-button" data-scope="aws-metrics-export">Amazon CloudWatch</button>
<button class="filter-button" data-scope="datadog-metrics-export">Datadog</button>
<button class="filter-button" data-scope="prometheus-metrics-export">Prometheus</button>
</div>

<section class="filter-content" markdown="1" data-scope="aws-metrics-export">

To check the status of an existing AWS Cloudwatch metrics export configuration, use the following Cloud API command:
To check the status of an existing Amazon CloudWatch metrics export configuration, use the following Cloud API command:

{% include_cached copy-clipboard.html %}
~~~shell
Expand Down Expand Up @@ -389,19 +389,19 @@ Where:

## Update an existing metrics export configuration

To update an existing CockroachDB {{ site.data.products.advanced }} metrics export configuration, make any necessary changes to your cloud provider configuration (e.g., AWS CloudWatch, Datadog, or Prometheus), then issue the same `POST` Cloud API command as shown in the [Enable metrics export](#enable-metrics-export) instructions for your cloud provider with the desired updated configuration. Follow the [Monitor the status of a metrics export configuration](#monitor-the-status-of-a-metrics-export-configuration) instructions to ensure the update completes successfully.
To update an existing CockroachDB {{ site.data.products.advanced }} metrics export configuration, make any necessary changes to your cloud provider configuration (e.g., Amazon CloudWatch, Datadog, or Prometheus), then issue the same `POST` Cloud API command as shown in the [Enable metrics export](#enable-metrics-export) instructions for your cloud provider with the desired updated configuration. Follow the [Monitor the status of a metrics export configuration](#monitor-the-status-of-a-metrics-export-configuration) instructions to ensure the update completes successfully.

## Disable metrics export

<div class="filters clearfix">
<button class="filter-button" data-scope="aws-metrics-export">AWS CloudWatch</button>
<button class="filter-button" data-scope="aws-metrics-export">Amazon CloudWatch</button>
<button class="filter-button" data-scope="datadog-metrics-export">Datadog</button>
<button class="filter-button" data-scope="prometheus-metrics-export">Prometheus</button>
</div>

<section class="filter-content" markdown="1" data-scope="aws-metrics-export">

To disable an existing AWS Cloudwatch metrics export configuration, and stop sending metrics to Cloudwatch, use the following Cloud API command:
To disable an existing Amazon CloudWatch metrics export configuration, and stop sending metrics to Cloudwatch, use the following Cloud API command:

{% include_cached copy-clipboard.html %}
~~~shell
Expand Down Expand Up @@ -455,18 +455,18 @@ Where:

## Limitations

- Metrics export to AWS CloudWatch is only available on CockroachDB {{ site.data.products.advanced }} clusters which are hosted on AWS. If your CockroachDB {{ site.data.products.advanced }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead.
- AWS CloudWatch does not currently support histograms. Any histogram-type metrics emitted from your CockroachDB {{ site.data.products.advanced }} cluster are dropped by CloudWatch. See [Prometheus metric type conversion](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-metrics-conversion.html) for more information, and [Logging dropped Prometheus metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-troubleshooting-EKS.html#ContainerInsights-Prometheus-troubleshooting-droppedmetrics) for instructions on tracking dropped histogram metrics in CloudWatch.
- Metrics export to Amazon CloudWatch is only available on CockroachDB {{ site.data.products.advanced }} clusters which are hosted on AWS. If your CockroachDB {{ site.data.products.advanced }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead.
- Amazon CloudWatch does not currently support histograms. Any histogram-type metrics emitted from your CockroachDB {{ site.data.products.advanced }} cluster are dropped by CloudWatch. See [Prometheus metric type conversion](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-metrics-conversion.html) for more information, and [Logging dropped Prometheus metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-troubleshooting-EKS.html#ContainerInsights-Prometheus-troubleshooting-droppedmetrics) for instructions on tracking dropped histogram metrics in CloudWatch.

## Troubleshooting

### AWS CloudWatch
### Amazon CloudWatch

Be sure you are providing **your own** AWS Account ID as shown on the AWS [IAM page](https://console.aws.amazon.com/iam/) to step 6, **not** the AWS cloud provider account ID as returned from step 3.

If you are using an existing AWS role, or are otherwise using a role name different from the example name used in this tutorial, be sure to use your own role name in step 8 in place of `CockroachCloudMetricsExportRole`.

Your CockroachDB {{ site.data.products.advanced }} cluster must be running on AWS (not GCP or Azure) to make use of metrics export to AWS CloudWatch. If your CockroachDB {{ site.data.products.advanced }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead.
Your CockroachDB {{ site.data.products.advanced }} cluster must be running on AWS (not GCP or Azure) to make use of metrics export to Amazon CloudWatch. If your CockroachDB {{ site.data.products.advanced }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead.

## See Also

Expand Down
Loading

0 comments on commit 968512f

Please sign in to comment.