lablup / lablup/backend.ai

Resilience Request ID Based Recorder Policy and Phase History

Open
#7,747 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Motivation

The resilience decorator pattern in client code currently lacks request-level recording of success/failure information. Additionally, there is no way to track the execution phases and steps for debugging and auditing purposes.

- No ContextVar-based recorder for tracking resilience operation results per request
- Resilience failures are not recorded to error logs with request context
- No phase history tracking in audit logs for detailed execution tracing
- No CLI tool for administrators to query phase history

## Objective

Add request ID based recording to resilience decorators and store phase history in audit logs for comprehensive observability.

- Implement RequestRecorder and RequestRecorderContext following sokovan recorder pattern
- Add RecorderPolicy to resilience chain for automatic recording
- Connect recorder failures to Error Log Service
- Add phase_history JSONB column to audit_logs table
- Implement admin CLI for querying phase history (superadmin only)

## Expected Sub Issues

- Define Resilience Request Recorder Types and Context
- Implement RecorderPolicy and Integrate with Resilience Chain
- Connect Request Recorder Failures to Error Log
- Add phase_history Column to Audit Log Table
- Implement Admin CLI for Phase History Query

JIRA Issue: BA-3719

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.