Skip to main content
50% off all plans, limited time. Starting at $2.48/mo
Prometheus

Prometheus

Prometheus is the time-series monitoring standard. Pull-based metrics, PromQL queries, alerting rules, and Kubernetes-native discovery. CNCF-graduated, used at SoundCloud (where it was created), DigitalOcean, and 80% of Kubernetes deployments.

At a glance

64.7k

GitHub stars

204

Page views

License Apache-2.0 Version 3.13.2 OS Ubuntu Server 24.04 LTS Min RAM 1 GB IP IPV4,IPV6

Access

  • Open https://<SERVER_IP>:9090 in your browser.
  • The certificate is self-signed, so your browser will display a certificate warning.
  • The Prometheus targets page is available at https://<SERVER_IP>:9090/targets.
  • Metrics are available at https://<SERVER_IP>:9090/metrics.

Login

Prometheus is protected with HTTP Basic Authentication.

  • Username: admin
  • Password: stored in /root/.prometheus-credentials

The same authentication protects the web UI, API, and /metrics endpoint.

Important Files & Directories

  • Prometheus Config: /etc/prometheus/prometheus.yml
  • Web/TLS/Auth Config: /etc/prometheus/web-config.yml
  • TLS Certificates: /etc/prometheus/tls/
  • Prometheus Data: /var/lib/prometheus
  • Node Exporter Textfile Collector: /var/lib/node_exporter/textfile_collector
  • Credentials: /root/.prometheus-credentials
  • Prometheus Binary: /usr/local/bin/prometheus
  • Promtool: /usr/local/bin/promtool
  • Node Exporter Binary: /usr/local/bin/node_exporter
  • Prometheus Service: /etc/systemd/system/prometheus.service
  • Node Exporter Service: /etc/systemd/system/node_exporter.service

Service Management

Check Prometheus:

systemctl status prometheus

Restart Prometheus:

systemctl restart prometheus

View Prometheus logs:

journalctl -u prometheus -f

Check Node Exporter:

systemctl status node_exporter

Restart Node Exporter:

systemctl restart node_exporter

View Node Exporter logs:

journalctl -u node_exporter -f

Adding Targets

Edit /etc/prometheus/prometheus.yml:

vim /etc/prometheus/prometheus.yml

Validate the configuration:

promtool check config /etc/prometheus/prometheus.yml

Reload Prometheus:

curl -sS --cacert /etc/prometheus/tls/prometheus.crt \
  -u admin:<PASSWORD> \
  -X POST https://localhost:9090/-/reload

Retention

Prometheus is configured with:

  • Retention time: 30d
  • Maximum storage size: 10GB

Whichever limit is reached first is applied.

Notes

  • Grafana and Alertmanager are not installed. They can be added separately and connected to this Prometheus instance.
  • Metrics are retained for up to 30 days or 10 GB, whichever limit is reached first.
  • Custom host metrics can be added as .prom files under: /var/lib/node_exporter/textfile_collector

More in Monitoring

Related apps.

Deploy Prometheus now. From $2.48/mo.