1. Sources #
Hosts, Kubernetes, applications.
Receivers #
receivers:
hostmetrics:
collection_interval: 30s
scrapers: { cpu: {}, memory: {}, load: {}, filesystem: {}, network: {} }
kubeletstats:
auth_type: serviceAccount
endpoint: https://${env:K8S_NODE_NAME}:10250
insecure_skip_verify: true
processors:
resourcedetection: { detectors: [env, system] }2. Types and temporality #
What changes storage.
Metric types #
| Type | Example | Note |
|---|---|---|
| Gauge | system.memory.utilization | instantaneous value |
| Sum (counter) | http.server.request.count | cumulative or delta |
| Histogram | http.server.request.duration | stored as a histogram, percentiles computed |
Temporality #
Elasticsearch stores cumulative counters as well as deltas; for rate calculations, prefer a consistent temporality per source. The cumulativetodelta processor converts when needed.
Good to know: OTel metrics are written to TSDS (time series data streams): compact storage, indexed dimensions, and downsampling for long retention.
3. Querying and alerting #
ES|QL, dashboards, rules.
Queries #
FROM metrics-*.otel-*
| WHERE metrics.system.cpu.utilization IS NOT NULL
| STATS cpu = AVG(metrics.system.cpu.utilization) BY host = resource.attributes.host.name, BUCKET(@timestamp, 5 minutes)
| SORT cpu DESCGood practice: Limit attribute cardinality (no user ID or full URL as a dimension): each combination creates a time series.
Depending on the version: exact field names (metrics.*) depend on the exporter version and mapping mode: check them in Discover before building dashboards.