Jido.Exec.Telemetry (Jido Action v2.3.0)

View Source

Centralized telemetry, logging, and debugging helpers for Jido.Exec.

This module consolidates all telemetry event emission, logging functionality, and error message extraction used throughout the execution system.

Summary

Functions

Conditional logging wrapper for caught errors.

Conditional logging wrapper for end events.

Conditional logging wrapper for errors.

Conditional logging wrapper for execution debug.

Conditional logging wrapper for general failures.

Conditional logging wrapper for function errors.

Conditional logging wrapper for general messages.

Conditional logging wrapper for retry attempts.

Conditional logging wrapper for start events.

Conditional logging wrapper for unexpected errors.

Conditional logging wrapper for validation failures.

Emits telemetry end event for action execution.

Emits telemetry start event for action execution.

Safely extracts error messages from various error types, handling nil and nested cases.

Logs the end of action execution.

Logs the start of action execution.

Functions

cond_log_caught_error(log_level, reason)

@spec cond_log_caught_error(atom(), any()) :: :ok

Conditional logging wrapper for caught errors.

cond_log_end(log_level, action, result)

@spec cond_log_end(atom(), module(), any()) :: :ok

Conditional logging wrapper for end events.

cond_log_error(log_level, action, error)

@spec cond_log_error(atom(), module(), any()) :: :ok

Conditional logging wrapper for errors.

cond_log_execution_debug(log_level, action, params, context)

@spec cond_log_execution_debug(atom(), module(), map(), map()) :: :ok

Conditional logging wrapper for execution debug.

cond_log_failure(log_level, reason)

@spec cond_log_failure(atom(), any()) :: :ok

Conditional logging wrapper for general failures.

cond_log_function_error(log_level, error)

@spec cond_log_function_error(atom(), any()) :: :ok

Conditional logging wrapper for function errors.

cond_log_message(log_level, level, message)

@spec cond_log_message(atom(), atom(), String.t()) :: :ok

Conditional logging wrapper for general messages.

cond_log_retry(log_level, action, retry_count, max_retries, backoff)

@spec cond_log_retry(
  atom(),
  module(),
  non_neg_integer(),
  non_neg_integer(),
  non_neg_integer()
) :: :ok

Conditional logging wrapper for retry attempts.

cond_log_start(log_level, action, params, context)

@spec cond_log_start(atom(), module(), map(), map()) :: :ok

Conditional logging wrapper for start events.

cond_log_unexpected_error(log_level, error)

@spec cond_log_unexpected_error(atom(), any()) :: :ok

Conditional logging wrapper for unexpected errors.

cond_log_validation_failure(log_level, action, validation_error)

@spec cond_log_validation_failure(atom(), module(), any()) :: :ok

Conditional logging wrapper for validation failures.

emit_end_event(action, params, context, result)

@spec emit_end_event(module(), map(), map(), any()) :: :ok

Emits telemetry end event for action execution.

emit_start_event(action, params, context)

@spec emit_start_event(module(), map(), map()) :: :ok

Emits telemetry start event for action execution.

extract_safe_error_message(error)

@spec extract_safe_error_message(any()) :: String.t()

Safely extracts error messages from various error types, handling nil and nested cases.

log_execution_end(action, params, context, result)

@spec log_execution_end(module(), map(), map(), any()) :: :ok

Logs the end of action execution.

log_execution_start(action, params, context)

@spec log_execution_start(module(), map(), map()) :: :ok

Logs the start of action execution.