How to integrate Prometheus in an EKS Cluster as a Data Source in AWS Managed Grafana
Whether you're an experienced DevOps engineer or just starting your cloud journey, this article will equip you with the knowledge and tools needed to effectively monitor and optimize your EKS environment.
Configure and use Prometheus to collect metrics on an Amazon EKS cluster and view those metrics in AWS Managed Grafana (AMG). Provide usage instructions and an estimate of the costs of connecting Prometheus metrics as an AMG data source. Let’s assume that fluentbit is already configured on the EKS cluster.
Step #1: Prometheus Configuration
Ensure Prometheus is installed and running in your Amazon EKS cluster. You can install via Terraform using helm chart. Verify that Prometheus is successfully collecting metrics from your cluster nodes and applications.
Step #2: Configure the data source in Grafana
Now you’ll need to configure the data source in Grafana. (Here the created LoadBalancer will serve as a reference) Make sure the AWS Route53 console is open, and a private Hosted Zone named "monitoring.domainname" is created. Inside this Hosted Zone, create an Alias record pointing to the LoadBalancer previously mentioned. This data will be used to configure the Prometheus service as the data source in AMG.
AWS Managed Grafana Configuration
Provision an instance of AWS Managed Grafana.
Access the AWS Managed Grafana console and obtain the URL to access the Grafana instance.
Ensure you have the necessary permissions to manage data sources in AWS Managed Grafana.
Configure Prometheus as a Data Source in AWS Managed Grafana:
Access the AWS Managed Grafana console using the URL obtained in step 2.
Navigate to the "Configuration" section and select "Data sources".
Click on "Add data source" and choose "Prometheus" as the data source type.
Complete the required fields, including the Prometheus endpoint URL and authentication credentials if applicable, or a Workspace IAM Role.
Save the data source configuration.
Visualizing Metrics in Grafana:
Identify the KPIs needed to visualize in the dashboard
Create dashboards in Grafana to visualize the metrics collected by Prometheus.
Utilize Grafana's query and visualization options to create customized visualizations of your metrics.
Explore different panel types such as graphs, tables, and text panels to present the information in a clear and understandable manner.
Step #3: Estimate costs
To estimate the costs associated with integrating Prometheus as a data source in AWS Managed Grafana, consider the following:
AWS Managed Grafana Costs: Refer to the AWS documentation to understand the details and pricing associated with AWS Managed Grafana. According to the following documentation, the price is per license, either editor or user. The editor can create and edit both the workspace and the metric display and the user can only view the panels and metrics previously configured by the editor. (https://aws.amazon.com/es/grafana/pricing/). Today, the editor license cost $9 and the user license cost $5
Storage Costs: If AWS Managed Grafana utilizes additional storage to store metrics collected by Prometheus, refer to the AWS documentation for information on pricing and available storage options.
Remember that costs may vary depending on your specific configuration and the AWS region where your AWS Managed Grafana instance is located. Consult the documentation and updated pricing details for accurate cost estimation.
In conclusion, this is a very interesting and easy-to-implement alternative to replace solutions in clusters that have a large number of running pods. This scenario generates an even larger number of metrics, and that's where this processing-based and licensed solution becomes much more cost-effective compared to a metric-based pricing model.
If you want to know more about EKS, we suggest going check Cross account access to S3 using IRSA in EKS with Terraform as IaaC
If you are interested in learning more about our #TeraTips or our blog's content, we invite you to see all the content entries that we have created for you and your needs. And subscribe to be aware of any news! 👇