OpenShift on vSphere gives you two monitoring worlds that never meet. The cluster has its own Prometheus, its own console and, if you install the operators, its own tracing. vCenter has its own performance charts. When a pod is slow, the OpenShift side can tell you the node is busy, and the vSphere side can tell you the VM has CPU ready time, but nothing tells you they are the same machine. This post builds an OpenTelemetry pipeline on OpenShift with the Red Hat build of OpenTelemetry, sends traces to an in-cluster TempoStack and metrics and logs to an external Prometheus and Loki, and then joins the node VMs to vCenter telemetry using the Machine API so that a pod, its node and its VM share one label.
Level: intermediate to advanced · Stack: OpenShift on vSphere (IPI), Red Hat build of OpenTelemetry 3.11, Tempo Operator (distributed tracing 3.11), Cluster Observability Operator 1.5, external Prometheus and Loki, upstream otelcol-contrib for vCenter · Build time: about 3 hours including object storage
Contents
- What we are building, and what things are called
- Architecture
- How this fits with OpenShift monitoring and COO
- Design decisions
- Installing the operators
- TempoStack and the tracing UI
- SCC and RBAC
- Collector custom resources
- Auto-instrumentation
- Joining node VMs to vCenter telemetry
- End-to-end workflow with oc
- Troubleshooting
- What’s next
01. What we are building, and what things are called
Red Hat renames observability products often enough that it is worth pinning the names down before you search for anything. As of the 3.11 documentation (December 2026):
| Thing | Current name | Operator package / namespace | What it gives you |
|---|---|---|---|
| OpenTelemetry | Red Hat build of OpenTelemetry, installed by the Red Hat build of OpenTelemetry Operator | opentelemetry-product in openshift-opentelemetry-operator | CRDs OpenTelemetryCollector (opentelemetry.io/v1beta1) and Instrumentation (opentelemetry.io/v1alpha1), plus target allocator and OpAMP bridge support |
| Tracing backend | Red Hat OpenShift distributed tracing platform, installed by the Tempo Operator | tempo-product in openshift-tempo-operator | CRDs TempoStack and TempoMonolithic (tempo.grafana.com/v1alpha1) |
| Console plugins and extra stacks | Cluster Observability Operator (COO) | installed into openshift-cluster-observability-operator, channel stable | UIPlugin (observability.openshift.io/v1alpha1), including the distributed tracing plugin at Observe → Traces |
| Built-in metrics | OpenShift monitoring (Cluster Monitoring Operator) | openshift-monitoring, plus openshift-user-workload-monitoring when enabled | Platform Prometheus and Alertmanager; user workload monitoring scrapes ServiceMonitor and PodMonitor objects in your namespaces |
The Red Hat build of OpenTelemetry 3.11 is based on upstream Collector 0.158.0 and distributed tracing 3.11 is based on Grafana Tempo 2.10. Two changes in the 3.11 release notes matter for anything you copy from older blogs: the Jaeger Query component in the Tempo Operator is deprecated in favour of the COO tracing UI plugin, and the Prometheus exporter dropped add_metric_suffixes in favour of translation_strategy.
The vCenter receiver is not in the Red Hat build. The Red Hat build of OpenTelemetry ships a curated set of receivers, processors and exporters, and
vcenteris not one of them. You can run the upstreamotelcol-contribimage for that job, but Red Hat will not support that Collector. This post runs it outside the cluster, which turns out to be the better design anyway (section 04).
02. Architecture
There are four moving parts. An agent Collector runs as a DaemonSet on every node, including control plane nodes, and reads kubelet stats and pod log files from the node it runs on. A gateway Collector runs as a Deployment, receives OTLP from the agents and from instrumented applications, enriches it with Kubernetes metadata and exports each signal to its backend. A TempoStack in its own namespace stores traces in object storage, behind a gateway that enforces OpenShift authentication and tenants. And an external contrib Collector polls vCenter and writes VM, host and datastore metrics to the same Prometheus, tagged so they join with the node metrics.
03. How this fits with OpenShift monitoring and COO
The most common mistake is to treat the OTel pipeline as a replacement for OpenShift monitoring. It is not, and it should not try to be. Here is the split I use:
| Need | Use | Why |
|---|---|---|
| Cluster health, etcd, API server, node exporter, built-in alerts | Platform monitoring (openshift-monitoring) | Red Hat maintains the rules and dashboards; do not rebuild them |
| Metrics from your own apps inside the console | User workload monitoring | Native ServiceMonitor support, console integration, tenancy by namespace |
| Collector self-metrics | User workload monitoring via enableMetrics: true | The operator creates the ServiceMonitor objects for you |
| App traces | OTel gateway → TempoStack, viewed with the COO tracing UI plugin | Supported path, tenants enforced by the Tempo gateway |
| Kubernetes and app metrics next to vCenter metrics | OTel gateway → external Prometheus | Platform Prometheus is not where your vSphere data lives, and you should not push vCenter data into it |
| Pod logs in the same Loki as ESXi logs | OTel agent filelog → gateway → external Loki | Only if you are not already forwarding with OpenShift Logging; pick one log collector, not two |
COO also ships an ObservabilityInstaller resource that installs the OpenTelemetry Collector, Tempo and the tracing UI plugin in one go. In the COO 1.5 documentation that end-to-end stack is marked Technology Preview, so this post installs the parts explicitly. If you are building a lab, it is worth a look.
04. Design decisions
Decision 01: agent plus gateway, not one big Collector
Kubelet stats and pod log files are node-local, so they need a DaemonSet. Exporting to three backends with authentication, retries and batching is better done in a small number of gateway replicas that you can scale and restart independently. Apps send to the gateway Service, so a gateway restart does not touch every node.
Decision 02: the vCenter Collector lives outside the cluster
Three reasons. It is an unsupported image as far as Red Hat is concerned, so keeping it off the cluster keeps your support case clean. It needs vCenter credentials, which you would rather not put in a cluster that many teams can reach. And when the cluster is in trouble (which is exactly when you need vSphere data about its node VMs) a Collector running inside it is the first thing you lose. One small VM or container next to Prometheus is enough; see sizing the OTel Collector for vSphere for sizing.
Decision 03: TempoStack with the gateway and tenants on
Red Hat documents a TempoStack without configured tenants as unsupported. With tenants.mode: openshift the gateway authenticates writers and readers with OpenShift tokens and RBAC, which means the gateway Collector needs a service account token, a tenant header and a ClusterRole that grants create on that tenant. This is more setup than pointing at the distributor, but it is the supported path and it works with the COO tracing plugin.
Decision 04: the join key is the node name, not the UUID
This is explained in detail in section 10. Short version: OpenShift records the VM’s BIOS UUID in spec.providerID, while the vCenter receiver labels VMs with the instance UUID. They are different values. On installer-provisioned clusters the node name, Machine name and VM name are the same string, so we join on that and use the UUIDs only to prove the mapping.
05. Installing the operators
OperatorHub in the console works fine, but YAML is repeatable. These manifests match the Red Hat CLI procedures; apply them as a cluster administrator. installPlanApproval: Manual is a reasonable change for production so operator upgrades happen when you choose.
# 01-operators.yaml
apiVersion: project.openshift.io/v1
kind: Project
metadata:
name: openshift-opentelemetry-operator
labels:
kubernetes.io/metadata.name: openshift-opentelemetry-operator
openshift.io/cluster-monitoring: "true"
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openshift-opentelemetry-operator
namespace: openshift-opentelemetry-operator
spec:
upgradeStrategy: Default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: opentelemetry-product
namespace: openshift-opentelemetry-operator
spec:
channel: stable
installPlanApproval: Automatic
name: opentelemetry-product
source: redhat-operators
sourceNamespace: openshift-marketplace
---
apiVersion: project.openshift.io/v1
kind: Project
metadata:
name: openshift-tempo-operator
labels:
kubernetes.io/metadata.name: openshift-tempo-operator
openshift.io/cluster-monitoring: "true"
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openshift-tempo-operator
namespace: openshift-tempo-operator
spec:
upgradeStrategy: Default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: tempo-product
namespace: openshift-tempo-operator
spec:
channel: stable
installPlanApproval: Automatic
name: tempo-product
source: redhat-operators
sourceNamespace: openshift-marketplace
If your cluster is disconnected, source is the name of your mirrored catalog rather than redhat-operators. Check the exact package names in your catalog first:
oc get packagemanifests -n openshift-marketplace | grep -E 'opentelemetry-product|tempo-product|cluster-observability-operator'
oc apply -f 01-operators.yaml
oc get csv -n openshift-opentelemetry-operator
oc get csv -n openshift-tempo-operator
oc get crd | grep -E 'opentelemetry.io|tempo.grafana.com'
Install the Cluster Observability Operator from OperatorHub into its recommended namespace openshift-cluster-observability-operator on the stable channel; that is the documented route. Then enable user workload monitoring if it is not already on, because the Collector self-metrics depend on it:
# 02-user-workload-monitoring.yaml (merge into the existing ConfigMap if you already have one)
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: |
enableUserWorkload: true
06. TempoStack and the tracing UI
TempoStack needs S3-compatible object storage. On a vSphere estate that is usually OpenShift Data Foundation, MinIO, or the S3 service on your existing storage array. Create the bucket first, then the secret from environment variables so the keys never land in a file in Git.
oc new-project tracing
oc -n tracing create secret generic tempo-s3 \
--from-literal=endpoint="<S3_ENDPOINT_URL>" \
--from-literal=bucket="<TEMPO_BUCKET>" \
--from-literal=access_key_id="${TEMPO_S3_ACCESS_KEY_ID}" \
--from-literal=access_key_secret="${TEMPO_S3_SECRET_ACCESS_KEY}"
# 03-tempostack.yaml
apiVersion: tempo.grafana.com/v1alpha1
kind: TempoStack
metadata:
name: traces
namespace: tracing
spec:
storage:
secret:
name: tempo-s3
type: s3
storageSize: 10Gi # WAL PVC per ingester; default storage class on vSphere is usually thin-csi
resources:
total:
limits:
memory: 4Gi
cpu: 2000m
tenants:
mode: openshift
authentication:
- tenantName: application
tenantId: "<UUID_GENERATED_ONCE_AND_NEVER_CHANGED>"
template:
gateway:
enabled: true
---
# Who may write traces into the "application" tenant
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tempostack-traces-write
rules:
- apiGroups: ["tempo.grafana.com"]
resources: ["application"]
resourceNames: ["traces"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tempostack-traces-write
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: tempostack-traces-write
subjects:
- kind: ServiceAccount
name: otel-gateway
namespace: observability
---
# Who may read traces from the "application" tenant (tighten this group for production)
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tempostack-traces-read
rules:
- apiGroups: ["tempo.grafana.com"]
resources: ["application"]
resourceNames: ["traces"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tempostack-traces-read
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: tempostack-traces-read
subjects:
- kind: Group
apiGroup: rbac.authorization.k8s.io
name: <TRACE_READERS_GROUP>
---
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
name: distributed-tracing
spec:
type: DistributedTracing
Generate the tenant ID once with uuidgen and keep it: Tempo prefixes objects in the bucket with it, so changing it later orphans your existing traces. The Tempo Operator names services tempo-<name>-<component>, so the gateway for a stack called traces is tempo-traces-gateway.tracing.svc.cluster.local, with OTLP gRPC on port 8090 and HTTP on 8080. I deliberately left jaegerQuery off; it is deprecated in 3.11 and the UI plugin replaces it.
07. SCC and RBAC
Each Collector component you enable needs specific permissions, and OpenShift adds Security Context Constraints on top of RBAC. Here is the full list for this build:
| Component | Runs in | Needs | Why |
|---|---|---|---|
kubeletstats receiver | agent | ClusterRole: nodes/stats get, list, watch; nodes/proxy get | Reads the kubelet summary API on port 10250 with the service account token |
filelog receiver | agent | Custom SCC allowing hostPath, run as root with SELinux type spc_t, read-only | Reads /var/log/pods on the node. Not needed if you skip pod logs. |
k8sattributes processor | gateway | ClusterRole: pods, namespaces get, list, watch; apps/replicasets get, list, watch | Looks up pod metadata from the API server |
| Tempo export | gateway | create on tempo.grafana.com/application, resource name traces | Tempo gateway authorises writes per tenant (section 06) |
| Instrumentation (Java, Node.js, Python, .NET) | app pods | Nothing extra | Injection uses an init container and a shared volume |
| Instrumentation (Go) | app pods | Privileged SCC for the injected sidecar | Go auto-instrumentation uses eBPF; avoid it unless you need it |
You can let the operator create component RBAC automatically by granting its controller service account rights over ClusterRoles, as described in the Red Hat docs. I prefer explicit RBAC that is visible in Git, so the manifests below do it by hand.
# 04-collector-rbac.yaml
apiVersion: v1
kind: Namespace
metadata:
name: observability
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: otel-agent
namespace: observability
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: otel-gateway
namespace: observability
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: otel-agent
rules:
- apiGroups: [""]
resources: ["nodes/stats"]
verbs: ["get", "watch", "list"]
- apiGroups: [""]
resources: ["nodes/proxy"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: otel-agent
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: otel-agent
subjects:
- kind: ServiceAccount
name: otel-agent
namespace: observability
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: otel-gateway
rules:
- apiGroups: [""]
resources: ["pods", "namespaces"]
verbs: ["get", "watch", "list"]
- apiGroups: ["apps"]
resources: ["replicasets"]
verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: otel-gateway
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: otel-gateway
subjects:
- kind: ServiceAccount
name: otel-gateway
namespace: observability
---
# Only needed for the filelog receiver (pod logs). Scoped to the agent service account.
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: otel-agent-hostlogs
allowPrivilegedContainer: false
allowPrivilegeEscalation: false
defaultAllowPrivilegeEscalation: false
requiredDropCapabilities:
- ALL
allowHostDirVolumePlugin: true
allowHostIPC: false
allowHostNetwork: false
allowHostPID: false
allowHostPorts: false
readOnlyRootFilesystem: true
runAsUser:
type: RunAsAny
seLinuxContext:
type: RunAsAny
fsGroup:
type: RunAsAny
supplementalGroups:
type: RunAsAny
seccompProfiles:
- runtime/default
forbiddenSysctls:
- "*"
volumes:
- configMap
- emptyDir
- hostPath
- projected
- secret
users:
- system:serviceaccount:observability:otel-agent
Keep the SCC narrow. It is bound to one service account in one namespace, allows host paths but not privileged containers, and drops all capabilities. Do not reuse the agent service account for anything else, and do not put the agent in a namespace where other teams can create pods with that service account.
08. Collector custom resources
Get the cluster identifiers you will use as labels first. The infrastructure name is the prefix of every VM the installer created.
oc get infrastructure cluster -o jsonpath='{.status.infrastructureName}{"\n"}{.status.platformStatus.type}{"\n"}'
# ocp01-x7k2p
# VSphere
8.1 Agent (DaemonSet)
# 05-otel-agent.yaml
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: agent
namespace: observability
spec:
mode: daemonset
serviceAccount: otel-agent
tolerations:
- operator: Exists # also run on control plane and infra nodes
env:
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
securityContext: # required by filelog + the SCC in section 07
runAsUser: 0
seLinuxOptions:
type: spc_t
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
capabilities:
drop: ["ALL"]
volumeMounts:
- name: varlogpods
mountPath: /var/log/pods
readOnly: true
volumes:
- name: varlogpods
hostPath:
path: /var/log/pods
resources:
requests: { cpu: 100m, memory: 200Mi }
limits: { memory: 500Mi }
config:
receivers:
kubeletstats:
collection_interval: 30s
auth_type: serviceAccount
endpoint: "https://${env:K8S_NODE_NAME}:10250"
insecure_skip_verify: true
metric_groups: [node, pod, container]
filelog:
include: ["/var/log/pods/*/*/*.log"]
exclude:
- "/var/log/pods/*/otc-container/*.log" # the Collectors' own logs
- "/var/log/pods/*/*/*.gz"
- "/var/log/pods/*/*/*.log.*"
- "/var/log/pods/*/*/*.tmp"
include_file_path: true
include_file_name: false
operators:
- type: container # parses CRI-O lines, adds k8s.pod/namespace/container attributes
processors:
memory_limiter:
check_interval: 1s
limit_percentage: 75
spike_limit_percentage: 20
resource/node:
attributes:
- key: k8s.node.name
value: "${env:K8S_NODE_NAME}"
action: upsert
- key: k8s.cluster.name
value: "<CLUSTER_NAME>"
action: upsert
batch: {}
exporters:
otlp_grpc:
endpoint: gateway-collector.observability.svc.cluster.local:4317
tls:
insecure: true # in-cluster hop; see the note below for TLS
service:
pipelines:
metrics:
receivers: [kubeletstats]
processors: [memory_limiter, resource/node, batch]
exporters: [otlp_grpc]
logs:
receivers: [filelog]
processors: [memory_limiter, resource/node, batch]
exporters: [otlp_grpc]
If you do not want pod logs (because OpenShift Logging already ships them), delete the filelog receiver, the logs pipeline, the securityContext, the volume and the SCC. The agent then runs under the default restricted SCC with only the kubelet RBAC.
8.2 Gateway (Deployment)
Create the secrets and CA bundle for the external backends from environment variables first. If your Prometheus and Loki sit on a trusted network without authentication, drop the bearertokenauth/* extensions and the auth blocks.
oc -n observability create configmap external-ca --from-file=ca.crt=<PATH_TO_EXTERNAL_CA_PEM>
oc -n observability create secret generic prom-rw-token --from-literal=token="${PROM_RW_TOKEN}"
oc -n observability create secret generic loki-token --from-literal=token="${LOKI_TOKEN}"
# 06-otel-gateway.yaml
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: gateway
namespace: observability
spec:
mode: deployment
replicas: 2
serviceAccount: otel-gateway
observability:
metrics:
enableMetrics: true # ServiceMonitors for user workload monitoring
volumeMounts:
- { name: external-ca, mountPath: /etc/otel/external-ca, readOnly: true }
- { name: prom-rw-token, mountPath: /etc/otel/prom, readOnly: true }
- { name: loki-token, mountPath: /etc/otel/loki, readOnly: true }
volumes:
- { name: external-ca, configMap: { name: external-ca } }
- { name: prom-rw-token, secret: { secretName: prom-rw-token } }
- { name: loki-token, secret: { secretName: loki-token } }
resources:
requests: { cpu: 200m, memory: 512Mi }
limits: { memory: 1Gi }
config:
extensions:
bearertokenauth/tempo:
filename: /var/run/secrets/kubernetes.io/serviceaccount/token
bearertokenauth/prom:
filename: /etc/otel/prom/token
bearertokenauth/loki:
filename: /etc/otel/loki/token
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
memory_limiter:
check_interval: 1s
limit_percentage: 75
spike_limit_percentage: 20
k8sattributes:
extract:
metadata:
- k8s.namespace.name
- k8s.pod.name
- k8s.pod.uid
- k8s.deployment.name
- k8s.node.name
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: connection
resource/cluster:
attributes:
- key: k8s.cluster.name
value: "<CLUSTER_NAME>"
action: upsert
batch:
send_batch_size: 8192
timeout: 5s
exporters:
otlp_grpc/tempo:
endpoint: tempo-traces-gateway.tracing.svc.cluster.local:8090
tls:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
auth:
authenticator: bearertokenauth/tempo
headers:
X-Scope-OrgID: application
prometheusremotewrite:
endpoint: https://<PROMETHEUS_FQDN>/api/v1/write
tls:
ca_file: /etc/otel/external-ca/ca.crt
auth:
authenticator: bearertokenauth/prom
resource_to_telemetry_conversion:
enabled: true # k8s.* resource attributes become labels
otlp_http/loki:
endpoint: https://<LOKI_FQDN>/otlp # exporter appends /v1/logs
tls:
ca_file: /etc/otel/external-ca/ca.crt
auth:
authenticator: bearertokenauth/loki
headers:
X-Scope-OrgID: <LOKI_TENANT> # only if Loki runs multi-tenant
service:
extensions: [bearertokenauth/tempo, bearertokenauth/prom, bearertokenauth/loki]
telemetry:
metrics:
readers:
- pull:
exporter:
prometheus:
host: 0.0.0.0
port: 8888
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, k8sattributes, resource/cluster, batch]
exporters: [otlp_grpc/tempo]
metrics:
receivers: [otlp]
processors: [memory_limiter, k8sattributes, resource/cluster, batch]
exporters: [prometheusremotewrite]
logs:
receivers: [otlp]
processors: [memory_limiter, k8sattributes, resource/cluster, batch]
exporters: [otlp_http/loki]
Which component names to use. Upstream contrib renamed many components to snake_case between roughly v0.144 and v0.154, keeping the old names as deprecated aliases:
otlpandotlphttpexporters becameotlp_grpcandotlp_http,kubeletstatsbecamekubelet_stats,k8sattributesbecamek8s_attributes,filelogbecamefile_logandprometheusremotewritebecameprometheus_remote_write. The Red Hat build of OpenTelemetry 3.11 is based on Collector 0.158.0, and its own documentation usesotlp_grpc/otlp_httpfor the exporters but the older spellings forkubeletstats,k8sattributes,filelogandprometheusremotewrite. The in-cluster CRs here follow the Red Hat 3.11 documentation, because that is what Red Hat supports and what the operator is tested with. The external vCenter Collector in section 10 runs upstream 0.166.0 and uses the new names. Older examples, including some in the Tempo documentation, still showotlp/devandotlphttp/dev.
Remote write to a stock Prometheus needs --web.enable-remote-write-receiver on that Prometheus, and the exporter drops non-cumulative monotonic, histogram and summary OTLP metrics, as the Red Hat docs point out. If your external store is Mimir, the endpoint path is usually /api/v1/push instead. The agent-to-gateway hop uses plaintext gRPC inside the cluster; if your policy requires TLS there too, annotate the gateway Service for an OpenShift service-serving certificate and point the agent at it with the service CA, the same way the gateway trusts the Tempo gateway.
8.3 Metrics into user workload monitoring instead
If you only want Collector-derived metrics inside the console and not in an external Prometheus, replace the remote write exporter with the Prometheus exporter. With enableMetrics: true the operator creates a ServiceMonitor for the <name>-collector service, and user workload monitoring scrapes it:
exporters:
prometheus:
endpoint: 0.0.0.0:8889
resource_to_telemetry_conversion:
enabled: true
service:
pipelines:
metrics:
receivers: [otlp]
processors: [memory_limiter, k8sattributes, resource/cluster, batch]
exporters: [prometheus]
09. Auto-instrumentation
The Instrumentation resource tells the operator how to configure the SDK it injects into annotated pods. Red Hat supports the injection mechanism; the instrumentation images themselves are upstream community images, so treat them like any other third-party image in your supply chain.
# 07-instrumentation.yaml (one per application namespace)
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: default
namespace: <APP_NAMESPACE>
spec:
exporter:
endpoint: http://gateway-collector.observability.svc.cluster.local:4317
propagators:
- tracecontext
- baggage
sampler:
type: parentbased_traceidratio
argument: "0.25"
python:
env:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://gateway-collector.observability.svc.cluster.local:4318
dotnet:
env:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://gateway-collector.observability.svc.cluster.local:4318
go:
env:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://gateway-collector.observability.svc.cluster.local:4318
Python, .NET and Go default to OTLP over HTTP, which is why they get the 4318 endpoint. Then annotate the pod template of a workload, not the Deployment metadata:
oc -n <APP_NAMESPACE> patch deployment <APP_DEPLOYMENT> --type merge -p \
'{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-java":"true"}}}}}'
# other values: inject-nodejs, inject-python, inject-dotnet, inject-go, inject-apache-httpd
The patch triggers a rollout. Pods created before the Instrumentation object existed are not modified, so always create the Instrumentation first.
10. Joining node VMs to vCenter telemetry
This is the part nobody writes down. On OpenShift IPI for vSphere the Machine API creates one VM per Machine, and the kubelet registers a Node with the same name. Three identifiers tie them together, and only one of them is useful as a metric label.
| Identifier | Where it lives | Example | Use as join key? |
|---|---|---|---|
| Node name / Machine name / VM name | node.metadata.name, machine.metadata.name, vCenter inventory name | ocp01-x7k2p-worker-0-9wqzl | Yes on IPI clusters, where all three are equal |
| BIOS UUID | node.spec.providerID as vsphere://<uuid>; vCenter config.uuid | vsphere://4230a1b2-... | No: the vCenter receiver does not emit it |
| Instance UUID | vCenter config.instanceUuid; the receiver’s vcenter.vm.id | 5030c4d5-... | No: OpenShift does not store it |
The vSphere cloud provider looks VMs up with a BIOS UUID search, which is why providerID carries the BIOS UUID, while the OTel vCenter receiver sets vcenter.vm.id from the VM’s InstanceUuid. If you try to join those two you will get zero matches and spend an afternoon wondering why. Use the names, and use the UUIDs once to prove the names are trustworthy.
10.1 Look at the Machine API side
# Nodes, their providerID and their Machine
oc get nodes -o custom-columns='NODE:.metadata.name,PROVIDERID:.spec.providerID,MACHINE:.metadata.annotations.machine\.openshift\.io/machine'
# Machines with phase and node
oc get machines -n openshift-machine-api -o wide
# Where a Machine's VM lives in vCenter
oc get machine <MACHINE_NAME> -n openshift-machine-api \
-o jsonpath='{.spec.providerSpec.value.workspace}{"\n"}'
# {"datacenter":"<DC>","datastore":"<DATASTORE>","folder":"/<DC>/vm/ocp01-x7k2p","resourcePool":"...","server":"vcenter01.lab.local"}
10.2 Prove the mapping with PowerCLI
This script reads nodes from oc, VMs from vCenter, matches them on BIOS UUID, and tells you whether the names agree. Run it from an admin workstation with oc logged in and PowerCLI installed. Credentials come from environment variables.
# Test-OcpNodeVmMap.ps1
param(
[Parameter(Mandatory)] [string] $VCenter, # e.g. vcenter01.lab.local
[Parameter(Mandatory)] [string] $InfraId, # oc get infrastructure cluster -o jsonpath='{.status.infrastructureName}'
[string] $OutCsv = "./ocp-node-vm-map.csv"
)
$ErrorActionPreference = 'Stop'
if (-not $env:VCENTER_USER -or -not $env:VCENTER_PASSWORD) { throw "Set VCENTER_USER and VCENTER_PASSWORD" }
$cred = New-Object System.Management.Automation.PSCredential(
$env:VCENTER_USER, (ConvertTo-SecureString $env:VCENTER_PASSWORD -AsPlainText -Force))
Connect-VIServer -Server $VCenter -Credential $cred | Out-Null
$nodes = (oc get nodes -o json | ConvertFrom-Json).items | ForEach-Object {
[pscustomobject]@{
Node = $_.metadata.name
ProviderUuid = ($_.spec.providerID -replace '^vsphere://', '').ToLower()
Machine = $_.metadata.annotations.'machine.openshift.io/machine'
}
}
$vms = Get-VM -Name "$InfraId-*" | ForEach-Object {
[pscustomobject]@{
VmName = $_.Name
BiosUuid = $_.ExtensionData.Config.Uuid.ToLower()
InstanceUuid = $_.ExtensionData.Config.InstanceUuid.ToLower()
EsxiHost = $_.VMHost.Name
Datastores = (($_ | Get-Datastore).Name -join ';')
}
}
$map = foreach ($n in $nodes) {
$vm = $vms | Where-Object { $_.BiosUuid -eq $n.ProviderUuid } | Select-Object -First 1
[pscustomobject]@{
Node = $n.Node
Machine = $n.Machine
VmName = $vm.VmName
NameMatches = ($null -ne $vm -and $vm.VmName -eq $n.Node)
BiosUuid = $n.ProviderUuid
InstanceUuid = $vm.InstanceUuid
EsxiHost = $vm.EsxiHost
Datastores = $vm.Datastores
}
}
$map | Sort-Object Node | Format-Table Node, VmName, NameMatches, EsxiHost, Datastores -AutoSize
$map | Export-Csv -NoTypeInformation -Path $OutCsv
$bad = @($map | Where-Object { -not $_.NameMatches })
Disconnect-VIServer -Server $VCenter -Confirm:$false
if ($bad.Count -gt 0) { Write-Warning "$($bad.Count) node(s) do not match a VM by name; see $OutCsv"; exit 1 }
Write-Host "All $($map.Count) nodes match their VM by name. Safe to join on k8s.node.name."
If any row fails, you are probably on a user-provisioned (UPI) cluster where VM names were chosen by hand, or someone renamed VMs in vCenter. In that case build the join from the CSV instead: load Node and VmName pairs into the transform below as explicit statements, or fix the VM names.
10.3 The vCenter Collector (outside the cluster)
This runs on a VM next to Prometheus, using the upstream otelcol-contrib distribution (the vCenter receiver is alpha and contrib-only). The transform processor copies the VM name into k8s.node.name for VMs whose name starts with the cluster’s infrastructure name, and stamps the cluster name, so vCenter series carry the same labels as the kubelet series from section 08.
# /etc/otelcol-contrib/config.yaml on the external Collector VM (upstream otelcol-contrib 0.166.0)
receivers:
vcenter:
endpoint: https://<VCENTER_FQDN>
username: ${env:VCENTER_USER}
password: ${env:VCENTER_PASSWORD}
collection_interval: 2m
initial_delay: 10s
tls:
ca_file: /etc/otelcol-contrib/vcenter-ca.pem
processors:
memory_limiter:
check_interval: 1s
limit_percentage: 75
spike_limit_percentage: 20
transform/ocp-join:
error_mode: ignore
metric_statements:
- context: resource
statements:
- set(attributes["k8s.node.name"], attributes["vcenter.vm.name"]) where attributes["vcenter.vm.name"] != nil and IsMatch(attributes["vcenter.vm.name"], "^<INFRA_ID>-")
- set(attributes["k8s.cluster.name"], "<CLUSTER_NAME>") where attributes["vcenter.vm.name"] != nil and IsMatch(attributes["vcenter.vm.name"], "^<INFRA_ID>-")
batch: {}
exporters:
prometheus_remote_write:
http:
endpoint: https://<PROMETHEUS_FQDN>/api/v1/write
tls:
ca_file: /etc/otelcol-contrib/external-ca.pem
resource_constant_labels:
included: ["*"]
service:
pipelines:
metrics:
receivers: [vcenter]
processors: [memory_limiter, transform/ocp-join, batch]
exporters: [prometheus_remote_write]
Host, datastore and cluster series pass through untouched; only VM resources with a matching name get the extra labels. If you run several OpenShift clusters on the same vCenter, add one pair of statements per infrastructure name.
10.4 Queries that use the join
With remote write translation and suffixes, vcenter.vm.cpu.readiness (unit %) arrives as vcenter_vm_cpu_readiness_percent and resource attributes become labels such as k8s_node_name and vcenter_host_name. Confirm the exact names in Grafana Explore, then:
# Which ESXi host is each OpenShift node VM on right now?
count by (k8s_node_name, vcenter_host_name) (
vcenter_vm_cpu_utilization_percent{k8s_cluster_name="<CLUSTER_NAME>"}
)
# CPU ready per node VM, side by side with what the kubelet reports for the node
max by (k8s_node_name) (vcenter_vm_cpu_readiness_percent{k8s_cluster_name="<CLUSTER_NAME>"})
# Node VMs whose disk latency is high, with the pods currently scheduled on them
max by (k8s_node_name) (vcenter_vm_disk_latency_avg_milliseconds{k8s_cluster_name="<CLUSTER_NAME>"}) > 20
and on (k8s_node_name)
count by (k8s_node_name) (k8s_pod_cpu_usage{k8s_cluster_name="<CLUSTER_NAME>"})
That last query is the bridge from “the app is slow” to “its node VM is on a host with a struggling datastore”. Part 6 of the series walks the full path from a trace to datastore latency.
11. End-to-end workflow with oc
- Confirm platform and names.
oc get infrastructure cluster -o jsonpath='{.status.platformStatus.type}'. Expected:VSphere. Record the infrastructure name for later. - Install the operators (section 05).
oc get csv -n openshift-opentelemetry-operatorandoc get csv -n openshift-tempo-operator. Expected: one CSV each withPHASESucceeded. Thenoc get crd | grep -E 'opentelemetry.io|tempo.grafana.com'. Expected: at leastopentelemetrycollectors.opentelemetry.io,instrumentations.opentelemetry.io,tempostacks.tempo.grafana.com. - Enable user workload monitoring.
oc -n openshift-user-workload-monitoring get pods. Expected:prometheus-user-workload-*andthanos-ruler-user-workload-*podsRunning. - Create the TempoStack and UI plugin (section 06).
oc -n tracing get tempostack traces -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}'. Expected:True.oc -n tracing get svc tempo-traces-gateway. Expected: ports include8090and8080.oc get uiplugin distributed-tracing. Expected: the object exists, and Observe → Traces appears in the console after a refresh. - Apply RBAC and SCC (section 07).
oc auth can-i get nodes/stats --as=system:serviceaccount:observability:otel-agent. Expected:yes. Tempo write access is authorised by the Tempo gateway against the tenant ClusterRole, so prove it with the telemetrygen test in step 7. - Deploy the gateway, then the agent (section 08).
oc -n observability get otelcol. Expected:agentin modedaemonsetandgatewayin modedeployment, both reporting ready.oc -n observability get ds agent-collector. Expected:DESIRED,CURRENTandREADYequal to your node count.oc -n observability get pod -l app.kubernetes.io/name=agent-collector -o jsonpath='{.items[0].metadata.annotations.openshift\.io/scc}'. Expected:otel-agent-hostlogs. - Send a synthetic trace. Run the job below, then
oc -n observability logs job/telemetrygen. Expected: lines reporting traces generated and no export errors. In the console, Observe → Traces, pick thetracesstack and tenantapplication. Expected: spans from servicetelemetrygenwithin a minute. - Check the gateway exporters.
oc -n observability logs deploy/gateway-collector | grep -iE 'error|refused|unauthorized|403'. Expected: no output. Then in user workload monitoring (Observe → Metrics) queryotelcol_exporter_send_failed_spans(a_totalsuffix may appear depending on version). Expected: flat at zero. - Check external metrics and logs.
curl -sG https://<PROMETHEUS_FQDN>/api/v1/query --data-urlencode 'query=count by (k8s_node_name) (k8s_node_cpu_usage)'. Expected: one result per node.curl -sG https://<LOKI_FQDN>/loki/api/v1/label/k8s_namespace_name/values(add your auth header). Expected: your namespaces listed. - Prove and use the VM join (section 10). Run
Test-OcpNodeVmMap.ps1. Expected: “All N nodes match their VM by name”. Start the external Collector, then run the first query from 10.4. Expected: one series per node, each with avcenter_host_name. - Instrument one real app (section 09) and confirm its spans appear with
k8s.node.nameset, which closes the loop from span to node to VM to host.
# telemetrygen-job.yaml (upstream test image, pin a tag your security team accepts)
apiVersion: batch/v1
kind: Job
metadata:
name: telemetrygen
namespace: observability
spec:
backoffLimit: 2
template:
spec:
restartPolicy: Never
containers:
- name: telemetrygen
image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:<TELEMETRYGEN_TAG>
args:
- traces
- --otlp-endpoint=gateway-collector.observability.svc.cluster.local:4317
- --otlp-insecure
- --duration=30s
- --workers=1
12. Troubleshooting
| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| Agent DaemonSet has 0 pods, events mention SCC | SCC not bound to the agent service account, or the CR security context asks for more than the SCC allows | oc -n observability describe ds agent-collector, look for “unable to validate against any security context constraint” | Check the users entry in the SCC matches system:serviceaccount:observability:otel-agent |
| Agent running only on workers | No toleration for control plane taints | oc get ds agent-collector -n observability desired count versus oc get nodes | Keep tolerations: [{operator: Exists}] in the CR |
| kubeletstats: 403 Forbidden | Missing nodes/stats or nodes/proxy RBAC | oc auth can-i get nodes/stats --as=system:serviceaccount:observability:otel-agent | Apply the otel-agent ClusterRole and binding |
Gateway logs Unauthenticated or 403 to Tempo | Missing tenant write role, wrong tenant header, or wrong service account | Gateway logs; oc get clusterrolebinding tempostack-traces-write -o yaml | Tenant name in X-Scope-OrgID must match tenantName; binding must name otel-gateway in observability |
| Gateway logs x509 errors to Tempo | Not using the service CA | Exporter tls block | Use /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt |
| Traces exported but nothing in Observe → Traces | Reader RBAC missing for your user | Try as cluster-admin | Bind tempostack-traces-read to the right group |
| TempoStack not Ready | Object storage secret or bucket wrong | oc -n tracing logs deploy/tempo-traces-compactor | Fix the secret keys endpoint, bucket, access_key_id, access_key_secret |
| Remote write 404 or 400 | Remote write receiver not enabled on Prometheus, or wrong path for Mimir | Gateway logs | --web.enable-remote-write-receiver on Prometheus, or /api/v1/push for Mimir |
| Pod logs missing in Loki, agent logs show permission denied | SELinux blocked reads | Agent pod securityContext | Keep seLinuxOptions.type: spc_t and the SCC that allows it |
| Pods not instrumented after annotating | Instrumentation created after the pods, or annotation on Deployment metadata instead of pod template | oc get pod <pod> -o yaml | grep -A3 initContainers | Create the Instrumentation first, annotate the pod template, roll out |
vCenter series have no k8s_node_name | Infra ID regex wrong or VM names differ from node names | Run Test-OcpNodeVmMap.ps1 | Fix the regex, or build explicit statements from the CSV |
| Join on UUID returns nothing | BIOS UUID versus instance UUID | Section 10 table | Join on node name |
13. What’s next
This post assumes you know the general agent and gateway pattern for Kubernetes on vSphere; if not, read part 5 of the OTel for vSphere admins series first, and part 2 for the vCenter receiver in depth. Part 6 uses exactly the join built here to follow one slow request down to datastore latency, and part 4 covers the Prometheus, Loki and Tempo backends and Grafana dashboards. If you are weighing this whole stack against what VCF Operations already gives you, see VCF Operations vs OpenTelemetry + Grafana, and if you are running VMware’s own Kubernetes instead of OpenShift, the vSphere Kubernetes Service tutorial. For the broader background on running Kubernetes on VMware, there is also this step-by-step guide.
Written against the Red Hat build of OpenTelemetry 3.11 documentation (upstream Collector 0.158.0), distributed tracing 3.11 (Tempo Operator, Tempo 2.10), Cluster Observability Operator 1.5 documentation and the opentelemetry-collector-contrib repository as of December 2026. Operator channels, CRD versions and component names change between releases; check the release notes for the versions on your cluster before applying these manifests, and test in a non-production cluster first.
Leave a Reply