Tests: the log's fields and the metrics Grafana reads #403
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
logging.rs is at 50% and the directory's otel.rs at 61% (
format_event); metrics.rs's serving path is partly untested. The dashboard and the alert rules read the log's fields (ev,feed,new,bytes,msg,error.type) and the metrics' names (CLAUDE.md: rename one and its panels go blank without an error). Nothing tests that they are what the dashboard expects.Tests to add:
trace_idandspan_idmessage,instance,accepted, therefused_*counts)Seen with the coverage of both suites merged line by line (cargo:
sh scripts/coverage.sh, browser:sh scripts/coverage.sh api; reports in target/coverage/cargo, api and page; #390, #394), as of 2026-11-07. A test added here shows in Grafana's Coverage row at the next run.Tests added in
b62182e: every ipx_ metric grafana/dashboard.py and alerts.py name is served by /metrics' render (names read from the two files at compile time; the coverage ones are node-exporter's and skipped); ipx's JSON lines for feed_done, download_done and feed_error carry ev, feed, new, bytes, msg and error.type, and trace_id and span_id inside a span; the directory's snapshot line carries instance, accepted and the refused_ counts. The JSON log layer is one function, otel::json_layer, for both services now. The log tests set the global subscriber, since a scoped one loses the trace ids (#408).