Prometheus Grafana Setup
Prometheus Grafana Setup
[email protected],
[email protected] +91-8296242028,+91-9980923226
About Prometheus
The Prometheus server which scrapes(collects) and stores time series data based on a pull
mechanism.
A rules engine which allows generation of Alerts based on the scraped metrices.
An alertmanager for handling alerts.
Multiple integrations for graphing and dashboarding.
Enterprises looking to decrease downtime and optimize resources can implement server
monitoring using tools like Prometheus and Grafana.
Server monitoring is a way to look into what your servers are doing in real time.
It can provide you with actionable data, and is most often used for troubleshooting and capacity
planning. It’s typically done at three levels:
Server monitoring has a lot of benefits. The biggest benefit is avoiding reactive panics. You can
get a head start on issues occurring in your servers or applications before your users are impacted.
Along with this benefit, you can also use monitoring to figure out how to:
Increase uptime.
Improve hardware and software performance.
Plan for the future by making the best use of your resources.
Implementing monitoring can give you an almost immediate return on investment. You can
observe trends, spikes, and anomalies that may indicate a problem. And then you can drill down
to discover the root cause of the issue.
Prometheus is an open source system that collects and manages server and application metrics. It
can also be configured to notify your team when an issue arises.
Mithun Technologies Bangalore
[email protected],
[email protected] +91-8296242028,+91-9980923226
What Is Grafana?
Grafana is an open source tool that allows you to easily visualize information.
Grafana dashboards take information from server monitoring tool like Prometheus to display this
information.
Architecture
alteringFiles.yml
rules
Prometheus:
The Prometheus monitoring system includes a rich, multidimensional data model, a concise and
powerful query language called PromQL, an efficient embedded timeseries database.
Alert Manager:
The Alertmanager handles alerts sent by client applications such as the Prometheus server. It
takes care of deduplicating, grouping, and routing them to the correct receiver integration such as
email, PagerDuty, or OpsGenie. It also takes care of silencing and inhibition of alerts.
Node Exporter:
The Prometheus Node Exporter exposes a wide variety of hardware- and kernel-related
metrics.That will periodically (every 1 second) gather all the metrics of your system. It will
monitor your filesystems, disks, CPUs, memory but also your network statistics,
kube-state-metrics is a service that listens to the Kubernetes API server and generates metrics
about the state of the objects, including deployments, nodes, and pods.
Grafana:
Grafana is designed for analyzing and visualizing metrics such as system CPU, memory, disk and
I/O utilization.
Grafana allows you to query, visualize, alert on and understand your metrics no matter where
they are stored. Create, explore, and share dashboards with your team and foster a data driven
culture:
Prerequisite:
If Storage Class is not Configured then make persistence enabled as false in helm
values files # Which is not suggestable as if pods are terminated and recreated we
will lost the data.
3) Create prometheusvalues.yml file from below link. And update this file to define
alter rules & smtp details.
https://raw.githubusercontent.com/MithunTechnologiesDevOps/Kubernates-
Manifests/master/prometheusvalues.yml
4) Deploy using helm with prometheusvalues.yml values file which u create in step 3.
Deploy helm chart with default values . And Create Ingress rules to access.
# If you have ingress deployed deploy by change service type as node port as below.
And access using NODEIP:NODEPORT
# Deploy helm chart with default values . And Create Ingress rules to access.
# If you have ingress deployed deploy by change service type as node port as below.
And access using NODEIP:NODEPORT
Access Grafana Using NodeIP & NodePort If Service type is Node Port or accessing using Load
Balancer if service type is load balancer.
7) Configure Data Source Service URL(Below URL) in Grafana so that it use this data
source to fetch metrics.
http://prometheus-server
8) import some sample dashboards from community find few ids below.