Monitor memsql using Prometheus Operator

We have memsql deployed in kubernetes. We want to scrape the memsql metrics using prometheus. There is a node exporter which gets deployed along with memsql . But there is no path which prometheus will scrape ? Can you please help me to understand how prometheus operator will scrape memsql ?

Also can you put some light , how to install memsql-exporter for prometheus ?

Hi @skoley , you can use either PodMonitor or ServiceMonitor to setup Prometheus to scrape the metrics.

Below you can find a namespaced PodMonitor (if you would like to watch any namespace or cross namespace, check prometheus-operator docs for setup, double check the RBAC is setup with ClusterRole privileges)

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: memsql-cluster
spec:
  podMetricsEndpoints:
  - port: metrics
    path: /metrics
  selector:
    matchLabels:
      app.kubernetes.io/name: memsql-cluster

Also here is the API documentation for the PodMonitorSpec, where you can check the knobs to tune for your needs.

1 Like