Add OpenTelemetry-native host and process monitoring - #14051
mike-realuptime wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Several YAML files have an incomplete Apache 2.0 license header (missing the leading “Licensed to the Apache Software Foundation (ASF)…” line).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds OpenTelemetry-native host and process monitoring support (Linux + Windows) by extending existing MAL rules to accept either exporter-based metrics or OTel hostmetrics, and introduces a new E2E case that validates the OTel hostmetrics + pre-aggregated process pipeline end-to-end.
Changes:
- Extend Linux
vm.yamland Windowswindows.yamlMAL rules to map both exporter and OTel hostmetrics sources into the same canonical SkyWalking meter targets (avoiding rule ownership collisions). - Add new process MAL rules (
process-hostmetrics-{linux,windows}.yaml) modeling normalized process groups as logical SkyWalking instances. - Add a new E2E case (
vm/otel-hostmetrics) including collector config, compose wiring, and workflow integration.
File summaries
| File | Description |
|---|---|
| test/e2e-v2/cases/vm/prometheus-node-exporter/otel-rules/vm.yaml | Extends Linux VM MAL to accept both node-exporter and OTel hostmetrics under vm-monitoring. |
| test/e2e-v2/cases/vm/otel-hostmetrics/otel-rules/windows.yaml | Adds Windows VM MAL rules for the OTel-hostmetrics E2E case. |
| test/e2e-v2/cases/vm/otel-hostmetrics/otel-rules/vm.yaml | Adds Linux VM MAL rules for the OTel-hostmetrics E2E case. |
| test/e2e-v2/cases/vm/otel-hostmetrics/otel-rules/process-hostmetrics-windows.yaml | Adds Windows process MAL rules mapping normalized process groups to instances. |
| test/e2e-v2/cases/vm/otel-hostmetrics/otel-rules/process-hostmetrics-linux.yaml | Adds Linux process MAL rules mapping normalized process groups to instances. |
| test/e2e-v2/cases/vm/otel-hostmetrics/otel-collector-config.yaml | Adds an otelcol-contrib config for host + process collection, normalization, grouping, and aggregation. |
| test/e2e-v2/cases/vm/otel-hostmetrics/expected/process-count-3.yml | Adds an assertion verifying grouped process count aggregation (=3). |
| test/e2e-v2/cases/vm/otel-hostmetrics/entrypoint.sh | Starts 3 sleep processes and runs the collector in the E2E container. |
| test/e2e-v2/cases/vm/otel-hostmetrics/e2e.yaml | Defines the new E2E verification steps for hostmetrics + process metrics. |
| test/e2e-v2/cases/vm/otel-hostmetrics/Dockerfile.otelcol | Builds a minimal image bundling otelcol-contrib plus the E2E entrypoint. |
| test/e2e-v2/cases/vm/otel-hostmetrics/docker-compose.yml | Wires OAP + BanyanDB + collector container; mounts MAL rules and collector config. |
| oap-server/server-starter/src/main/resources/otel-rules/windows.yaml | Updates production Windows infrastructure MAL to accept both windows-exporter and OTel hostmetrics sources. |
| oap-server/server-starter/src/main/resources/otel-rules/vm.yaml | Updates production Linux infrastructure MAL to accept both node-exporter and OTel hostmetrics sources. |
| oap-server/server-starter/src/main/resources/otel-rules/process-hostmetrics-windows.yaml | Adds production Windows process MAL rules for normalized process groups. |
| oap-server/server-starter/src/main/resources/otel-rules/process-hostmetrics-linux.yaml | Adds production Linux process MAL rules for normalized process groups. |
| .github/workflows/skywalking.yaml | Adds the new “VM OpenTelemetry Hostmetrics” E2E job entry and pins otelcol-contrib version via env. |
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Thanks for the contribution. I reviewed the current head and reproduced the Collector path with
The |
3a763b8 to
fe5d5ff
Compare
|
Thank you very much for the detailed review. I have addressed the points you raised and pushed an updated version of the PR. This review has been a particularly valuable learning experience for me. Several of the issues you pointed out helped me better understand both SkyWalking's metric contracts and the OpenTelemetry Collector processing model. I sincerely appreciate the time you spent reproducing the setup and explaining the problems so precisely. The changes are summarized below:
The final validation is green, including:
Thank you again for the thorough review and for the opportunity to improve both the implementation and my understanding of SkyWalking's architecture. |
Preserve the Linux CPU scale by summing utilization across logical CPUs and asserting 400% total and 100% normalized usage. Exclude overlapping Windows interrupt time from normalized CPU usage and add regression coverage. Remove the unimplemented network-connections metric from the documentation and synchronize the expected OTel rule configuration dump.
Collect the global Windows handle count from Process(_Total), update the related documentation, and clean trailing whitespace in the hostmetrics files.
|
Thanks for the updates. I re-reviewed 1. Combine user and system before calling The current expression calls All CPU modes arrive together in one I verified this with a complete Collector Contrib 0.158.0 export: 589 requests and 52,499 datapoints. The capture used the Linux reference configuration with 2-second collection intervals and a Each full request was decoded by the actual Here is the CPU portion of two complete exports, exactly 60 seconds apart. CPU time values are cumulative seconds; all eight modes were included together in each export, along with the other metric families.
The expected normalized user + system percentage is:
In the current expression, the system branch uses the user baseline Please use: - name: cpu_norm_percentage
exp: >
(system_cpu_time * 100)
.tagMatch('mode','^(user|system)$')
.sum(['node_identifier_host_name'])
.rate('PT1M')
/
system_cpu_logical_count.sum(['node_identifier_host_name'])The regex works in compiled MAL and selects exactly 2. Move the intended CPU regression samples into The new This explains why the existing fixture passes without detecting the issue:
Both comparisons were executed with compiled MAL. Please move the misplaced samples into Validation: the backend build and all 1,437 local MAL module tests passed. The full exported-data replay evaluated each CPU expression 295 times; 294 outputs differed, with both expressions returning zero for the initial observation without counter history. Replaying the two complete exports above separately also reproduced the failure and verified the proposed result. |
|
@mike-realuptime Any update about this? |
|
Thanks for the follow-up. I reproduced the issue and confirmed both remaining points. I have updated the Windows normalized CPU expression to combine the I also moved the I reran the MAL tests and the relevant validation successfully. Thanks again for the precise reproduction and explanation. |
|
Please submit your horizon side template updates. |
Summary
This PR adds OpenTelemetry Collector hostmetrics support for Linux and Windows infrastructure monitoring, including host-level metrics and logical process monitoring.
Key changes:
process-hostmetrics-linuxandprocess-hostmetrics-windows.state -> modeandprocess.handles -> process.open_handles.The final test suite is green across MAL runtime tests, backend build, Linux host/process E2E, Windows OTLP fixture coverage, raw Collector assertions, and the existing node-exporter regression E2E.
No Horizon/UI changes are included in this PR.