Every sizing question about the OpenTelemetry Collector in a vSphere estate gets the same answer online: “it depends, start with 2 cores and 4 GB”. That is not wrong, but it hides the useful part. For vSphere the collector is almost never the bottleneck on throughput; vCenter’s API, the scrape duration, the log storm you did not plan for, and the backend’s disk are. This post works the arithmetic for 100, 1,000 and 5,000 VMs from the receiver’s own source code, shows every formula so you can plug in your numbers, and then hardens the collector so that when a backend goes away for an hour you lose nothing and know about it.
Level: advanced · Stack: vSphere 8 / VCF 9, otelcol-contrib v0.166+, Prometheus 3.x or Mimir, Loki 3.x · Build time: 1 hour to size, half a day to harden and test
Contents
- Why sizing starts at vCenter
- Counting series from the receiver
- Samples per second and the vCenter side
- ESXi log volume
- Collector CPU and memory
- Prometheus and Loki storage
- Template: sizing worksheet and calculator
- Inside the collector: limiter, batching, queue, retry
- Self-monitoring: what to watch and alert on
- Scaling out and HA
- Template: production-hardened collector
- Template: systemd unit with resource limits
- End-to-end workflow
- Troubleshooting
- What’s next
01. Why sizing starts at vCenter
A collector pulling from vCenter does three kinds of work. It asks vCenter for inventory and properties, it asks for performance counters through QueryPerf, and it ships the result. The third part is cheap: even a 5,000 VM estate produces a few thousand data points per second, a small fraction of one core by any published benchmark. The first two parts are serial calls against an appliance that is also running DRS, HA and every admin’s browser session, and their duration grows linearly with inventory. Logs are the opposite: the steady state is small and the storms are not.
So the right order is: count series, convert to samples and API calls, check the scrape fits inside the interval, size the log tier for a storm, and only then size collector CPU and memory. Then size the backends, which is where the disk actually goes.
All figures in this post are estimates. The series counts come from the receiver’s metadata and source code and are exact for the stated assumptions. The rates, bytes per line, compression ratios and per call latencies are assumptions, labelled as such, with the metric you should use to replace each one with a measurement.
02. Counting series from the receiver
The vCenter receiver (vcenter, alpha) enables most of its metrics by default. A series is one unique combination of metric name, resource attributes and data point attributes. Two implementation details from the source drive the count: performance counters are requested for all instances (*), so per vNIC, per virtual disk, per vmnic and per SCSI device series appear automatically, and every series carries the VM, host, cluster and datacenter as resource attributes.
Working through the default enabled VM metrics in metadata.yaml, with D virtual disks and N vNICs per powered-on VM:
| VM metrics (default on) | Series per VM |
|---|---|
cpu.readiness, cpu.usage, cpu.utilization | 3 |
disk.latency.avg (read, write per virtual disk) | 2D |
disk.latency.max | 1 |
disk.throughput (read, write per virtual disk) | 2D |
disk.usage (used, available), disk.utilization | 3 |
memory.ballooned, .swapped, .swapped_ssd, .usage, .utilization | 5 |
network.packet.drop.rate, .packet.rate, .throughput (tx, rx per vNIC plus aggregate) | 6(N+1) |
network.usage (per vNIC plus aggregate) | N+1 |
| Total | 12 + 4D + 7(N+1), so 34 for D=2, N=1 |
Hosts, with L SCSI devices (boot device, local disks, any LUNs) and P vmnics, come to roughly 8 + 4(L+1) + 9(P+1): 5 CPU series, 2 memory, 1 for max disk latency, read and write latency and throughput per device, and five network metrics per vmnic. The +1 terms assume an aggregate instance; treat the result as an upper bound. With L=4 and P=4 that is 73 per host. Datastores add 3 each (capacity only), clusters about 11 without vSAN, resource pools about 10, datacenters at most around 40. vSAN adds per VM, per host and per cluster series on top; if you run vSAN, enable it in the worksheet and count from documentation.md the same way.
Powered off VMs and templates produce only the property based metrics, so count powered on VMs. Disabled by default metrics you switch on (for example vcenter.vm.cpu.time, per vCPU) add to this, sometimes a lot.
| Tier | Assumed inventory | Series per vCenter | Total series |
|---|---|---|---|
| Small | 100 VMs, 4 hosts, 4 datastores, 1 cluster, 1 vCenter | about 3,800 | about 3,800 |
| Medium | 1,000 VMs, 40 hosts, 20 datastores, 4 clusters, 1 vCenter | about 37,000 | about 37,000 |
| Large | 5,000 VMs, 200 hosts, 80 datastores, 16 clusters, 3 vCenters | about 62,000 | about 186,000 |
Churn: the series you forget
Every VM series carries vcenter.host.name. When DRS moves a VM, all 34 of its series end and 34 new ones begin. Prometheus keeps both in the head block until it is compacted, roughly the last two to three hours. Extra head series from churn are about moves per hour x series per VM x head hours. At 5,000 VMs with 2 percent moving per hour that is 100 x 34 x 3, around 10,000 extra series, a 5 percent overhead. In a cluster with an aggressive DRS setting or a maintenance window evacuating hosts, it can briefly be much more. If you do not need host placement on VM metrics, dropping the attribute removes the churn, but you lose the “which host was this VM on” join that post 07 and post 06 rely on. I keep it and size for it.
03. Samples per second and the vCenter side
Samples per second is simply series divided by the collection interval. At 60 seconds the three tiers produce about 63, 620 and 3,100 samples per second; at the receiver’s default of 2 minutes, half that. Those numbers are small for any collector and any modern TSDB.
The more important number is how many API calls one scrape costs. The receiver batches QueryPerf by max_query_metrics (default 256, and it should not exceed vCenter’s config.vpxd.stats.maxQueryMetrics) divided by the number of counters per object: 22 counter names for VMs and 18 for hosts in the current source. That is 11 VMs or 14 hosts per call, and the calls run one after another.
| Medium, 1 vCenter | Large, 1 vCenter with all 5,000 VMs | Large, 3 vCenters | |
|---|---|---|---|
| QueryPerf calls per scrape | 91 + 3 = 94 | 455 + 15 = 470 | about 157 per vCenter, in parallel |
| At an assumed 0.25 s per call | about 24 s | about 118 s | about 40 s |
| Fits a 60 s interval? | Yes | No | Yes |
The 0.25 seconds per call is an assumption; it depends on vCenter’s load, its database and the network. Measure it. If a scrape runs longer than collection_interval, the next scrape simply starts late, so the symptom is fewer points than expected rather than an error. This query shows it directly, because datastore utilization is stamped once per completed scrape:
# Expected 30 at a 60 s interval; fewer means scrapes take longer than the interval
min by (vcenter_server) (count_over_time(vcenter_datastore_disk_utilization_percent[30m]))
This is the real reason to run one collector per vCenter: three vCenters scraped by three collectors finish in a third of the wall clock time, and a slow vCenter cannot delay the others. The receiver has no inventory filter; it collects everything its account can see. If a single vCenter is too large for one scrape cycle, you can split it with two service accounts whose read only permissions cover disjoint datacenters or clusters, each used by its own receiver. Test that in your environment first, and prefer a longer interval if the data is only used for 5 minute dashboards.
04. ESXi log volume
ESXi syslog volume varies more between estates than anything else in this post. Log level, vSAN, NSX, backup software hammering hostd, and third party VIBs all change it by an order of magnitude. I will not quote a “typical” rate. Instead:
log_lines_per_s = hosts x lines_per_host_per_s
raw_bytes_per_day = log_lines_per_s x avg_line_bytes x 86400
| Lines per host per second (assumption) | Medium, 40 hosts | Large, 200 hosts | Raw per day, large, 300 B per line |
|---|---|---|---|
| 2 (quiet) | 80 lines/s | 400 lines/s | about 10 GB |
| 5 | 200 lines/s | 1,000 lines/s | about 26 GB |
| 20 (busy or verbose) | 800 lines/s | 4,000 lines/s | about 104 GB |
Measure your real rate after a day on a few hosts with sum(rate(otelcol_receiver_accepted_log_records{receiver="syslog/esxi"}[1h])) divided by the number of hosts sending, and size the log tier for a storm, not the average. An NFS all paths down event, a storage controller failover or a vCenter outage makes every host log at once, and those are exactly the minutes you want complete. A factor of 10 over the measured average is a reasonable planning margin for the receiving tier; the storage tier can be sized on the average.
Transport matters as much as rate. ESXi 8 can send RFC 5424 over TCP with octet counting framing (tcp://host:port?formatter=RFC_5424&framing=octet_counting in Syslog.global.logHost; the default formatter is RFC 3164). Over TCP, a collector that cannot keep up slows the sender. Over UDP, it silently drops. Part 3 covers parsing; for sizing, use TCP.
05. Collector CPU and memory
The only widely published throughput figures I know of come from Splunk’s documentation for its Collector distribution: with a single CPU core the Collector can ingest about 15,000 spans, 20,000 metric data points or 10,000 log records per second, with a recommended ratio of 1 CPU to 2 GB of memory. Those were measured on Splunk’s configuration, not yours, but they are a reasonable anchor. Against them, the throughput needs here are tiny: 0.05 cores for the medium tier, about 0.3 for the large tier with logs at 1,000 lines per second.
What actually uses CPU and memory on a vCenter collector is the scrape: parsing the SOAP responses for every VM’s properties and every perf result, building the data points, and holding the whole scrape in memory until it is handed to the exporter. That cost scales with inventory per collector, arrives in a burst once per interval, and is not covered by any published benchmark. Measure it with the collector’s own metrics, as below, and size memory at about twice the observed peak heap.
| Collector | Starting point (estimate) | Then tune with |
|---|---|---|
| Small, single collector | 2 vCPU, 2 GiB | max_over_time(otelcol_process_runtime_heap_alloc_bytes[1d]) |
| Metrics collector, per vCenter up to about 2,000 VMs | 2 vCPU, 4 GiB | Peak heap during scrape, scrape completeness query above |
| Metrics collector, per vCenter above 2,000 VMs | 4 vCPU, 8 GiB | Same, plus vCenter CPU while the scrape runs |
| Log gateway node | 2 vCPU, 2 to 4 GiB, N+1 nodes | Storm rate divided by about 10,000 lines/s per core, plus parsing cost from Part 3 |
| Persistent queue disk | Outage hours x ingest bytes per second, see section 06 | du -sh on the queue directory during a test outage |
06. Prometheus and Loki storage
Prometheus documents its own capacity formula: needed_disk_space = retention_time_seconds x ingested_samples_per_second x bytes_per_sample, with 1 to 2 bytes per sample after compression. Using 2 bytes and 30 days at a 60 second interval: about 0.3 GB for the small tier, 3.2 GB for medium and 16 GB for large, plus the WAL and head chunks, which the docs note peak roughly every two hours. Double it for headroom and you are still talking about a small volume. vSphere metrics are not where your TSDB disk goes.
Memory is driven by active series in the head block. A widely quoted rule of thumb from Robust Perception for Prometheus 2.x is about 3 kB per head series; that gives roughly 11 MB, 112 MB and 560 MB of head for the three tiers before churn, queries and Prometheus’ own baseline. In practice the baseline and query load dominate at small scale. Above a few hundred thousand series, or once you need multiple tenants and long retention, move to Mimir, which accepts the same OTLP.
Loki stores compressed chunks plus an index. The formula is stored = raw_bytes_per_day x retention_days / compression_ratio. The compression ratio depends on how repetitive your lines are; I use 8 as a placeholder, which you should replace after a week by comparing loki_distributor_bytes_received_total with the object store’s bucket growth. At 8x, the medium tier at 5 lines per host per second stores about 19 GB for 30 days and the large tier about 97 GB.
07. Template: sizing worksheet and calculator
The worksheet below is the whole method on one page. Fill in the left column from your inventory and measurements; the formulas are what the calculator script implements.
| Input or output | Formula | Small | Medium | Large |
|---|---|---|---|---|
| Powered-on VMs (V) | input | 100 | 1,000 | 5,000 |
| Hosts (H) | input | 4 | 40 | 200 |
| vCenters | input | 1 | 1 | 3 |
| Series per VM | 12 + 4D + 7(N+1) | 34 | 34 | 34 |
| Series per host | 8 + 4(L+1) + 9(P+1) | 73 | 73 | 73 |
| Active series | V x per VM + H x per host + small objects | 3,800 | 37,000 | 186,000 |
| Samples per second at 60 s | series / interval | 63 | 620 | 3,100 |
| QueryPerf calls per scrape, per vCenter | ceil(V/11) + ceil(H/14) | 11 | 94 | about 157 |
| ESXi log lines per second at 5 per host (assumed) | H x rate | 20 | 200 | 1,000 |
| Collector cores for throughput | sps / 20,000 + lines / 10,000 | under 0.01 | 0.05 | 0.25 |
| Prometheus disk, 30 days at 2 B/sample | sps x 86,400 x 30 x 2 | 0.3 GB | 3.2 GB | 16 GB |
| Prometheus head memory at 3 kB/series | series x 3 kB | 11 MB | 112 MB | 560 MB |
| Loki stored, 30 days at 300 B/line, 8x (assumed) | lines x 300 x 86,400 x 30 / 8 | 1.9 GB | 19 GB | 97 GB |
| Persistent queue for a 2 h outage, logs | lines x 300 x 7,200 | 0.04 GB | 0.43 GB | 2.2 GB |
And the calculator, so you can rerun it for every cluster instead of trusting my assumptions. Override any input with an environment variable.
#!/usr/bin/env bash
# otel-vsphere-sizing.sh - back-of-envelope sizing for an OTel vSphere pipeline.
# Every output is an ESTIMATE. Replace the inputs with numbers measured in your estate.
set -euo pipefail
# ---- inventory (per vCenter) ----
VMS=${VMS:-1000} # powered-on VMs
VDISKS_PER_VM=${VDISKS_PER_VM:-2}
VNICS_PER_VM=${VNICS_PER_VM:-1}
HOSTS=${HOSTS:-40}
DEVICES_PER_HOST=${DEVICES_PER_HOST:-4} # SCSI devices: boot disk, local, LUNs
VMNICS_PER_HOST=${VMNICS_PER_HOST:-4}
DATASTORES=${DATASTORES:-20}
CLUSTERS=${CLUSTERS:-4}
RPOOLS=${RPOOLS:-12}
DATACENTERS=${DATACENTERS:-1}
# ---- collection ----
INTERVAL_S=${INTERVAL_S:-60} # vcenter receiver collection_interval
MAX_QUERY_METRICS=${MAX_QUERY_METRICS:-256}
T_QUERYPERF_S=${T_QUERYPERF_S:-0.25} # ASSUMPTION: seconds per QueryPerf call; measure it
# ---- logs ----
LOG_LINES_PER_HOST_S=${LOG_LINES_PER_HOST_S:-5} # ASSUMPTION: measure with otelcol_receiver_accepted_log_records
LOG_BYTES=${LOG_BYTES:-300} # ASSUMPTION: average ESXi line size
LOKI_COMPRESSION=${LOKI_COMPRESSION:-8} # ASSUMPTION: measure on your Loki
# ---- storage ----
RETENTION_DAYS=${RETENTION_DAYS:-30}
BYTES_PER_SAMPLE=${BYTES_PER_SAMPLE:-2} # Prometheus docs: 1-2 bytes per sample
HEAD_BYTES_PER_SERIES=${HEAD_BYTES_PER_SERIES:-3000} # rule of thumb, ~3 kB per head series
QUEUE_BYTES_PER_DP=${QUEUE_BYTES_PER_DP:-150} # ASSUMPTION: serialized bytes per data point on disk
OUTAGE_HOURS=${OUTAGE_HOURS:-2} # backend outage the persistent queue must absorb
awk -v vms="$VMS" -v d="$VDISKS_PER_VM" -v n="$VNICS_PER_VM" -v h="$HOSTS" -v l="$DEVICES_PER_HOST" \
-v p="$VMNICS_PER_HOST" -v ds="$DATASTORES" -v cl="$CLUSTERS" -v rp="$RPOOLS" -v dc="$DATACENTERS" \
-v iv="$INTERVAL_S" -v mqm="$MAX_QUERY_METRICS" -v tq="$T_QUERYPERF_S" -v lr="$LOG_LINES_PER_HOST_S" \
-v lb="$LOG_BYTES" -v lc="$LOKI_COMPRESSION" -v rd="$RETENTION_DAYS" -v bps="$BYTES_PER_SAMPLE" \
-v hb="$HEAD_BYTES_PER_SERIES" -v qb="$QUEUE_BYTES_PER_DP" -v oh="$OUTAGE_HOURS" 'BEGIN {
per_vm = 12 + 4*d + 7*(n+1)
per_host = 8 + 4*(l+1) + 9*(p+1)
series = vms*per_vm + h*per_host + ds*3 + cl*11 + rp*10 + dc*41
sps = series/iv
calls = int((vms + int(mqm/22) - 1)/int(mqm/22)) + int((h + int(mqm/18) - 1)/int(mqm/18))
logs = h*lr
printf "series per VM / host : %d / %d\n", per_vm, per_host
printf "active series (receiver) : %d\n", series
printf "samples per second : %.0f\n", sps
printf "QueryPerf calls per scrape : %d (~%.0f s at %.2f s each, interval %d s)\n", calls, calls*tq, tq, iv
printf "ESXi log lines per second : %.0f\n", logs
printf "collector CPU, throughput only : %.2f cores (20k dp/s and 10k logs/s per core)\n", sps/20000 + logs/10000
printf "Prometheus disk, %d days : %.1f GB\n", rd, sps*86400*rd*bps/1e9
printf "Prometheus head memory : %.0f MB (before churn and query overhead)\n", series*hb/1e6
printf "Loki raw ingest per day : %.1f GB\n", logs*lb*86400/1e9
printf "Loki stored, %d days : %.1f GB at %dx compression\n", rd, logs*lb*86400*rd/lc/1e9, lc
printf "persistent queue for %dh outage : metrics %.2f GB, logs %.2f GB\n", oh, sps*3600*oh*qb/1e9, logs*3600*oh*lb/1e9
}'
$ VMS=5000 HOSTS=200 DATASTORES=80 CLUSTERS=16 RPOOLS=50 DATACENTERS=3 ./otel-vsphere-sizing.sh
series per VM / host : 34 / 73
active series (receiver) : 185639
samples per second : 3094
QueryPerf calls per scrape : 470 (~118 s at 0.25 s each, interval 60 s)
...
08. Inside the collector: limiter, batching, queue, retry
memory_limiter
The memory_limiter processor checks heap usage every check_interval and refuses data once usage passes the soft limit (limit_mib - spike_limit_mib), forcing garbage collection above the hard limit. Put it first in every pipeline. The upstream README recommends setting GOMEMLIMIT to 80 percent of the hard limit and spike_limit_mib to about 20 percent of limit_mib, and notes the process uses roughly 50 MiB more than limit_mib. What a refusal means depends on the receiver: the vCenter scraper loses that cycle’s points, a TCP syslog receiver with retry_on_failure enabled retries and slows the ESXi sender, and UDP has nowhere to push back. All of it shows up in otelcol_receiver_refused_*.
Batching: the batch processor is deprecated
If your configs still have processors: [batch], plan to remove it. The Collector SIG announced the deprecation of the batch processor in November 2026: exporter level batching inside sending_queue replaces it, with a queue_batch processor for the rare case where you need batching before another processor. Per the SIG’s migration post, exporter level batching becomes the default in v0.171.0 (planned for February 2027) and the processor is removed in v0.177.0 (planned for May 2027). The practical difference: batching now happens after the queue, so the queue holds small unbatched requests and a queue_size measured in requests holds less data than before. Size the queue in items or bytes instead.
sending_queue, retry and the persistent queue
Every exporter built on exporterhelper has a sending_queue (on by default, 1,000 requests, 10 consumers) and retry_on_failure (on by default: 5 s initial interval, 30 s maximum, giving up after 300 s). With the default in memory queue a backend outage longer than the retry window loses data, and a restart loses whatever was queued. Setting sending_queue.storage to a file_storage extension makes the queue persistent: requests are written to a bbolt database on disk and survive restarts. There is then no in memory queue; queue_size bounds the disk. Two constraints worth knowing: wait_for_result is not supported with a persistent queue, and context from auth extensions is not carried through it.
Size it as outage hours x ingest bytes per second, measured in the same unit as the sizer. With sizer: bytes the queue size is literally your disk budget for that exporter, which is the easiest number to reason about. Then make sure the backend will accept what you replay: Prometheus rejects samples older than its out of order window, so set storage.tsdb.out_of_order_time_window to at least the outage you expect to absorb. Prometheus’ OTLP guide suggests 30 minutes as a starting point; I use 2 hours with a 2 hour persistent queue.
09. Self-monitoring: what to watch and alert on
The Collector exposes its own metrics through service::telemetry::metrics. As of v0.123.0 the old metrics::address setting is ignored; the current form is a readers list with a pull Prometheus exporter (or a periodic OTLP exporter). The default level is normal. Since v0.152.0 the Prometheus reader defaults to without_type_suffix and without_units, so counters keep their raw names, for example otelcol_exporter_send_failed_metric_points rather than ..._total. If you run an older collector, add _total to the counter names in the rules below.
| Metric | What it tells you |
|---|---|
otelcol_receiver_accepted_metric_points, _log_records, _spans | Ingest rate per receiver. Your measured replacement for the worksheet’s assumptions. |
otelcol_receiver_refused_* | Data refused downstream, typically by the memory limiter. |
otelcol_scraper_scraped_metric_points, otelcol_scraper_errored_metric_points | Per scraper success and failure. |
otelcol_exporter_queue_size, otelcol_exporter_queue_capacity | Queue fill. The ratio is your early warning for a slow or absent backend. |
otelcol_exporter_enqueue_failed_* | Data dropped because the queue was full. This is real loss. |
otelcol_exporter_send_failed_* | Failed send attempts. Not necessarily loss, because of retries, but sustained means trouble. |
otelcol_exporter_sent_* | Egress. Compare with accepted over the same window, remembering batching delays. |
otelcol_process_memory_rss, otelcol_process_runtime_heap_alloc_bytes, otelcol_process_cpu_seconds | Process health; the heap figure is what memory_limiter compares against its limits. |
Scrape these with Prometheus directly from port 8888, not through the collector’s own pipeline. The upstream docs make the point well: observe the collector through a path that still works when the monitored pipeline fails.
# prometheus.yml: scrape job for collector self-monitoring
scrape_configs:
- job_name: otelcol
scrape_interval: 15s
static_configs:
- targets:
- otelcol-vc01.lab.local:8888
- otelcol-logs01.lab.local:8888
- otelcol-logs02.lab.local:8888
rule_files:
- /etc/prometheus/rules/otelcol-alerts.yml
# /etc/prometheus/rules/otelcol-alerts.yml
# Counter names assume otelcol-contrib >= v0.152.0 defaults (no _total suffix).
groups:
- name: otelcol-self-monitoring
rules:
- alert: OtelcolDown
expr: up{job="otelcol"} == 0
for: 3m
labels: { severity: critical }
annotations:
summary: "Collector {{ $labels.instance }} is not answering on :8888"
- alert: OtelcolExporterQueueFilling
expr: |
max by (instance, exporter) (otelcol_exporter_queue_size{job="otelcol"})
/ max by (instance, exporter) (otelcol_exporter_queue_capacity{job="otelcol"}) > 0.7
for: 10m
labels: { severity: warning }
annotations:
summary: "{{ $labels.exporter }} on {{ $labels.instance }} queue is {{ $value | humanizePercentage }} full"
description: "Backend slow or down. With a persistent queue this is disk filling; check the backend first."
- alert: OtelcolDroppingOnEnqueue
expr: |
sum by (instance, exporter) (
rate({__name__=~"otelcol_exporter_enqueue_failed_(metric_points|log_records|spans)", job="otelcol"}[5m])
) > 0
for: 2m
labels: { severity: critical }
annotations:
summary: "{{ $labels.exporter }} on {{ $labels.instance }} is dropping data: queue full"
- alert: OtelcolSendFailing
expr: |
sum by (instance, exporter) (
rate({__name__=~"otelcol_exporter_send_failed_(metric_points|log_records|spans)", job="otelcol"}[5m])
) > 0
for: 15m
labels: { severity: warning }
annotations:
summary: "{{ $labels.exporter }} on {{ $labels.instance }} has failed sends for 15 minutes"
- alert: OtelcolReceiverRefusing
expr: |
sum by (instance, receiver) (
rate({__name__=~"otelcol_receiver_refused_(metric_points|log_records|spans)", job="otelcol"}[5m])
) > 0
for: 5m
labels: { severity: warning }
annotations:
summary: "{{ $labels.receiver }} on {{ $labels.instance }} is refusing data, usually memory_limiter"
- alert: OtelcolHeapNearLimit
# 0.8 x limit_mib of 3200 MiB = 2684354560 bytes. Keep in sync with the config.
expr: otelcol_process_runtime_heap_alloc_bytes{job="otelcol"} > 2684354560
for: 10m
labels: { severity: warning }
annotations:
summary: "Collector {{ $labels.instance }} heap close to memory_limiter soft limit"
- alert: OtelcolScraperErrors
expr: sum by (instance, receiver) (rate(otelcol_scraper_errored_metric_points{job="otelcol"}[10m])) > 0
for: 15m
labels: { severity: warning }
annotations:
summary: "{{ $labels.receiver }} on {{ $labels.instance }} has scrape errors, check vCenter credentials and reachability"
- alert: EsxiSyslogIngestStopped
expr: sum by (instance) (rate(otelcol_receiver_accepted_log_records{job="otelcol", receiver="syslog/esxi"}[10m])) == 0
for: 10m
labels: { severity: critical }
annotations:
summary: "No ESXi syslog accepted by {{ $labels.instance }} for 10 minutes"
- alert: VcenterScrapeIncomplete
# Data-path check: expects 30 points per 30 min at a 60 s interval
expr: min by (vcenter_server) (count_over_time(vcenter_datastore_disk_utilization_percent[30m])) < 25
for: 30m
labels: { severity: warning }
annotations:
summary: "vCenter {{ $labels.vcenter_server }} scrapes are taking longer than the collection interval"
- alert: OtelcolQueueDiskLow
# Needs node_exporter on the collector VM
expr: node_filesystem_avail_bytes{mountpoint="/var/lib/otelcol-contrib"} / node_filesystem_size_bytes{mountpoint="/var/lib/otelcol-contrib"} < 0.15
for: 10m
labels: { severity: warning }
annotations:
summary: "Persistent queue filesystem on {{ $labels.instance }} below 15 percent free"
10. Scaling out and HA
The three kinds of traffic scale differently, which is why the large topology in Figure 1 has three different shapes.
- vCenter metrics: one collector per vCenter, active/passive. A scraper cannot be load balanced: two collectors scraping the same vCenter double the API load and write interleaved duplicates. Run one, give it a persistent queue on its own disk, and let vSphere HA restart the VM if its host fails. A gap of a few minutes during a restart is acceptable for 60 second metrics; for strict needs, run a cold standby with the service disabled and an alert on
up. - ESXi logs: active/active behind an L4 load balancer. Syslog over TCP is stateless per connection, so any number of identical log collectors can sit behind a VIP, each with its own persistent queue. ESXi can send to several loghosts, but that duplicates every line; point it at one VIP instead. Keep N+1 nodes so the storm sizing still holds with one node down for patching.
- Traces: two tiers with the load_balancing exporter. If you also collect application traces (Part 5 and Part 6), tail sampling needs all spans of a trace on the same collector. A first tier of agents or gateways uses the
load_balancingexporter (renamed fromloadbalancing, which remains a deprecated alias) withrouting_key: traceIDand a DNS or Kubernetes resolver to fan out to a second, sampling tier. Each backend gets its own OTLP sub exporter with its own queue; the README is explicit that the persistent queue is not supported at that sub exporter level.
# Tier 1 gateway: route spans by trace ID to the sampling tier
exporters:
load_balancing:
routing_key: traceID
protocol:
otlp:
timeout: 5s
tls:
ca_file: /etc/otelcol-contrib/certs/ca.pem
sending_queue:
queue_size: 5000
retry_on_failure:
max_elapsed_time: 120s
resolver:
dns:
hostname: otel-sampling.lab.local # A records for every sampling-tier collector
port: "4317"
interval: 30s
Two HA details that catch people. First, keep self-monitoring separate: the Prometheus that scrapes port 8888 should not be the same single instance that the collectors are writing to, or a dead backend silences its own alert. Second, give each collector a unique identity in its own telemetry (service::telemetry::resource), otherwise dashboards of the collector fleet merge instances.
11. Template: production-hardened collector
A single collector for one vCenter plus ESXi syslog, suitable for the small tier as is and for the medium tier as two copies (metrics only and logs only) by deleting the pipeline you do not need. Validated with otelcol-contrib validate on v0.166.0. Component names follow the snake_case renames: otlp_http (was otlphttp), otlp_grpc (was otlp as an exporter; the receiver is still otlp).
# /etc/otelcol-contrib/config.yaml - otelcol-contrib >= v0.166.0
extensions:
health_check:
endpoint: 0.0.0.0:13133
file_storage/queue:
directory: /var/lib/otelcol-contrib/queue
create_directory: true
timeout: 2s
compaction:
on_start: true
on_rebound: true
directory: /var/lib/otelcol-contrib/queue-compaction
receivers:
vcenter/vc01:
endpoint: https://<VCENTER_FQDN>
username: ${env:VCENTER_USER}
password: ${env:VCENTER_PASSWORD}
collection_interval: 60s
initial_delay: 15s
max_query_metrics: 256
tls:
ca_file: /etc/otelcol-contrib/certs/vcenter-ca.pem
syslog/esxi:
protocol: rfc5424
enable_octet_counting: true
tcp:
listen_address: 0.0.0.0:1514
max_log_size: 1MiB
retry_on_failure: # retry instead of dropping when memory_limiter refuses: TCP backpressure
enabled: true
initial_interval: 1s
max_interval: 30s
max_elapsed_time: 10m
processors:
memory_limiter:
check_interval: 1s
limit_mib: 3200 # hard limit; systemd MemoryMax is 4G
spike_limit_mib: 640 # soft limit = 2560 MiB
resource/vc01:
attributes:
- key: vcenter.server
value: <VCENTER_FQDN>
action: upsert
resource/esxi-logs:
attributes:
- key: service.name
value: esxi
action: upsert
exporters:
otlp_http/prometheus:
endpoint: http://<PROMETHEUS_HOST>:9090/api/v1/otlp
timeout: 30s
sending_queue:
storage: file_storage/queue
sizer: bytes
queue_size: 2000000000 # 2 GB on disk for metrics
num_consumers: 4
batch:
sizer: items
flush_timeout: 5s
min_size: 5000
max_size: 20000
retry_on_failure:
enabled: true
initial_interval: 5s
max_interval: 60s
max_elapsed_time: 2h # match the out-of-order window on Prometheus
otlp_http/loki:
endpoint: http://<LOKI_HOST>:3100/otlp
timeout: 30s
sending_queue:
storage: file_storage/queue
sizer: bytes
queue_size: 5000000000 # 5 GB on disk for logs
num_consumers: 8
batch:
sizer: items
flush_timeout: 2s
min_size: 2000
max_size: 10000
retry_on_failure:
enabled: true
initial_interval: 5s
max_interval: 60s
max_elapsed_time: 2h
service:
extensions: [health_check, file_storage/queue]
telemetry:
resource:
service.name: otelcol-vc01
logs:
level: info
metrics:
level: normal
readers:
- pull:
exporter:
prometheus:
host: 0.0.0.0
port: 8888
pipelines:
metrics/vcenter:
receivers: [vcenter/vc01]
processors: [memory_limiter, resource/vc01]
exporters: [otlp_http/prometheus]
logs/esxi:
receivers: [syslog/esxi]
processors: [memory_limiter, resource/esxi-logs]
exporters: [otlp_http/loki]
Point ESXi at it with TCP, RFC 5424 and octet counting, the combination that gives you backpressure and multi line safety:
esxcli system syslog config set --loghost='tcp://<COLLECTOR_VIP>:1514?formatter=RFC_5424&framing=octet_counting'
esxcli network firewall ruleset set --ruleset-id=syslog --enabled=true
esxcli system syslog reload
esxcli system syslog config get
Prometheus needs the matching window for replayed data:
# prometheus.yml (Prometheus 3.x, started with --web.enable-otlp-receiver)
otlp:
promote_resource_attributes:
- vcenter.server
- vcenter.datacenter.name
- vcenter.cluster.name
- vcenter.host.name
- vcenter.vm.name
- vcenter.vm.id
- vcenter.datastore.name
storage:
tsdb:
out_of_order_time_window: 2h
12. Template: systemd unit with resource limits
The official otelcol-contrib packages install a unit that runs /usr/bin/otelcol-contrib $OTELCOL_OPTIONS as the otelcol-contrib user, reading /etc/otelcol-contrib/otelcol-contrib.conf as its environment file. Do not edit the packaged unit; add a drop-in. The limits are deliberately layered: GOMEMLIMIT makes the Go runtime collect harder first, memory_limiter refuses data next, MemoryHigh throttles, and MemoryMax is the last resort OOM kill.
# /etc/systemd/system/otelcol-contrib.service.d/10-limits.conf
[Service]
# Go runtime soft limit: 80% of memory_limiter limit_mib (3200 MiB)
Environment=GOMEMLIMIT=2560MiB
# cgroup limits: throttle at 3.5G, kill at 4G
MemoryHigh=3584M
MemoryMax=4G
MemorySwapMax=0
# 2 vCPU worth of CPU time
CPUQuota=200%
TasksMax=1024
LimitNOFILE=65536
# Creates /var/lib/otelcol-contrib owned by the service user, for the persistent queue
StateDirectory=otelcol-contrib
StateDirectoryMode=0750
Restart=always
RestartSec=5s
# Give exporters time to flush the in-flight batch on stop
TimeoutStopSec=60s
ProtectSystem=strict
ReadWritePaths=/var/lib/otelcol-contrib
PrivateTmp=true
# /etc/otelcol-contrib/otelcol-contrib.conf (chmod 640, root:otelcol-contrib)
OTELCOL_OPTIONS="--config=/etc/otelcol-contrib/config.yaml"
VCENTER_USER=<SVC_ACCOUNT>@vsphere.local
VCENTER_PASSWORD=<SET_FROM_YOUR_SECRET_STORE>
ProtectSystem=strict makes the whole filesystem read only for the service except ReadWritePaths, which is why the queue lives under /var/lib/otelcol-contrib. If you add a file_log receiver or write anywhere else, add that path too.
13. End-to-end workflow
- Run the calculator per vCenter with your inventory. Check: the QueryPerf line shows an estimated scrape time comfortably below your interval; if not, plan a longer interval or a split before deploying.
- Build the collector VM with the starting size from section 05 and a separate virtual disk mounted at
/var/lib/otelcol-contrib, sized from the worksheet’s queue line plus 50 percent. Check:df -h /var/lib/otelcol-contribshows the expected size. - Install otelcol-contrib v0.166.0 or later from the release packages. Check:
otelcol-contrib --versionandotelcol-contrib components | grep -E 'name: (vcenter|syslog|file_storage|otlp_http)$'shows all four. - Install the config, environment file and drop-in from sections 11 and 12. Check:
sudo -u otelcol-contrib otelcol-contrib validate --config=/etc/otelcol-contrib/config.yamlexits 0 (export the two variables first), andsystemctl daemon-reload && systemctl cat otelcol-contribshows the drop-in. - Start it.
sudo systemctl restart otelcol-contrib. Check:systemctl show otelcol-contrib -p MemoryMax -p CPUQuotaPerSecUSecprintsMemoryMax=4294967296andCPUQuotaPerSecUSec=2s;curl -s localhost:13133reports the server available. - Confirm self-monitoring. Check:
curl -s localhost:8888/metrics | grep -E '^otelcol_exporter_queue_capacity'prints one line per exporter with the configured capacity. - Point a test host’s syslog at it with the esxcli commands in section 11. Check: within a minute
curl -s localhost:8888/metrics | grep 'otelcol_receiver_accepted_log_records{.*syslog/esxi'is non zero and increasing. - Confirm vCenter data and scrape completeness. Check: after 30 minutes the scrape completeness query in section 03 returns 29 or 30.
- Load the alert rules into Prometheus. Check:
promtool check rules /etc/prometheus/rules/otelcol-alerts.ymlreports success, and the rules appear on Prometheus’ Alerts page as inactive. - Test an outage. Stop Prometheus and Loki for 15 minutes. Check:
otelcol_exporter_queue_sizegrows,OtelcolExporterQueueFillinggoes pending,du -sh /var/lib/otelcol-contrib/queuegrows, andotelcol_exporter_enqueue_failed_*stays at zero. Start the backends again: the queue drains to zero and the 15 minute gap fills in on your dashboards. - Replace assumptions with measurements after a week: real log rate per host, peak heap during scrape, bytes on disk per hour of outage. Rerun the calculator with them and resize.
14. Troubleshooting
| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| Gaps in vCenter metrics, no errors | Scrape takes longer than collection_interval | Scrape completeness query, section 03 | Longer interval, one collector per vCenter, or split by permissions |
Fault mentioning maxQueryMetrics | max_query_metrics above vCenter’s config.vpxd.stats.maxQueryMetrics | vCenter advanced settings | Lower max_query_metrics to match (Broadcom KB 301449) |
otelcol_receiver_refused_* rising | Heap over the memory_limiter soft limit, usually a backend outage with an in memory queue, or a log storm | Heap metric and queue size | Persistent queue, more memory, or more log gateway nodes |
| OOM kills in the journal | MemoryMax below limit_mib plus overhead, or no GOMEMLIMIT | journalctl -k | grep -i oom | Keep the layering in section 12: GOMEMLIMIT < limit_mib < MemoryHigh < MemoryMax |
enqueue_failed during an outage | Persistent queue reached queue_size or the disk is full | du -sh on the queue directory; disk alert | Larger queue disk, or accept the loss window explicitly |
| Collector will not start, file lock timeout | Two collectors or two exporters sharing one queue directory incorrectly, or a stale lock after a crash | Collector log at start | One directory per collector; check permissions under /var/lib/otelcol-contrib |
| Replayed data rejected after an outage | Samples older than Prometheus’ out of order window | prometheus_tsdb_out_of_order_samples_total and Prometheus logs | Raise out_of_order_time_window to match max_elapsed_time |
| ESXi logs missing during storms | UDP transport, or retry_on_failure disabled on the syslog receiver | esxcli system syslog config get | TCP with octet counting; enable receiver retry |
| Startup warning about batch processor and exporter batching | Both enabled in one pipeline | Collector log at start | Remove the batch processor; keep sending_queue.batch |
| Counter alerts never fire on an older collector | Counters have a _total suffix before v0.152.0 | curl localhost:8888/metrics | grep enqueue_failed | Adjust the rule names, or upgrade |
15. What’s next
With the numbers worked out and the collector hardened, the remaining job is to stop hand writing these configs for every vCenter. Generating OTel Collector configs with PowerCLI turns your inventory into one validated config per vCenter, including the calculator inputs. The receiver itself is covered in Part 2, the syslog pipeline and its parsing cost in Part 3, and the Prometheus, Loki and Tempo side in Part 4. If you are deciding whether this whole stack is worth running next to what you already have, read VCF Operations vs OpenTelemetry and Grafana. For the storage specific metrics that add to this sizing, see Measuring NFS datastore latency with OpenTelemetry, and for the design choices behind a vCenter metrics pipeline in general, Wiring Grafana into vCenter.
Series counts derived from the vcenter receiver’s metadata.yaml and source in otelcol-contrib v0.166.0. Collector component names, internal telemetry and queue settings checked against the upstream Collector documentation as of December 2026, including the batch processor deprecation. Throughput anchors are Splunk’s published guidance for its distribution; storage formulas are Prometheus’ documented formula and a Robust Perception rule of thumb. Everything else is labelled as an assumption: measure before you buy hardware.
Leave a Reply