Repository navigation
feat(telemetry): collect NetFlow, Prometheus, and syslog on a shared management network - #276
Conversation
Turn the NetFlow prototype into an option any scenario can enable with `telemetry: [netflow]` in a case or `nika env run --telemetry netflow`. - Check the `io.nika.telemetry` image label and fail before deploy when no device supports the requested telemetry; configure only capable devices (nika/frr now ships pmacct and the label). - Add a flow_collector on an out-of-band export LAN (subnet configurable under nika.telemetry.netflow) and run one ingress pmacct probe per interface, so a link fault stops only that interface's export. - Keep the export interface in a VRF reached through a policy rule, so `redistribute connected` or `redistribute kernel` never advertise it, and hide the export link from the topology given to agents and faults. - Select the netflow_query MCP server from the session's telemetry. - Include telemetry in task IDs, fingerprints, selection output and release materialization only when set, so published tasks keep their identity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hase Always wire the flow collector and the management network when telemetry is enabled, on every device's last lab interface. After the lab passes its checks, run `pmacctd -V` in each container and configure export only on the devices that answer, recording their pmacct versions. A scenario with no capable device no longer fails: its collector receives no records. Remove the io.nika.telemetry image label and its helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `prometheus` as a second telemetry kind next to `netflow`. Both share one out-of-band management network and one collector. - Move the wiring out of netflow.py into nika.telemetry.management: a telemetry_switch node bridges, in its kernel, one point-to-point link per device and one to telemetry_collector, on each device's last interface. A single shared Kathara link (a userspace hub) collapsed on isp_germany50. - Prometheus: node_exporter (network-namespace collectors only) listens on loopback behind a socat relay bound to the management VRF, so the data plane cannot reach it. Prometheus on the collector labels targets `node`; agents query it with the new prometheus_query MCP tool. - Install node_exporter and socat in nika/frr and nika/base; rename the collector image to nika/telemetry-collector (nfdump + prometheus). - Move the subnet setting to nika.telemetry.subnet. - Scale to large labs: shrink the pmacct plugin pipe (75 probes on isp_brain zib exhausted the router's memory), probe and check devices in parallel, size the readiness wait by device count, and give the collector 1 GB. - Let agents control result volume: netflow_query and prometheus_query pass `limit` through and add no caps or hints; the MCP gateway's output budget protects context as for every other tool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Extend opt-in telemetry with syslog, attach it on Containerlab SR Linux, and export NetFlow, Prometheus, and syslog from SDN, P4, XRd, and RouterOS devices so agents query one collector path. Refs #217 Co-authored-by: Cursor <cursoragent@cursor.com>
c57513a to
91ea4cd
Compare
Documentation review: FAILReviewed all three changed human-facing documents:
|
Complete the benchmark YAML example, replace per-platform inventory with a compatibility table, and require a passing docs review before a docs commit is pushed. Refs #217 Co-authored-by: Cursor <cursoragent@cursor.com>
Documentation review: FAILReviewed the changed human-facing documentation at
No README files changed. Applied the NIKA documentation guidelines: reader purpose, clear structure and conventional terminology, accurate commands and paths, working links, minimal duplication, and sufficient prerequisites and examples. Source reads were limited to verifying documentation claims; this is not a code review or runtime validation.
|
Drop the user-facing subnet setting, describe SR Linux syslog as UDP 514, and remove leftover coverage tests that were not part of the diagnosis path. Refs #217 Co-authored-by: Cursor <cursoragent@cursor.com>
Documentation review: PASSReviewed the four changed human-facing docs at
Applied the documentation guidelines: reader purpose first, clear headings and conventional terminology, accurate commands and paths, working links, one home per concept, and sufficient prerequisites and examples. No blocking or optional findings remain in the changed documentation. Previous findingsThe remaining blocker is resolved: network-scenarios.md, line 724 now correctly distinguishes Prometheus collection through gNMI from syslog delivery over UDP 514, with gNMI used to configure the logging destination. This satisfies “keep simplification accurate” and “use conventional network-engineering language.” The runnable benchmark example, compatibility table, and tabulated PromQL examples also retain the earlier corrections. Documentation-only review; source reads were limited to checking documented interfaces and examples. No runtime tests or code review performed. Merge verdict: PASS. |
Summary
telemetry: [netflow, prometheus, syslog]on Kathara and Containerlab environments (nika env run --telemetryor the same field on a task).telemetry_collector) on an out-of-band management network (Kathara) or the lab management network (Containerlab). Probe exporters at runtime and configure only devices that support the requested kind.netflow_query, device metrics withprometheus_query, and device logs withsyslog_query. SDN, P4, SR Linux, XRd, and RouterOS export through the same tools.Rebased onto current
dev(the earlier cherry-pick of these commits ondevwas reverted). Devices without an exporter stay unconfigured instead of aborting the lab, so mixed-vendor and INT-collector nodes do not block deploy. Compatibility is probed per device at lab check; there is no image-digest capability cache yet.Test plan
tests/nika/service/test_mcp_tools_live.py)byo.langgraph+ Qwen3.8-27B-FP8:dc_closlink_downcalledsyslog_query;frr_service_downcalledprometheus_queryandsyslog_query; both submitted the correct root causedevFixes #217