Skip to content

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:

  1. An existing, external Prometheus: MetalSoft only sends data to it.
  2. A Prometheus managed by the Prometheus Operator, including Grafana.
  3. 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.

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.
MetricOne series perExtra labels
server_temperature_celsiusTemperature sensorsensor, physical_context
server_fan_speed_rpmFanfan, physical_context
server_power_consumption_wattsChassis totalcomponent, physical_context
server_component_power_wattsPower component other than the chassis totalcomponent, physical_context

Every series also carries these labels:

LabelValue
instanceBMC address
site_id, site_nameThe site the server belongs to
server_idMetalSoft server ID
server_serial_numberServer serial number
sourceAlways 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.

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.

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.

  1. In configmaps.yaml, set remote_write_enabled and remote_write_url in the remote-write ConfigMap:

    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: remote-write
    namespace: <namespace>
    data:
    remote_write_enabled: "true"
    remote_write_url: "http://prometheus.ms-metrics.svc:9090/api/v1/write"
    # leave the other keys at their defaults

    Use the URL of your endpoint: the full URL, including the /api/v1/write path. 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.

  2. Apply the ConfigMap:

    Terminal window
    kubectl -n <namespace> apply -f configmaps.yaml
  3. Restart the orchestrator. It reads the settings only at startup.

    Terminal window
    kubectl -n <namespace> rollout restart deployment orchestrator
  4. 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.

  1. 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/write with no extra configuration.

  2. Allow traffic from the Global Controller nodes to the endpoint’s address and port.
  3. Set remote_write_url to the endpoint, for example http://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”
  1. Add the receiver settings to your chart values file, for example values.yaml:

    prometheus:
    prometheusSpec:
    enableRemoteWriteReceiver: true
    retention: 30d
    retentionSize: 50GB
    storageSpec:
    volumeClaimTemplate:
    spec:
    storageClassName: <storage-class>
    accessModes: ["ReadWriteOnce"]
    resources:
    requests:
    storage: 60Gi

    retention and retentionSize apply to all the data in this Prometheus, cluster metrics included. Size them for both. See Storage for the storage class.

  2. 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
  3. Set remote_write_url as described in Configuring MetalSoft, using the operator’s prometheus-operated Service:

    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”
  1. Create a namespace and a Prometheus resource. A Prometheus resource with no monitor selectors scrapes nothing, so it only stores what MetalSoft sends.

    ---
    apiVersion: v1
    kind: Namespace
    metadata:
    name: ms-metrics
    ---
    apiVersion: monitoring.coreos.com/v1
    kind: Prometheus
    metadata:
    name: ms-metrics
    namespace: ms-metrics
    spec:
    replicas: 1
    enableRemoteWriteReceiver: true
    retention: 30d
    retentionSize: 50GB
    resources:
    requests:
    cpu: 100m
    memory: 512Mi
    limits:
    memory: 2Gi
    storage:
    volumeClaimTemplate:
    spec:
    storageClassName: <storage-class>
    accessModes: ["ReadWriteOnce"]
    resources:
    requests:
    storage: 60Gi
    Terminal window
    kubectl apply -f ms-metrics-prometheus.yaml

    The operator watches all namespaces by default. If your installation restricts it to some namespaces, add ms-metrics to the list.

  2. Add the new Prometheus to Grafana as a data source, in the chart values file:

    grafana:
    additionalDataSources:
    - name: MetalSoft OOB metrics
    uid: ms-oob-metrics
    type: prometheus
    access: proxy
    url: http://prometheus-operated.ms-metrics.svc:9090
    isDefault: false

    Then run the same helm upgrade --install command as in variant A.

  3. Set remote_write_url as described in Configuring MetalSoft:

    http://prometheus-operated.ms-metrics.svc:9090/api/v1/write

References:

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.

Prometheus needs one ReadWriteOnce volume. 60 GiB holds far more than 30 days of MetalSoft metrics.

StorageUse
A StorageClass that provisions block volumes (ext4 or xfs), such as Longhorn, Ceph RBD, vSphere CSI, or the cloud providers’ disk classesRecommended
A node-local volume, such as the k3s local-path class or a local PersistentVolumeSupported. The pod is tied to one node, and the data is lost with that node
NFS, CephFS, SMB, or another shared or network filesystemNot 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.

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: v1
kind: Namespace
metadata:
name: ms-metrics
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prometheus-tsdb
namespace: ms-metrics
spec:
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: v1
kind: ConfigMap
metadata:
name: prometheus-config
namespace: ms-metrics
data:
prometheus.yml: |
scrape_configs: []
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: prometheus
namespace: ms-metrics
labels: &labels
app.kubernetes.io/name: prometheus
app.kubernetes.io/instance: ms-metrics
spec:
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: v1
kind: Service
metadata:
name: prometheus
namespace: ms-metrics
labels:
app.kubernetes.io/name: prometheus
app.kubernetes.io/instance: ms-metrics
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: prometheus
app.kubernetes.io/instance: ms-metrics
ports:
- name: http
port: 9090
targetPort: http

Apply it and wait for Prometheus to start:

Terminal window
kubectl apply -f ms-metrics.yaml
kubectl -n ms-metrics rollout status statefulset prometheus

Then set remote_write_url as described in Configuring MetalSoft:

http://prometheus.ms-metrics.svc:9090/api/v1/write

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: v1
kind: ConfigMap
metadata:
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: false

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.

  • 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-metrics namespace and the Grafana data source. The storage class’s reclaim policy decides whether the volume and its data are deleted.

On the Global Controller, check that the orchestrator has the URL and can reach the endpoint:

Terminal window
kubectl -n <namespace> exec deploy/orchestrator -- env | grep REMOTE_WRITE_URL
kubectl -n <namespace> exec deploy/orchestrator -- wget -qO- http://prometheus.ms-metrics.svc:9090/-/ready

Replace 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:

Terminal window
# writes received: code="204" counts accepted writes, other codes count rejected ones
kubectl -n ms-metrics exec prometheus-0 -- wget -qO- localhost:9090/metrics | grep 'handler="/api/v1/write"'
# sites that have reported
kubectl -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:

QueryShows
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) == 0Stopped fans

If no data arrives:

  • Check that remote_write_url is set, that you restarted the orchestrator after changing it, and that the orchestrator logs do not report errors for cron_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 401 or 403 means it requires credentials, and a 404 means the receiver is not enabled or the path is wrong.