Skip to content

Latest commit

 

History

History
91 lines (47 loc) · 2.62 KB

Metrics.md

File metadata and controls

91 lines (47 loc) · 2.62 KB

Example: How to get coolbeans Metrics

This guide provides an example metrics setup.

Objectives

  • Setup port forwarding from the kubernetes cluster's Prometheus instance to your machine.
  • Setup and run a grafana server to talk to the cluster.

Requirements

  • A coolbeans & beanstalkd service running on kubernetes.

Setup Prometheus

Apply the Prometheus config map and the deployment yaml

kubectl apply -f k8s/prometheus/0-configmap.yaml
kubectl apply -f k8s/prometheus/1-deployment.yaml

Setup port forwarding

We will use kubernetes port forwarding to forward requests to the tcp port of the Prometheus service

Verify the Prometheus service is running

Query via kubectl to get the port address of the beanstalkd proxy

kubectl -n coolbeans get service prometheus

NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
prometheus   ClusterIP   10.200.12.203   <none>        9090/TCP   26m

Setup port forwarding

Use kubectl port-forward using the service resource name to port forward to.

kubectl -n coolbeans port-forward service/prometheus 9090:9090

Forwarding from 127.0.0.1:9090 -> 9090
Forwarding from [::1]:9090 -> 9090
Handling connection for 9090
Handling connection for 9090

Open the Prometheus console in a browser window

Open http://localhost:9090/ in a browser window, and check to see if the Prometheus web console shows up.

Setup Grafana

On your local machine, you can view the metrics via Grafana.

Here are the steps to configure a local Grafana instance.