Monitoring
Self-Hosting Documentation Access
This section requires a password to access. Interested in self-hosting? Contact sales to learn more.
LlamaCloud services expose metrics, which are collected by Prometheus and visualized in Grafana.
Prerequisites
Section titled “Prerequisites”To monitor your LlamaCloud deployment, you’ll need:
- Prometheus - For metrics collection and storage
- Grafana - For metrics visualization
- AlertManager - For alert management
These services can be deployed using the kube-prometheus-stack Helm chart, which provides a complete monitoring solution that includes:
- Prometheus server for metrics collection
- Grafana for visualization with pre-configured dashboards
- AlertManager for handling alerts
- Node exporter for hardware and OS metrics
- kube-state-metrics for Kubernetes object metrics
- Prometheus Operator for managing Prometheus instances
Use this file as a starting point for a basic installation:
prometheus: enabled: truegrafana: enabled: truealertmanager: enabled: truehelm repo add prometheus-community https://prometheus-community.github.io/helm-chartshelm repo updatehelm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \ -f kube-prometheus-stack.yamlFor more information about the kube-prometheus-stack Helm chart, please refer to the kube-prometheus-stack README.
Service Monitoring
Section titled “Service Monitoring”After installing the kube-prometheus-stack
Helm chart, you should create ServiceMonitor objects. These objects tell Prometheus to scrape the metric endpoints exposed by the LlamaCloud services.
apiVersion: monitoring.coreos.com/v1kind: ServiceMonitormetadata: # 👇 The name of the service you want to monitor. name: llamacloud # 👇 The namespace where the ServiceMonitor object lives; typically the namespace where you installed the chart. namespace: <kube-prometheus-stack-namespace> labels: # 👇 Typically this is the same namespace as above. release: kube-prometheus-stackspec: namespaceSelector: matchNames: # 👇 The namespace you installed Llamacloud into. - <llamacloud-namespace> selector: matchLabels: app.kubernetes.io/instance: llamacloud app.kubernetes.io/name: llamacloud app.kubernetes.io/managed-by: Helm endpoints: - port: http path: /metrics interval: 30s scrapeTimeout: 10sapiVersion: monitoring.coreos.com/v1kind: ServiceMonitormetadata: # 👇 The name of the service you want to monitor. name: llamacloud-operator # 👇 The namespace where the ServiceMonitor object lives; typically the namespace where you installed the chart. namespace: <kube-prometheus-stack-namespace> labels: # 👇 Typically this is the same namespace as above. release: kube-prometheus-stackspec: namespaceSelector: matchNames: # 👇 The namespace you installed Llamacloud into. - <llamacloud-namespace> selector: matchLabels: app.kubernetes.io/instance: llamacloud app.kubernetes.io/name: llamacloud-operator app.kubernetes.io/managed-by: Helm endpoints: - port: http path: /metrics interval: 30s scrapeTimeout: 10sapiVersion: monitoring.coreos.com/v1kind: ServiceMonitormetadata: # 👇 The name of the service you want to monitor. name: llamacloud-worker # 👇 The namespace where the ServiceMonitor object lives; typically the namespace where you installed the chart. namespace: <kube-prometheus-stack-namespace> labels: # 👇 Typically this is the same namespace as above. release: kube-prometheus-stackspec: namespaceSelector: matchNames: # 👇 The namespace you installed Llamacloud into. - <llamacloud-namespace> selector: matchLabels: app.kubernetes.io/instance: llamacloud app.kubernetes.io/name: llamacloud-worker app.kubernetes.io/managed-by: Helm endpoints: - port: http path: /metrics interval: 30s scrapeTimeout: 10sapiVersion: monitoring.coreos.com/v1kind: ServiceMonitormetadata: # 👇 The name of the service you want to monitor. name: llamacloud-parse # 👇 The namespace where the ServiceMonitor object lives; typically the namespace where you installed the chart. namespace: <kube-prometheus-stack-namespace> labels: # 👇 Typically this is the same namespace as above. release: kube-prometheus-stackspec: namespaceSelector: matchNames: # 👇 The namespace you installed Llamacloud into. - <llamacloud-namespace> selector: matchLabels: app.kubernetes.io/instance: llamacloud app.kubernetes.io/name: llamacloud-parse app.kubernetes.io/managed-by: Helm endpoints: - port: http path: /metrics interval: 30s scrapeTimeout: 10sapiVersion: monitoring.coreos.com/v1kind: ServiceMonitormetadata: # 👇 The name of the service you want to monitor. name: llamacloud-ocr # 👇 The namespace where the ServiceMonitor object lives; typically the namespace where you installed the chart. namespace: <kube-prometheus-stack-namespace> labels: # 👇 Typically this is the same namespace as above. release: kube-prometheus-stackspec: namespaceSelector: matchNames: # 👇 The namespace you installed Llamacloud into. - <llamacloud-namespace> selector: matchLabels: app.kubernetes.io/instance: llamacloud app.kubernetes.io/name: llamacloud-ocr app.kubernetes.io/managed-by: Helm endpoints: - port: http path: /metrics interval: 30s scrapeTimeout: 10sGrafana
Section titled “Grafana”Once you have installed the kube-prometheus-stack
and installed the ServiceMonitor objects into your Kubernetes cluster, you will be able to view the metrics in Grafana.
First, get the Grafana admin user’s password:
kubectl --namespace <llamacloud-namespace> get secrets kube-prometheus-stack-grafana -o jsonpath="{.data.admin-password}" | base64 -d ; echoNext, create a port-forward to Grafana:
export GRAFANA_POD_NAME=$(kubectl --namespace <llamacloud-namespace> \ get pod -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=kube-prometheus-stack" -oname)kubectl --namespace <llamacloud-namespace> port-forward $GRAFANA_POD_NAME 3000Now open your browswer to localhost:3000 and log into the Grafana console. You should be able to explore all
the LlamaCloud metrics in the Explore tab.
