Prometheus-Grafana VM by Anarion Technologies
Prometheus-Grafana is a powerful open-source monitoring and observability stack widely used in modern cloud-native architectures. It consists of two main components: Prometheus and Grafana, each serving a distinct role in the monitoring ecosystem. Prometheus, originally developed by SoundCloud, specializes in collecting and storing time-series data, particularly metrics from systems, applications, and cloud environments. It operates on a pull model, scraping metrics from configured targets at specified intervals, which allows for efficient monitoring of various components, including servers, databases, and microservices.
Prometheus features a time-series database that stores metrics indexed by timestamp, labels, and metric names, enabling powerful querying and aggregation capabilities. Its query language, PromQL, allows users to extract, manipulate, and analyze time-series data with flexibility, enabling complex queries such as aggregations, rate calculations, and filtering. Additionally, Prometheus includes an alerting mechanism that allows users to define alert rules based on metrics and thresholds, sending notifications through various channels (e.g., Slack, email) via its Alertmanager to ensure timely responses to issues.
Grafana complements Prometheus by providing an intuitive visualization layer, enabling users to create dynamic and interactive dashboards for data exploration and analysis. Users can customize their dashboards with various visualization options, such as graphs, heatmaps, and tables, effectively representing metrics. Grafana supports multiple data sources beyond Prometheus, including Elasticsearch, InfluxDB, and MySQL, allowing users to visualize data from diverse systems in a unified interface. It also includes alerting features, allowing users to set up alerts based on dashboard metrics, further enhancing monitoring capabilities. Additionally, Grafana has a rich ecosystem of plugins that extend its functionality, enabling additional visualization types, data sources, and integrations.
The Prometheus-Grafana stack is particularly valuable in several scenarios. In microservices architectures, Prometheus can scrape metrics from multiple services, while Grafana provides a centralized view of the entire ecosystem. Organizations also use this stack to monitor infrastructure components like servers, containers, and network devices, gaining insights into performance, resource utilization, and potential bottlenecks. Furthermore, by collecting application metrics, Prometheus-Grafana helps teams analyze performance, identify slow transactions, and track user experience, making it an essential tool for Application Performance Monitoring (APM).
In conclusion, the Prometheus-Grafana stack provides a comprehensive monitoring solution that empowers organizations to gain deep insights into their systems and applications. This integration fosters proactive incident management, performance optimization, and data-driven decision-making, making it a cornerstone of modern observability practices in cloud-native environments.
To subscribe to this product from Azure Marketplace and initiate an instance using the Azure compute service, follow these steps:
1. Navigate to Azure Marketplace and subscribe to the desired product.
2. Search for “virtual machines” and select “Virtual machines” under Services.
3. Click on “Add” in the Virtual machines page, which will lead you to the Create a virtual machine page.
4. In the Basics tab:
- Ensure the correct subscription is chosen under Project details.
- Opt for creating a new resource group by selecting “Create new resource group” and name it as “myResourceGroup.”
5. Under Instance details:
- Enter “myVM” as the Virtual machine name.
- Choose “East US” as the Region.
- Select “Ubuntu 18.04 LTS” as the Image.
- Leave other settings as default.
6. For Administrator account:
- Pick “SSH public key.”
- Provide your user name and paste your public key, ensuring no leading or trailing white spaces.
7. Under Inbound port rules > Public inbound ports:
- Choose “Allow selected ports.”
- Select “SSH (22)” and “HTTP (80)” from the drop-down.
8. Keep the remaining settings at their defaults and click on “Review + create” at the bottom of the page.
9. The “Create a virtual machine” page will display the details of the VM you’re about to create. Once ready, click on “Create.”
10. The deployment process will take a few minutes. Once it’s finished, proceed to the next section.
To connect to the virtual machine:
1. Access the overview page of your VM and click on “Connect.”
2. On the “Connect to virtual machine” page:
- Keep the default options for connecting via IP address over port 22.
- A connection command for logging in will be displayed. Click the button to copy the command. Here’s an example of what the SSH connection command looks like:
“`
ssh [email protected]
“`
3. Using the same bash shell that you used to generate your SSH key pair, you can either reopen the Cloud Shell by selecting >_ again
or going to https://shell.azure.com/bash.
4. Paste the SSH connection command into the shell to initiate an SSH session.
Usage/Deployment Instructions
Anarion Technologies – Prometheus-Grafana
Note: Search product on Azure marketplace and click on “Get it now”
Click on Continue
Click on Create
Creating a Virtual Machine, enter or select appropriate values for zone, machine type, resource group and so on as per your choice.
After Process of Create Virtual Machine. You have got an Option Go to Resource Group
Click Go to Resource Group
Click on the Network Security Group: grafana-nsg
Click on Inbound Security Rule
Click on Add
Add Port
Add Port
Destination
Port Ranges Section* (where default value is 8080)
3000,9090
Select Protocol as TCP
Option Action is to be Allow
Click on Add
Click on Refresh
Copy the Public IP Address
SSH into terminal and run these commands:
$ sudo su
$ sudo apt update
$ cd prometheus-2.55.0.linux-amd64/
$ ./prometheus –config.file=prometheus.yml
Open your web browser and access http://server-ip-address:9090.
If Prometheus is running correctly, you will see the Prometheus web interface.
Prometheus is Working.
Open your web browser and go to http://your-server-ip:3000.
You will be prompted to set up a new admin password. Follow the on-screen
instructions to complete the setup.
Login Creds:
Username: admin
Password: admin123
Welcome to the Grafana Dashboard
Both tools running fine
Configure Prometheus as a Data Source:
In the Grafana web interface, click on “Connections” > “Data Sources.” Add a new data source and choose Prometheus. Provide the URL of your Prometheus server (e.g., http://server-ip:9090) and
save the configuration.
Search Prometheus on Search Bar and
Select it.
Click Add new Data Source
Add visualization — add data sources (already added prometheus)Finally
set the sample dashboard
ThankYou!!!