diff --git a/README.md b/README.md index 9bbd038..05398c8 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ Amazon Managed Grafana since version 9.4 comes with Prometheus and Cloudwatch pl 1. On the **Default Region** menu, choose your **AWS Region**. 1. Choose **Save & test**. -#### 3. Add Amazon Athena Data source +#### 3. Add Amazon Athena Data source for Job metrics Before starting, you will retrieve the S3 bucket name created to store the AWS Batch jobs data through Amazon Athena. @@ -206,7 +206,39 @@ In the Amazon Managed Grafana dashboard: 1. On the **Output Location** menu, copy paste the bucket value **s3://DOC-EXAMPLE-BUCKET**. 1. Choose **Save & test**. -#### 4. Create AWS Batch job metrics dashboard + +#### 4. Add Amazon Athena Data source for Cost + +Before starting, you will retrieve the S3 bucket name created to store the AWS Batch jobs data through Amazon Athena. + +In a terminal: + +```bash +sam list stack-outputs --stack-name ${BATCH_DASHBOARD_NAME} \ + --output json | \ + jq -r '.[] | select(.OutputKey=="AthenaSpillBucket") | .OutputValue' +``` + +Copy the output that you will use in the setup of Amazon Athena data source in Amazon Managed Grafana. + +In the Amazon Managed Grafana dashboard: + +1. Select the **hamburger** menu on the left pane.
+1. Expand **Administration**
+ Grafana Data sources
+1. Choose **Data sources**. +1. Choose **Add new data source**. +1. Choose **Amazon Athena**.
+ Grafana athena
+1. For **Name**, enter your **Amazon Athena Cost Data**. +1. On the **Default Region** menu, choose your **AWS Region**. +1. On the **Data source** menu, choose **AwsDataCatalog**. +1. On the **Database** menu, choose **athenacurcfn_a_w_s_batch_cost_report**. +1. On the **Workgroup** menu, choose **primary**. +1. On the **Output Location** menu, copy paste the bucket value **s3://DOC-EXAMPLE-BUCKET**. +1. Choose **Save & test**. + +#### 5. Create AWS Batch job metrics dashboard To create a dashboard in Amazon Managed Grafana for AWS Batch, you will start from the template provided in this repository to generate dashboard for your environment. @@ -240,7 +272,7 @@ You will be redirected to the dashboard you imported. Once you will have your first AWS Batch jobs running. You will be able to see the data associated with it in the dashboard. -#### 5. Create AWS Batch compute cost dashboard +#### 6. Create AWS Batch compute cost dashboard Similar to step 3, you will import an template dashboard in Amazon Managed Grafana for AWS Batch that covers Amazon EC2 compute cost. You can see an example below. @@ -253,7 +285,7 @@ To import the dashboard in Amazon Managed Grafana: 1. Choose **Upload JSON file**, select the `batch-grafana-cost-dashboard.json` file. 1. Choose **Load**. 1. Select the **Athena** and **CloudWatch** data sources your created previously. - Grafana import dashboard
+ Grafana import dashboard
1. Choose **Import**. You will be redirected to the dashboard you imported. diff --git a/docs/images/grafana-athena-cost.png b/docs/images/grafana-athena-cost.png new file mode 100644 index 0000000..a2d73e7 Binary files /dev/null and b/docs/images/grafana-athena-cost.png differ diff --git a/docs/images/grafana-dashboard-import-cost.png b/docs/images/grafana-dashboard-import-cost.png new file mode 100644 index 0000000..7b967de Binary files /dev/null and b/docs/images/grafana-dashboard-import-cost.png differ