Skip to content

Collect plugin process metrics on demand - #11

Merged
popduke merged 2 commits into
apache:mainfrom
popduke:plugin-process-metrics
Sep 29, 2026
Merged

popduke merged 2 commits into
apache:mainfrom
popduke:plugin-process-metrics

Conversation

@popduke

@popduke popduke commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Plugin instance CPU and resident memory are missing from the Runner's metrics endpoint, so users need separate instrumentation and collectors to observe plugins. This change includes those observations in GET /metrics through request-driven Runner → Pipeline → Plugin SDK collection.

  • Add a private metrics stream alongside Plugin Control. Java and Rust SDKs handle sampling, OpenTelemetry encoding, filtering and reconnection without an author-facing metrics API or periodic sampling.
  • Define shared CPU/RSS semantics and launch identity. The first CPU sample establishes a baseline; failed, unavailable and timed-out observations remain missing rather than becoming zero. Collection stays independent of plugin lifecycle and data delivery.
  • Keep queue measurements owned by the Pipeline and attribute submission/completion queues to the Source instance and egress queues to the actual Sink instance.
  • Organize reusable IPC and process-metrics packages under sdk/<language>, with shared IPC, process-metrics and Plugin SDK contracts. Update build paths, scaffolds, tests and documentation, including the Event-Driven Stateful Transducer description of Tenon Lua.

Runner, Pipeline and plugins built with the updated SDKs must be upgraded together. This change does not add compatibility negotiation for older SDKs.

Validation:

  • Complete macOS arm64 Rust/Java verification, including generated plugins, cross-language process contracts, shutdown and standalone package consumption.
  • Native Linux arm64 sampler, metrics-stream and Java/Rust process checks. Two Java lifecycle tests initially hit startup timeouts; isolated reruns and the subsequent full suite passed without timeout or production-code changes. The initial cause remains undetermined.
  • Current branch deployed on macOS arm64 and Linux amd64 with rebuilt MQTT/Kafka plugins. Verified CPU/RSS and queue metrics through the API and CPU/RSS in Console, sustained a local MQTT → Kafka → MQTT round trip at 10 messages/s, and received all 10 remote MQTT → Kafka canary messages.
  • Public documentation, license-header checks and git diff --check passed during implementation; the complete PR diff also passes git diff --check.

Add request-driven CPU and RSS collection through the Runner, Pipeline, and plugin SDKs. Keep queue metrics owned by the Pipeline and attribute them to the actual plugin instances.

Provide independent Rust and Java process sampling packages under sdk, update the shared contracts, and keep metric registration ownership private.

Validated with the complete Rust gate, cross-language process tests, and public documentation and license checks.
Comment thread README.md
Comment thread contracts/core/pipeline_control_field_registry.json
Comment thread sdk/rust/plugin-sdk/src/process/mod.rs
@popduke
popduke merged commit 1aff53c into apache:main Sep 29, 2026
6 checks passed
@popduke
popduke deleted the plugin-process-metrics branch September 29, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants