-
Notifications
You must be signed in to change notification settings - Fork 100
Add Linux host metrics receiver for OTAP Dataflow #2840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lquerel
merged 70 commits into
open-telemetry:main
from
lalitb:lalitb/host-metrics-receiver-complete
May 7, 2026
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
f74ff58
Add host metrics receiver
lalitb 1b89403
Add host metrics family scheduler
lalitb 8f99645
Add host view validation modes
lalitb 6985bbe
Add host metrics receiver telemetry
lalitb 204a41d
Add host architecture resource attribute
lalitb a709c89
Reject host metrics on unsupported platforms
lalitb ad0c973
Add host metrics semantic shape test
lalitb 1b943c1
Handle CPU per-core config option
lalitb cc0d813
Test host metrics duplicate lease
lalitb 502e1a2
Allow partial host metrics scrapes
lalitb 5abf68e
Track host metrics source read errors
lalitb f2a06b8
Derive host metrics process mode default
lalitb fc6f3f2
Use system clock ticks for CPU metrics
lalitb 26e4d9b
Add opt-in CPU utilization metric
lalitb 38e0ee6
Project host updown metrics as sums
lalitb 6d8801c
Add opt-in disk limit metric
lalitb 8e747e4
Add host filesystem metrics
lalitb 494fdaa
Add filesystem filters
lalitb 8aeb3a8
Add memory opt-in metrics
lalitb 3aa1428
Fix host metrics config test initializer
lalitb ddef929
Complete host metrics receiver phase 1
lalitb 6602933
Add host memory hugepage metrics
lalitb 77aa4da
Align host metric attributes with semconv
lalitb e715992
Add host metrics semconv drift check
lalitb 25d09b9
Run host metrics semconv check in CI
lalitb 4d0063d
Fix host metrics semconv conformance gaps
lalitb 2b20d2f
Harden host metrics review findings
lalitb 4c14e78
Fix host metrics review regressions
lalitb 05ee33e
replace nix sysconf with libc in host metrics receiver
lalitb 8657a6a
add direct OTAP Arrow builder for host metrics
lalitb 2b6deae
replace proto encoding path with direct OTAP Arrow construction
lalitb 9bf73f4
remove proto intermediate path and dead push_* helpers
lalitb f199def
fix clippy: allow dead_code on SEMCONV_VERSION constant
lalitb 84a26b6
append flags=0 on every number datapoint
lalitb 2550105
add compile-time assertion that schema URL matches semconv version
lalitb d4931c4
gate procfs and scheduler on linux, keep platform check for non-linux
lalitb 3633343
implement CollectTelemetry handler to emit receiver metrics snapshot
lalitb 2a86b04
propagate OTAP set errors instead of panicking in finish_batch; repla…
lalitb bea7421
cargo fmt
lalitb 993fc3d
Centralize host metrics semconv constants
lalitb 1e2f34e
Fix host metrics review issues
lalitb d403791
Harden host metrics scrape behavior
lalitb dbf01f2
Align host process state with semconv
lalitb 6c12c98
Document host semconv constants ownership
lalitb 4d86475
Harden host metrics validation and start times
lalitb bc47e78
Tighten host metrics OTAP builder API
lalitb 759bda3
Fix paging operation counter starts
lalitb 230cbe6
Reduce host metrics projection rows
lalitb a2f3922
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb c00ef86
Merge host metric shapes in semconv check
lalitb 7480490
Group host metric datapoints by parent
lalitb 055d8dd
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb c9d8b2c
Align host metrics docs with implementation
lalitb 4a734c0
Fix host metrics partial scrape test
lalitb a8a36ec
Fix host metrics netdev test fixture
lalitb 7091f44
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb 1e8e422
Accept Unix host roots on Windows tests
lalitb b9ad3b7
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb dce01e4
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb 131b7d6
Address host metrics review feedback
lalitb 0b4821e
Split remote filesystem filtering
lalitb a8e9862
Fix host metrics dev-tools imports
lalitb 6eff210
Skip more virtual filesystems
lalitb 6626c5f
Stabilize host metrics start time fallback
lalitb 2b1bbba
Add cooperative host metrics scrape yields
lalitb 41efd71
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb 69eb42c
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb 6d0fb5b
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb 27fc046
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lalitb 38df871
Merge branch 'main' into lalitb/host-metrics-receiver-complete
lquerel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
181 changes: 181 additions & 0 deletions
181
rust/otap-dataflow/crates/core-nodes/src/receivers/host_metrics_receiver/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| # Host Metrics Receiver | ||
|
|
||
| <!-- markdownlint-disable MD013 --> | ||
|
|
||
| **URN:** `urn:otel:receiver:host_metrics` | ||
|
|
||
| Linux host metrics receiver backed by procfs and sysfs. It emits OpenTelemetry | ||
| `system.*` metrics for CPU, memory, paging, system uptime, disk, filesystem, | ||
| network, and aggregate process counts. | ||
|
|
||
| ## Configuration | ||
|
|
||
| Minimal configuration: | ||
|
|
||
| ```yaml | ||
| groups: | ||
| host: | ||
| pipelines: | ||
| collect: | ||
| policies: | ||
| resources: | ||
| core_allocation: | ||
| type: core_count | ||
| count: 1 | ||
| nodes: | ||
| host_metrics: | ||
| type: receiver:host_metrics | ||
| config: | ||
| collection_interval: 10s | ||
| publish: | ||
| type: exporter:topic | ||
| config: | ||
| topic: host_metrics | ||
| connections: | ||
| - from: host_metrics | ||
| to: publish | ||
| ``` | ||
|
|
||
| Collect from a host root mounted into a container: | ||
|
|
||
| ```yaml | ||
| groups: | ||
| host: | ||
| pipelines: | ||
| collect: | ||
| policies: | ||
| resources: | ||
| core_allocation: | ||
| type: core_count | ||
| count: 1 | ||
| nodes: | ||
| host_metrics: | ||
| type: receiver:host_metrics | ||
| config: | ||
| collection_interval: 10s | ||
| host_view: | ||
| root_path: /host | ||
| validation: fail_selected | ||
| publish: | ||
| type: exporter:topic | ||
| config: | ||
| topic: host_metrics | ||
| connections: | ||
| - from: host_metrics | ||
| to: publish | ||
| ``` | ||
|
|
||
| Enable selected opt-in metrics: | ||
|
|
||
| ```yaml | ||
| groups: | ||
| host: | ||
| pipelines: | ||
| collect: | ||
| policies: | ||
| resources: | ||
| core_allocation: | ||
| type: core_count | ||
| count: 1 | ||
| nodes: | ||
| host_metrics: | ||
| type: receiver:host_metrics | ||
| config: | ||
| families: | ||
| cpu: | ||
| utilization: true | ||
| memory: | ||
| limit: true | ||
| hugepages: true | ||
| disk: | ||
| limit: true | ||
| filesystem: | ||
| limit: true | ||
| publish: | ||
| type: exporter:topic | ||
| config: | ||
| topic: host_metrics | ||
| connections: | ||
| - from: host_metrics | ||
| to: publish | ||
| ``` | ||
|
|
||
| ## Configuration Options | ||
|
|
||
| | Field | Type | Default | Description | | ||
| | ----- | ---- | ------- | ----------- | | ||
| | `collection_interval` | duration | `10s` | Default scrape interval. | | ||
| | `initial_delay` | duration | `0s` | Delay before the first scrape. | | ||
| | `host_view.root_path` | path | `/` | Host filesystem root to read procfs/sysfs from. | | ||
| | `host_view.validation` | enum | `fail_selected` | One of `fail_selected`, `warn_selected`, or `none`. | | ||
| | `families.<name>.enabled` | bool | `true` | Enables or disables a metric family. | | ||
| | `families.<name>.interval` | duration | unset | Per-family interval; falls back to `collection_interval`. | | ||
| | `families.cpu.utilization` | bool | `false` | Emits derived CPU utilization gauges. | | ||
| | `families.memory.limit` | bool | `false` | Emits `system.memory.limit`. | | ||
| | `families.memory.shared` | bool | `false` | Emits Linux shared memory. | | ||
| | `families.memory.hugepages` | bool | `false` | Emits Linux hugepage metrics. | | ||
| | `families.disk.limit` | bool | `false` | Emits disk capacity from sysfs. | | ||
| | `families.filesystem.limit` | bool | `false` | Emits filesystem capacity. | | ||
| | `families.filesystem.include_virtual_filesystems` | bool | `false` | Includes virtual filesystems such as tmpfs. | | ||
| | `families.filesystem.include_remote_filesystems` | bool | `false` | Includes remote and userspace filesystems such as NFS, CIFS, 9p, and FUSE. | | ||
|
|
||
| Families are `cpu`, `memory`, `paging`, `system`, `disk`, `filesystem`, | ||
| `network`, and `processes`. | ||
|
|
||
| Host-wide collection must run in a one-core source pipeline. Use a topic | ||
| exporter to fan out to multicore downstream processing when needed. | ||
|
|
||
| ## Filters | ||
|
|
||
| Disk, filesystem, and network families support include and exclude filters. | ||
| Filter `match_type` values are `strict`, `glob`, and `regexp`. | ||
|
|
||
| ```yaml | ||
| groups: | ||
| host: | ||
| pipelines: | ||
| collect: | ||
| policies: | ||
| resources: | ||
| core_allocation: | ||
| type: core_count | ||
| count: 1 | ||
| nodes: | ||
| host_metrics: | ||
| type: receiver:host_metrics | ||
| config: | ||
| families: | ||
| disk: | ||
| exclude: | ||
| match_type: glob | ||
| devices: ["loop*", "ram*"] | ||
| network: | ||
| exclude: | ||
| match_type: strict | ||
| interfaces: ["lo"] | ||
| filesystem: | ||
| exclude_fs_types: | ||
| match_type: strict | ||
| fs_types: ["tmpfs", "proc", "sysfs"] | ||
| publish: | ||
| type: exporter:topic | ||
| config: | ||
| topic: host_metrics | ||
| connections: | ||
| - from: host_metrics | ||
| to: publish | ||
| ``` | ||
|
|
||
| ## Current Limits | ||
|
|
||
| - Linux only. | ||
| - Load metrics are not emitted in v1 because Semantic Conventions 1.41.0 does | ||
| not register a system load metric. | ||
| - `families.cpu.per_cpu` is rejected in v1. | ||
| - `families.network.include_connection_count` is rejected in v1. | ||
| - Process metrics are aggregate host summaries, not per-process scrapes. | ||
| - `system.process.count` emits the registered `process.state=running` summary. | ||
| Linux `procs_blocked` is parsed but not emitted because `blocked` is not a | ||
| registered `process.state` value. | ||
| - Filesystem collection can time out individual `statvfs` calls; avoid enabling | ||
| remote filesystems unless the host environment is known to be healthy. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.