Skip to content

ccproxy.plugins.request_tracer.config

ccproxy.plugins.request_tracer.config

Configuration for the RequestTracer plugin.

RequestTracerConfig

Bases: BaseModel

Unified configuration for request tracing.

Combines structured JSON tracing (from core_tracer) and raw HTTP logging (from raw_http_logger) into a single configuration.

get_json_log_dir

get_json_log_dir()

Get directory for structured JSON logs.

Source code in ccproxy/plugins/request_tracer/config.py
def get_json_log_dir(self) -> str:
    """Get directory for structured JSON logs."""
    return self.request_log_dir or self.log_dir

get_raw_log_dir

get_raw_log_dir()

Get directory for raw HTTP logs.

Source code in ccproxy/plugins/request_tracer/config.py
def get_raw_log_dir(self) -> str:
    """Get directory for raw HTTP logs."""
    return self.raw_log_dir or self.log_dir

should_trace_path

should_trace_path(path)

Check if a path should be traced based on include/exclude rules.

Source code in ccproxy/plugins/request_tracer/config.py
def should_trace_path(self, path: str) -> bool:
    """Check if a path should be traced based on include/exclude rules."""
    # First check exclude_paths (takes precedence)
    if any(path.startswith(exclude) for exclude in self.exclude_paths):
        return False

    # Then check include_paths (if specified, only log included paths)
    if self.include_paths:
        return any(path.startswith(include) for include in self.include_paths)

    # Default: trace all paths not explicitly excluded
    return True