Prometheus server metrics
Available since: version 8.0
MetalSoft collects out-of-band server metrics (temperatures, fan speeds, and power consumption) from each server’s BMC and sends them to a Prometheus-compatible endpoint with the Prometheus remote-write protocol. You then graph and alert on them in Grafana or any other Prometheus client.
This page covers three ways to set up the receiving side, from the least to the most work on your part:
- An existing, external Prometheus: MetalSoft only sends data to it.
- A Prometheus managed by the Prometheus Operator, including Grafana.
- A minimal, receive-only Prometheus deployed next to MetalSoft from plain manifests.
The MetalSoft configuration is the same for all three.
This feature is separate from Enabling metric monitoring, which exposes metrics about the MetalSoft services themselves for Prometheus to scrape.
How it works
Section titled “How it works”orchestrator ── every 5 minutes, per site │ ├─► servers ─► ms-tunnel ─► Site Controller agent ─► BMC (Redfish) │ telemetry comes back │ └─► HTTP POST /api/v1/write ─► Prometheus ◄── Grafana- Collection. For every site with server health monitoring enabled, the Global Controller runs the scheduled job
system-defined-server-metrics-update-site-<site ID>every 5 minutes. It reads the BMC telemetry of each server in the site through the Site Controller, over the existing tunnel. The job covers servers in the available, used, cleaning, cleaning required, hardware rescan, updating firmware, used diagnostics, and unavailable states. - Delivery. The orchestrator service on the Global Controller pushes the samples to the configured URL with Prometheus remote-write (protocol 1.0). Prometheus never connects to MetalSoft, so no scrape configuration is required.
- Viewing. Query the data from Grafana or the Prometheus UI.
Metrics
Section titled “Metrics”| Metric | One series per | Extra labels |
|---|---|---|
server_temperature_celsius | Temperature sensor | sensor, physical_context |
server_fan_speed_rpm | Fan | fan, physical_context |
server_power_consumption_watts | Chassis total | component, physical_context |
server_component_power_watts | Power component other than the chassis total | component, physical_context |
Every series also carries these labels:
| Label | Value |
|---|---|
instance | BMC address |
site_id, site_name | The site the server belongs to |
server_id | MetalSoft server ID |
server_serial_number | Server serial number |
source | Always redfish |
There is no label that identifies the Global Controller. If several Global Controllers write to the same Prometheus, tell them apart by site_name.
The volume is small. As a reference, 11 servers produce about 250 series (20–25 per server) and use about 14 MB of disk in four weeks.
Requirements for the receiving endpoint
Section titled “Requirements for the receiving endpoint”Any of the options below meets these requirements. Check them when you bring your own endpoint.
- It accepts Prometheus remote-write 1.0 on an HTTP path, usually
/api/v1/write. Prometheus does this only when started with--web.enable-remote-write-receiver. - It accepts writes without authentication. In version 8.0, MetalSoft does not send credentials, custom headers, a tenant header, or a client certificate.
- The orchestrator pod on the Global Controller can reach it. An endpoint inside the Global Controller cluster is reached through its Service name. An endpoint outside it needs a route and firewall rules from the Global Controller nodes to its address and port.
Configuring MetalSoft
Section titled “Configuring MetalSoft”MetalSoft reads the remote-write settings from the remote-write ConfigMap in the Global Controller namespace. The ConfigMap is part of configmaps.yaml in the Global Controller manifests.
-
In
configmaps.yaml, setremote_write_enabledandremote_write_urlin theremote-writeConfigMap:apiVersion: v1kind: ConfigMapmetadata:name: remote-writenamespace: <namespace>data:remote_write_enabled: "true"remote_write_url: "http://prometheus.ms-metrics.svc:9090/api/v1/write"# leave the other keys at their defaultsUse the URL of your endpoint: the full URL, including the
/api/v1/writepath. The other keys in the ConfigMap (protocol, timeout, tenant, headers, authentication, and TLS) are reserved for later versions. Version 8.0 does not use them. -
Apply the ConfigMap:
Terminal window kubectl -n <namespace> apply -f configmaps.yaml -
Restart the orchestrator. It reads the settings only at startup.
Terminal window kubectl -n <namespace> rollout restart deployment orchestrator -
Make sure server health monitoring is enabled on each site that should report metrics: click Sites, click the site name, click Configuration, and check Enable Server Health Monitoring. It is enabled by default. See Server health monitoring.
The first samples arrive within 5 minutes. To check, see Verifying the setup.
To stop sending metrics, set remote_write_url to "", apply, and restart the orchestrator.
Option 1: An existing, external Prometheus
Section titled “Option 1: An existing, external Prometheus”Use this option when you already run Prometheus, or a Prometheus-compatible store such as Grafana Mimir, Thanos Receive, or VictoriaMetrics, and want MetalSoft to send its metrics there. MetalSoft only sends data; you operate the receiver.
- Enable the remote-write receiver on your endpoint, if it is not on already:
-
Prometheus: start it with
--web.enable-remote-write-receiver. -
Grafana Mimir or Cortex: these require a tenant header (
X-Scope-OrgID) by default, which MetalSoft does not send. Disable multi-tenancy, as described in the product’s documentation. -
Thanos Receive: writes without a tenant header go to the default tenant. No extra configuration is required.
-
VictoriaMetrics: accepts remote-write on
/api/v1/writewith no extra configuration.
-
- Allow traffic from the Global Controller nodes to the endpoint’s address and port.
- Set
remote_write_urlto the endpoint, for examplehttp://prometheus.example.com:9090/api/v1/write, as described in Configuring MetalSoft.
References:
Option 2: Prometheus Operator and kube-prometheus-stack
Section titled “Option 2: Prometheus Operator and kube-prometheus-stack”Use this option to run Prometheus and Grafana in a Kubernetes cluster, typically the Global Controller cluster, with the Prometheus Operator. The kube-prometheus-stack Helm chart installs the operator, a Prometheus, Grafana, and the cluster dashboards in one step. This section lists only the settings MetalSoft needs. Consult the linked documentation for everything else.
Choose one of these variants:
- A. Receive on the chart’s Prometheus. Simplest. The MetalSoft metrics share storage and retention with the cluster metrics.
- B. A dedicated Prometheus for MetalSoft. The operator runs a second, receive-only Prometheus with its own storage and retention. Use this when the cluster Prometheus has short retention, or to keep the two data sets apart.
Variant A: Receive on the chart’s Prometheus
Section titled “Variant A: Receive on the chart’s Prometheus”-
Add the receiver settings to your chart values file, for example
values.yaml:prometheus:prometheusSpec:enableRemoteWriteReceiver: trueretention: 30dretentionSize: 50GBstorageSpec:volumeClaimTemplate:spec:storageClassName: <storage-class>accessModes: ["ReadWriteOnce"]resources:requests:storage: 60GiretentionandretentionSizeapply to all the data in this Prometheus, cluster metrics included. Size them for both. See Storage for the storage class. -
Install or upgrade the chart with the values file:
Terminal window helm upgrade --install kube-prometheus-stack \oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack \--namespace monitoring --create-namespace -f values.yaml -
Set
remote_write_urlas described in Configuring MetalSoft, using the operator’sprometheus-operatedService:http://prometheus-operated.monitoring.svc:9090/api/v1/write
Grafana needs no change: the chart’s default Prometheus data source already points at this Prometheus.
Variant B: A dedicated Prometheus for MetalSoft
Section titled “Variant B: A dedicated Prometheus for MetalSoft”-
Create a namespace and a
Prometheusresource. APrometheusresource with no monitor selectors scrapes nothing, so it only stores what MetalSoft sends.---apiVersion: v1kind: Namespacemetadata:name: ms-metrics---apiVersion: monitoring.coreos.com/v1kind: Prometheusmetadata:name: ms-metricsnamespace: ms-metricsspec:replicas: 1enableRemoteWriteReceiver: trueretention: 30dretentionSize: 50GBresources:requests:cpu: 100mmemory: 512Milimits:memory: 2Gistorage:volumeClaimTemplate:spec:storageClassName: <storage-class>accessModes: ["ReadWriteOnce"]resources:requests:storage: 60GiTerminal window kubectl apply -f ms-metrics-prometheus.yamlThe operator watches all namespaces by default. If your installation restricts it to some namespaces, add
ms-metricsto the list. -
Add the new Prometheus to Grafana as a data source, in the chart values file:
grafana:additionalDataSources:- name: MetalSoft OOB metricsuid: ms-oob-metricstype: prometheusaccess: proxyurl: http://prometheus-operated.ms-metrics.svc:9090isDefault: falseThen run the same
helm upgrade --installcommand as in variant A. -
Set
remote_write_urlas described in Configuring MetalSoft:http://prometheus-operated.ms-metrics.svc:9090/api/v1/write
References:
- Prometheus Operator: getting started
- Prometheus Operator: storage
- Prometheus Operator API reference (
enableRemoteWriteReceiver,retention,retentionSize,storage) - kube-prometheus-stack chart README and default values
Option 3: A minimal, receive-only Prometheus
Section titled “Option 3: A minimal, receive-only Prometheus”Use this option when no Prometheus exists and you only need somewhere to store the MetalSoft metrics. It is a single Prometheus that scrapes nothing and accepts remote-write, deployed from plain manifests in its own namespace, ms-metrics. It does not need the Prometheus Operator, and it does not touch any other monitoring stack in the cluster.
Storage
Section titled “Storage”Prometheus needs one ReadWriteOnce volume. 60 GiB holds far more than 30 days of MetalSoft metrics.
| Storage | Use |
|---|---|
| A StorageClass that provisions block volumes (ext4 or xfs), such as Longhorn, Ceph RBD, vSphere CSI, or the cloud providers’ disk classes | Recommended |
A node-local volume, such as the k3s local-path class or a local PersistentVolume | Supported. The pod is tied to one node, and the data is lost with that node |
| NFS, CephFS, SMB, or another shared or network filesystem | Not supported by Prometheus. These can corrupt the database and do not enforce the volume size |
List the storage classes in the cluster with kubectl get storageclass. Keep --storage.tsdb.retention.size at 80–85% of the volume size to leave room for the write-ahead log.
Manifests
Section titled “Manifests”Save the following as ms-metrics.yaml. Replace <storage-class> with your storage class, or remove the storageClassName line to use the cluster’s default class.
---apiVersion: v1kind: Namespacemetadata: name: ms-metrics---apiVersion: v1kind: PersistentVolumeClaimmetadata: name: prometheus-tsdb namespace: ms-metricsspec: accessModes: - ReadWriteOnce storageClassName: <storage-class> resources: requests: storage: 60Gi---# Receive-only: no scrape jobs. Without this file, the image's default# configuration scrapes Prometheus itself.apiVersion: v1kind: ConfigMapmetadata: name: prometheus-config namespace: ms-metricsdata: prometheus.yml: | scrape_configs: []---apiVersion: apps/v1kind: StatefulSetmetadata: name: prometheus namespace: ms-metrics labels: &labels app.kubernetes.io/name: prometheus app.kubernetes.io/instance: ms-metricsspec: replicas: 1 serviceName: prometheus selector: matchLabels: *labels template: metadata: labels: *labels spec: securityContext: runAsUser: 65534 runAsGroup: 65534 runAsNonRoot: true fsGroup: 65534 containers: - name: prometheus image: quay.io/prometheus/prometheus:v3.5.0 args: - --config.file=/etc/prometheus/prometheus.yml - --storage.tsdb.path=/prometheus - --storage.tsdb.retention.time=30d - --storage.tsdb.retention.size=50GB - --web.enable-remote-write-receiver ports: - name: http containerPort: 9090 readinessProbe: httpGet: path: /-/ready port: http initialDelaySeconds: 10 livenessProbe: httpGet: path: /-/healthy port: http initialDelaySeconds: 30 resources: requests: cpu: 100m memory: 512Mi limits: cpu: "1" memory: 2Gi volumeMounts: - name: config mountPath: /etc/prometheus - name: tsdb mountPath: /prometheus volumes: - name: config configMap: name: prometheus-config - name: tsdb persistentVolumeClaim: claimName: prometheus-tsdb---apiVersion: v1kind: Servicemetadata: name: prometheus namespace: ms-metrics labels: app.kubernetes.io/name: prometheus app.kubernetes.io/instance: ms-metricsspec: type: ClusterIP selector: app.kubernetes.io/name: prometheus app.kubernetes.io/instance: ms-metrics ports: - name: http port: 9090 targetPort: httpApply it and wait for Prometheus to start:
kubectl apply -f ms-metrics.yamlkubectl -n ms-metrics rollout status statefulset prometheusThen set remote_write_url as described in Configuring MetalSoft:
http://prometheus.ms-metrics.svc:9090/api/v1/writeAdding it to Grafana
Section titled “Adding it to Grafana”Add a Prometheus data source with the URL http://prometheus.ms-metrics.svc:9090, in the Grafana UI or its provisioning files.
If Grafana comes from kube-prometheus-stack, you can instead let its sidecar load the data source from a ConfigMap. Create the ConfigMap in Grafana’s namespace, here monitoring. Grafana picks it up without a restart.
apiVersion: v1kind: ConfigMapmetadata: name: ms-metrics-grafana-datasource namespace: monitoring labels: grafana_datasource: "1"data: ms-metrics-datasource.yaml: |- apiVersion: 1 datasources: - name: MetalSoft OOB metrics uid: ms-oob-metrics type: prometheus access: proxy url: http://prometheus.ms-metrics.svc:9090 isDefault: false editable: falseAccess and authentication
Section titled “Access and authentication”The Service is reachable only inside the cluster, and Prometheus itself has no login. Keep it that way, and let Grafana handle user access. If writers or readers outside the cluster need it, expose it through an ingress that adds authentication, such as basic auth on the ingress controller, and allow only the paths they need.
Prometheus can also enforce TLS and basic auth itself with --web.config.file. These apply to every endpoint, including the write path and the health probes, and MetalSoft does not send credentials in version 8.0, so do not enable them on the endpoint MetalSoft writes to.
Operations
Section titled “Operations”- Configuration changes. Run
kubectl -n ms-metrics rollout restart statefulset prometheus. There is one replica, and MetalSoft does not buffer or retry, so samples sent during the restart are lost. - Retention. Prometheus deletes data when it reaches either the time or the size limit, whichever comes first.
- Removal. Delete the
ms-metricsnamespace and the Grafana data source. The storage class’s reclaim policy decides whether the volume and its data are deleted.
Verifying the setup
Section titled “Verifying the setup”On the Global Controller, check that the orchestrator has the URL and can reach the endpoint:
kubectl -n <namespace> exec deploy/orchestrator -- env | grep REMOTE_WRITE_URLkubectl -n <namespace> exec deploy/orchestrator -- wget -qO- http://prometheus.ms-metrics.svc:9090/-/readyReplace the URL in the second command with your endpoint’s base URL. A ready Prometheus answers Prometheus Server is Ready.
After 5 minutes, check that data arrives. For the minimal Prometheus from option 3:
# writes received: code="204" counts accepted writes, other codes count rejected oneskubectl -n ms-metrics exec prometheus-0 -- wget -qO- localhost:9090/metrics | grep 'handler="/api/v1/write"'
# sites that have reportedkubectl -n ms-metrics exec prometheus-0 -- wget -qO- 'localhost:9090/api/v1/label/site_name/values'On any Prometheus, run count by (site_name) (server_temperature_celsius) in the Prometheus UI or Grafana Explore. It returns one row per reporting site.
Example queries:
| Query | Shows |
|---|---|
max by (site_name, server_serial_number) (server_temperature_celsius) | Hottest sensor per server |
sum by (site_name) (server_power_consumption_watts) | Total power draw per site |
min by (server_serial_number, fan) (server_fan_speed_rpm) == 0 | Stopped fans |
If no data arrives:
- Check that
remote_write_urlis set, that you restarted the orchestrator after changing it, and that the orchestrator logs do not report errors forcron_server_metrics_update:kubectl -n <namespace> logs deploy/orchestrator | grep -i -e metrics -e prometheus. - Check that health monitoring is enabled on the site, and that Job Queue > Scheduled Jobs lists
system-defined-server-metrics-update-site-<site ID>. - Check that the endpoint accepts unauthenticated remote-write. A
401or403means it requires credentials, and a404means the receiver is not enabled or the path is wrong.