Skip to content

Break Mode Logging Integration for Telemetry #38

@toddysm

Description

@toddysm

Summary

Add break mode logging integration to the telemetry system, as defined in Step 8 of specs/telemetry-enhancements.md Section 4.

This was deferred from #34 (PR #37) because break mode middleware is not yet implemented.

Acceptance Criteria

  • Add BreakRuleEntry dataclass to libs/decorators/metrics.py
  • Add break_rule_log: list[BreakRuleEntry] field to TelemetryConfig
  • Add * Break: output lines to format_curl_debug() when break rules are applied to a request
  • Add break row type to print_telemetry_block() text renderer
  • Add break_rules_applied field to JSON debug_call and scenario events
  • Sensitive value redaction for auth-related break rule mutations using redact_header_value()
  • Clear break_rule_log alongside method_timings after rendering
  • Unit tests for all rendering paths with synthetic BreakRuleEntry data

Design Reference

See specs/telemetry-enhancements.md Section 4: Break Mode Logging Integration.

Expected text output in --debug-calls:

* Break: invalid_content_type — replaced Content-Type
*   original: application/vnd.oci.image.manifest.v1+json
*   mutated:  text/plain

Expected telemetry block row:

     break  invalid_content_type                     1 applied

Files to Create/Modify

  • libs/decorators/metrics.py — Add BreakRuleEntry dataclass
  • libs/decorators/__init__.py — Add break_rule_log to TelemetryConfig, export BreakRuleEntry
  • libs/decorators/call_details.py — Add break rule lines to format_curl_debug() and format_curl_debug_json()
  • libs/decorators/output.py — Add break row rendering to text and JSON renderers
  • libs/decorators/scenario.py — Pass break entries to print_telemetry_block()
  • tests/test_break_mode_telemetry.py — New test file

Dependencies

  • Break mode middleware implementation (will populate break_rule_log during request processing)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions