Class: ClaudeMemory::OTel::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_memory/otel/status.rb

Overview

Single source of truth for “what does telemetry look like right now?” Used by both the ‘claude-memory otel –status` CLI and the dashboard’s Telemetry header. Pure read query — no writes.

Instance Method Summary collapse

Constructor Details

#initialize(store, configuration: nil, settings_writer: nil) ⇒ Status

Returns a new instance of Status.



9
10
11
12
13
# File 'lib/claude_memory/otel/status.rb', line 9

def initialize(store, configuration: nil, settings_writer: nil)
  @store = store
  @configuration = configuration || ClaudeMemory::Configuration.new
  @settings_writer = settings_writer
end

Instance Method Details

#snapshotHash

Returns:

  • (Hash)


16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/claude_memory/otel/status.rb', line 16

def snapshot
  {
    metric_count: count_safely(:otel_metrics),
    event_count: count_safely(:otel_events),
    trace_count: count_safely(:otel_traces),
    last_metric_at: last_timestamp(:otel_metrics, :recorded_at),
    last_event_at: last_timestamp(:otel_events, :occurred_at),
    last_trace_at: last_timestamp(:otel_traces, :recorded_at),
    traces_enabled: @configuration.otel_traces_enabled?,
    configured_env: configured_env,
    endpoint: configured_endpoint
  }
end