Skip to content

feat: add remote trace export, zbus integration, and Grafana metrics#4

Merged
tbitcs merged 1 commit into
mainfrom
orchestrator/subsys
Jun 2, 2026
Merged

feat: add remote trace export, zbus integration, and Grafana metrics#4
tbitcs merged 1 commit into
mainfrom
orchestrator/subsys

Conversation

@tbitcs

@tbitcs tbitcs commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Remote trace export, Zbus integration, and Grafana metrics

Changes

REQ-ARCH-038: Remote trace export

  • include/arbiter/arbiter_trace_export.h — Transport abstraction and export API
  • lib/arbiter_trace_export.c — Binary frame serialization with CRC-8 (poly 0x07), LE16 encoding, sequence counter wrapping at UINT16_MAX
  • Frame format: [0xAB][len_le16][seq_u16][rule_id_u16][fired_u8][action_id_u16][n_facts_u8][fact_ids...][crc8]
  • Kconfig: CONFIG_ARBITER_TRACE_EXPORT

REQ-ARCH-042: Zbus integration

  • include/arbiter/arbiter_zbus.h — Message structs (arbiter_facts_msg, arbiter_result_msg) and channel declarations
  • subsys/arbiter/arbiter_zbus.c — ZBUS_CHAN_DEFINE for facts input/result output, listener-based subscriber calling ARBITER_set_i32 + ARBITER_set_timestamp, publisher for result after eval
  • Kconfig: CONFIG_ARBITER_ZBUS (depends on ZBUS)

REQ-ARCH-042: Grafana metrics

  • subsys/arbiter/arbiter_metrics.c — Zephyr STATS section with eval_count, eval_latency_us, eval_max_latency_us, rules_fired, faults_active, op_count_last; SYS_INIT auto-registration
  • Kconfig: CONFIG_ARBITER_METRICS (depends on STATS)

Build integration

  • Root CMakeLists.txt: conditional trace export source
  • subsys/arbiter/CMakeLists.txt: conditional zbus and metrics sources
  • subsys/arbiter/Kconfig: all three new config options with dependency guards

Testing

  • All 63 Python tests pass (1 skipped placeholder)

Conversation: https://app.warp.dev/conversation/8f8df0d3-c90a-42a5-90a5-50b4e5647125
Run: https://oz.warp.dev/runs/019e88c4-f762-7750-8ff8-23657058f6f5
This PR was generated with Oz.

- REQ-ARCH-038: Remote trace export with CRC-8 binary framing and
  pluggable transport abstraction (arbiter_trace_export.h/.c)
- REQ-ARCH-042: Zbus integration with facts input subscriber and
  result output publisher (arbiter_zbus.h/.c)
- REQ-ARCH-042: Grafana metrics via Zephyr STATS subsystem with
  eval_count, latency, faults_active, etc. (arbiter_metrics.c)
- Kconfig: CONFIG_ARBITER_TRACE_EXPORT, CONFIG_ARBITER_ZBUS,
  CONFIG_ARBITER_METRICS with proper dependency guards
- CMakeLists.txt updates for conditional compilation

Co-Authored-By: Oz <oz-agent@warp.dev>
@tbitcs tbitcs merged commit b7e8250 into main Jun 2, 2026
6 checks passed
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.

1 participant