Setup AWS Managed Grafana
Grafana is built around the Amazon managed services for Grafana and Prometheus.
At this time, we have implemented only the EKS integrations with AWS Managed Grafana. We are open to adding ECS support. These instructions include the steps for integrated EKS with AWS Managed Grafana.
1 Vendor Components
Vendor all required components
- Commands
- Atmos Workflow
vendor
workflow in the examples/snippets/stacks/workflows/grafana.yaml
file:- No commands found
atmos workflow vendor -f grafana
2 Deploy Grafana
Please see How to Setup Grafana for in depth documentation.
However, if you can find the summary of steps in Atmos Workflows here. You can choose to run these workflows one-by-one, or run them altogether with the following:
- Commands
- Atmos Workflow
deploy
workflow in the examples/snippets/stacks/workflows/grafana.yaml
file:- No commands found
atmos workflow deploy -f grafana
3 Deploy all data sources
Deploy Prometheus and Loki to plat-dev
, plat-staging
, and plat-prod
. Run the following Atmos Workflow:
- Commands
- Atmos Workflow
deploy
workflow in the examples/snippets/stacks/workflows/data-sources.yaml
file:- No commands found
atmos workflow deploy -f data-sources -s plat-use1-dev
- Commands
- Atmos Workflow
deploy
workflow in the examples/snippets/stacks/workflows/data-sources.yaml
file:- No commands found
atmos workflow deploy -f data-sources -s plat-use1-staging
- Commands
- Atmos Workflow
deploy
workflow in the examples/snippets/stacks/workflows/data-sources.yaml
file:- No commands found
atmos workflow deploy -f data-sources -s plat-use1-prod
4 Grant the Prometheus Scraper Access to EKS
After deploying the eks/prometheus-scraper
component, you will need to reapply the eks/cluster
component with an
update to var.map_additional_iam_roles
.
atmos terraform output eks/prometheus-scraper -s plat-use1-dev
atmos terraform output eks/prometheus-scraper -s plat-use1-staging
atmos terraform output eks/prometheus-scraper -s plat-use1-prod
Note the scraper_role_arn
and clusterrole_username
outputs and set them to rolearn
and username
respectively
with the map_additional_iam_roles
input for eks/cluster
.
# stacks/orgs/acme/plat/STAGE/us-east-1/eks.yaml
components:
terraform:
eks/cluster:
vars:
map_additional_iam_roles:
# this role is used to grant the Prometheus scraper access to this cluster. See eks/prometheus-scraper
- rolearn: "arn:aws:iam::111111111111:role/AWSServiceRoleForAmazonPrometheusScraper_111111111111111"
username: "acme-plat-ue2-sandbox-prometheus-scraper"
groups: []
5 Reapply EKS Cluster
Then reapply eks/cluster
:
atmos terraform apply eks/cluster -s plat-use1-dev
atmos terraform apply eks/cluster -s plat-use1-staging
atmos terraform apply eks/cluster -s plat-use1-prod
6 Deploy Grafana
Deploy the Amazon Managed Grafana workspace, API key, data-source integrations, and finally dashboards:
- Commands
- Atmos Workflow
deploy
workflow in the examples/snippets/stacks/workflows/grafana.yaml
file:- No commands found
atmos workflow deploy -f grafana -s core-use1-auto
7 Accessing Grafana
We would prefer to have a custom URL for the provisioned Grafana workspace, but at the moment it's not supported natively and implementation would be non-trivial. We will continue to monitor that Issue and consider alternatives, such as using Cloudfront.
You can access Grafana from the Grafana workspace endpoint that is output by the grafana
component:
atmos terraform output grafana -s core-use1-auto
Or you can open your AWS Single-Sign-On page, navigate to the "Applications" tab, and then select "Amazon Grafana".