Prometheus
Installation
Section titled “Installation”There are a number of ways to install Prometheus, including:
- via Helm
- via kubeyaml
- in split mode
The best option depends on how the rest of the infrastructure is installed. By far the simplest way, which the Platformatic team uses in @platformatic/desk, is to install the kube-prometheus-stack and prometheus-adapter through their Helm charts. This will cover all the requirements for ICC as well as leave open the possibility of having seperate storage in the future.
Requirements
Section titled “Requirements”The following CRDs are used to track the state of Platformatic and watt applications.
- PodMonitor
- ServiceMonitor
The kube-state-metrics agent is also required for accessing pod and deployment
metadata.
First, validate that the current installation has the required CRDs. With access
via kubectl, the command and output should look something like this:
> kubectl get crds | grep '.monitors.monitoring.coreos.com'podmonitors.monitoring.coreos.com 2025-09-30T23:39:21Zservicemonitors.monitoring.coreos.com 2025-09-30T23:39:21ZIf the monitors are available, move on to agent configuration.
The promethes-operator-crds Helm chart includes all the CRDs for Prometheus
Operator and is the easiest way to install the required CRDs, if Prometheus is
already installed.
helm repo add prometheus-community https://prometheus-community.github.io/helm-chartshelm repo updatehelm install prom-op-crds prometheus-community/prometheus-operator-crdsTo avoid installing all CRDs, use this values file with the chart:
crds: servicemonitors: enabled: true podmonitors: enabled: true
alertmanagerconfigs: enabled: false alertmanagers: enabled: false probes: enabled: false prometheusagents: enabled: false prometheuses: enabled: false prometheusrules: enabled: false scrapeconfigs: enabled: false thanosrulers: enabled: falseIt can be applied like this:
helm install prom-op-crds prometheus-community/prometheus-operator-crds --values prom-op-crds.yamlAlternatively, the CRDs may be installed when using other installation methods.
For example, when using kube-prometheus-stack, make sure crds.enable is set
to true for the ServiceMonitor and PodMonitor CRDs to be installed.
Agent configuration
Section titled “Agent configuration”The following labels are used by Platformatic for accurate scaling and
monitoring of watt applications. These need to be added to the allow list of the
kube-state-metrics agent configuration.
platformatic.dev/application-idplatformatic.dev/deployment-idplatformatic.dev/monitorplatformatic.dev/scale-minplatformatic.dev/scale-max
These labels can be added during Helm installation:
# When using `kube-prometheus-stack` chartkube-state-metrics: extraArgs: - --metric-labels-allowlist=pods=["platformatic.dev/application-id","platformatic.dev/deployment-id","platformatic.dev/monitor","platformatic.dev/scale-min","platformatic.dev/scale-max"]
# When using `kube-state-metrics` chartmetricLabelsAllowlist: - pods=[platformatic.dev/application-id,platformatic.dev/deployment-id,platformatic.dev/monitor,platformatic.dev/scale-min,platformatic.dev/scale-max]or to the CLI arguments of the agent:
apiVersion: apps/v1kind: Deploymentspec: template: spec: containers: - image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG name: kube-state-metrics args: - --metric-labels-allowlist=pods=["platformatic.dev/application-id","platformatic.dev/deployment-id","platformatic.dev/monitor","platformatic.dev/scale-min","platformatic.dev/scale-max"]AWS Managed Prometheus
Section titled “AWS Managed Prometheus”A scalable Prometheus system may seperate the storage and querying of metrics from the scraping.
If AMP is not already configured, use one of the following methods to create a workspace:
With a configured workspace, metrics ingestion will need to be configured next.
AWS documentation
includes the most up to date configuration steps. If Prometheus server and
kube-state-metrics agent have already been installed, the following changes
will need to be made:
- updating the
remoteWritesettings of the Prometheus server - adding an IAM role
- attaching the role to a service account
All of these steps are found in the AWS documentation for metrics ingestion.