Module: Boxcars::ObservabilityBackend

Included in:
MultiBackend, PosthogBackend
Defined in:
lib/boxcars/observability_backend.rb

Overview

Module to be included by observability backend implementations. It defines the interface that all backends must adhere to.

Instance Method Summary collapse

Instance Method Details

#track(event:, properties:) ⇒ Object

Tracks an event with associated properties. This method must be implemented by any class that includes this module.

Parameters:

  • event (String, Symbol)

    The name of the event being tracked (e.g., :llm_call, :train_run).

  • properties (Hash)

    A hash of properties associated with the event. Common properties might include :user_id, :prompt, :response, :model_name, :duration_ms, :success, :error_message, etc.

Raises:

  • (NotImplementedError)

    if the including class does not implement this method.



13
14
15
# File 'lib/boxcars/observability_backend.rb', line 13

def track(event:, properties:)
  raise NotImplementedError, "#{self.class.name} must implement the `track` method."
end