Skip to content

Monitoring and alerting

guidemaintain-monitoring

Connect the Backend to the monitoring of the company and set the alerts that show a problem before users see it.

The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary gives a health check, metrics and logs, so you can connect it to the monitoring that the company already has: Prometheus, the monitoring of the cloud, or systemd. This page tells where each signal is, which alerts to set, and how to find the cost of the installation in the cloud bill.

Health of the Backend

The main check is /health on the metrics port, 9090 by default. It answers 200 when the Backend is ready and 503 when it is not ready. When TLS is on, this port serves HTTPS only.

The probes of the pod use this check: the readiness probe asks /health, and the liveness probe asks /health?service=GRPC, so KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary restarts the Backend when its gRPC service stops.

Terminal window
kubectl --namespace <namespace> get deployment <release>
kubectl --namespace <namespace> get events --field-selector type=Warning

From outside, the gRPC health check on the entry pointentry point — The way in to the Backend from outside the cluster, a load balancer or an Ingress with a DNS name. It usually ends TLS and sends the traffic to the Backend pod. Glossary (port 6345 in Single Server modeSingle Server mode — The mode in which the Backend and all its jobs run on one Linux machine, the server, with no Kubernetes cluster. Glossary, 443 through the entry point of the cluster) shows that clients can reach the Backend. It does not need a sign-insign in — To show the Backend who you are, with a sign-in provider or a single-user token. The verb is "sign in"; the noun and the adjective are "sign-in". Glossary. See Verify the installation.

Metrics

A collector scrapes /metrics on the same port, in the Prometheus format. For the address and the most useful metrics, see Metrics.

Logs

The Backend writes its full log to the logs disk, /var/log/platforma in the pod. kubectl logs shows only the short start log. When the logs disk is off, the full log goes to the output of the pod.

Errors have "level":"error". To collect logs for support, see Get help.

Alerts to set

Alert Signal What it means
Backend not ready for some minutes /health answers 503, or the pod is not Ready Users cannot connect
Restart loop The pod is in CrashLoopBackOff; in Single Server mode, NRestarts grows The Backend cannot start. With --fail-fast-on-invalid-license, a license that is not valid also stops the start: see License
Database disk fills up Free space of the claim <release>-database (Single Server mode: the disk of the data folder) The Backend keeps all its state there
Logs disk fills up Free space of the claim <release>-logs (Single Server mode: the disk of the data folder) The Backend cannot write its log
Workspaceworkspace — The storage where the Backend and all jobs keep the working files of running jobs. The Backend and the jobs use it at the same time. In Kubernetes, it is a network file system; in Single Server mode, it is a folder on the server. Glossary fills up Free space of the claim <release>-workspace (Single Server mode: the disk of the data folder) Jobsjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary cannot write their working files and fail. On Google Cloud, the Filestore instance of the workspace has a fixed size: the Terraform modulesTerraform modules — The Terraform code that MiLaboratories provides to install Platforma. The cloud-specific Terraform modules make the cluster and its cloud parts in AWS or Google Cloud; the cloud-agnostic Terraform modules install Platforma into the cluster. Glossary make 1024 GiB by default, and the installer sets the size from the deployment size. On AWS, EFS grows by itself
Job pods wait for a long time Job pods are Pending, or KueueKueue — A Kubernetes add-on that holds jobs in a queue until the cluster has free CPU, memory and GPU for them. Glossary does not admit their workloads Analyses do not start. The Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary also shows the load of the queue on its server icon: see A job waits or hangs
Certificate is close to its expiry The expiry date of the certificate of the entry point The Desktop App cannot connect after the expiry
Storage errors pl_objfs_transfers_total{result="failed"} or pl_objfs_calls_total{result="error"} grows The Backend cannot read or write the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary, when it is a bucket. Jobs and file transfers fail
API errors grpc_server_handled_total with a grpc_code other than OK and Canceled grows fast Requests of the Desktop App fail

In Kubernetes, the free space of a volume comes from the metrics of the kubelet (kubelet_volume_stats_available_bytes), with the name of the claim in the label persistentvolumeclaim. <release> is the name of the Helm release of the Backend, platforma by default. In Single Server mode, the database, the logs and the working folders of the jobs are all in the data folder: watch the free space of its disk.

Rules in the monitoring of the company

The alerts use the metrics of the Backend and the standard metrics of the cluster or the server. Write them as rules of the alerting tool that the company uses.

The example is a PrometheusRule of the Prometheus Operatoroperator — The person who installs and runs Platforma in your company, for example an IT engineer or a bioinformatician. Glossary. It needs the metrics of the kubelet (volumes) and of kube-state-metrics (the Deployment), and a collector that scrapes the Backend.

platforma-alerts.yaml
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: platforma
namespace: <namespace>
spec:
groups:
- name: platforma
rules:
- alert: PlatformaBackendNotReady
expr: kube_deployment_status_replicas_available{namespace="<namespace>", deployment="<release>"} < 1
for: 5m
- alert: PlatformaVolumeAlmostFull
expr: |
kubelet_volume_stats_available_bytes{namespace="<namespace>", persistentvolumeclaim=~"<release>-(database|logs|workspace)"}
/ kubelet_volume_stats_capacity_bytes < 0.1
for: 15m
- alert: PlatformaStorageErrors
expr: increase(pl_objfs_transfers_total{result="failed"}[15m]) > 0

Cost of the cloud resources

The cloud bill shows the cost of each resource. The tags (AWS) or labels (Google Cloud) that the installation puts on its resources let you filter the bill by installation.

Tool: CloudFormation template

The stack puts the tag platforma with the value of the parameter ClusterName on its resources: the network, the cluster, the nodes and their boot disks, the bucket and the file system. To filter the bill by this tag, activate platforma as a cost allocation tag in the Billing console of AWS. The bill shows the tag only for the costs after the activation.

Next