How to Link Prometheus as a Data Source in Grafana on Amazon Linux 2023

Here’s a step-by-step guide to installing Grafana on Amazon Linux 2023:

sudo dnf update -y
sudo rpm --import https://rpm.grafana.com/gpg.key
sudo tee /etc/yum.repos.d/grafana.repo <<EOF
[grafana]
name=Grafana OSS
baseurl=https://rpm.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
EOF
sudo dnf install grafana -y
sudo systemctl enable grafana-server
sudo systemctl start grafana-server
sudo systemctl status grafana-server

By default, Grafana runs on port 3000.
Open in browser:

http://<your-ec2-public-ip>:3000

How to Link Prometheus as a Data Source in Grafana on Amazon Linux 2023

If you’ve set up Prometheus and Grafana on Amazon Linux 2023, the next step is to connect Prometheus as a data source inside Grafana. This allows you to visualize metrics in beautiful dashboards and make your monitoring stack complete.

In this guide, I’ll show you step-by-step how to integrate Prometheus with Grafana.

✅ Step 1: Verify Prometheus is Running

Prometheus usually runs on port 9090.

Open your browser and check:

http://<your-ec2-public-ip>:9090

If the Prometheus web UI opens, it’s running fine.

✅ Step 2: Access Grafana

Grafana runs on port 3000.

Visit:

http://<your-ec2-public-ip>:3000

Login using:

  • Username: admin
  • Password: admin (You’ll be asked to change this the first time)

✅ Step 3: Add Prometheus as a Data Source

  1. In Grafana, click on the left menu:
    Connections → Data sources → Add data source
  2. Select Prometheus.
  3. Under HTTP settings, set the URL:
    • If Grafana and Prometheus are on the same server: http://localhost:9090
    • If they are on different servers: http://<prometheus-ec2-ip>:9090
  4. Leave other options as the default.
  5. Click Save & Test.
    Grafana should confirm: “Data source is working.”

✅ Step 4: Import Dashboards

To start visualizing metrics:

  • Go to Dashboards → Create → Import
  • You can use ready-made dashboards from Grafana’s Dashboard Library
    For example:
    • Node Exporter Full (ID: 1860) → Great for monitoring Linux servers

🎯 Conclusion

By linking Prometheus as a data source in Grafana, you unlock the power of real-time monitoring with visually rich dashboards. This setup is a must-have for any DevOps monitoring stack on AWS.

With Grafana + Prometheus, you’ll be able to:

  • Track server health
  • Monitor application performance
  • Set up alerts for proactive issue resolution

💡 Pro Tip: Combine Prometheus with Node Exporter or custom app metrics to make your Grafana dashboards even more insightful.

Related posts

How to install Prometheus

Atiqur Rahman

I am MD. Atiqur Rahman graduated from BUET and is an AWS-certified solutions architect. I have successfully achieved 6 certifications from AWS including Cloud Practitioner, Solutions Architect, SysOps Administrator, and Developer Associate. I have more than 8 years of working experience as a DevOps engineer designing complex SAAS applications.

Leave a Reply