Class: ActionAgent::TracesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/action_agent/traces_controller.rb

Overview

Controller for viewing telemetry traces.

Provides:

  • List view with filtering and pagination
  • Detail view with span timeline
  • Metrics overview
  • Live updates via Turbo Streams

Instance Method Summary collapse

Methods inherited from ApplicationController

allow_unauthenticated_access

Instance Method Details

#indexObject



12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/action_agent/traces_controller.rb', line 12

def index
  @traces = fetch_traces
  @metrics = calculate_metrics

  respond_to do |format|
    format.html
    # turbo-rails is optional; responding to an unregistered MIME
    # type raises in host apps without it.
    format.turbo_stream if turbo_stream_available?
  end
end

#metricsObject



28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/action_agent/traces_controller.rb', line 28

def metrics
  @metrics = calculate_metrics
  @agent_stats = agent_statistics
  @time_series = time_series_data

  respond_to do |format|
    format.html
    format.turbo_stream if turbo_stream_available?
  end
end

#showObject



24
25
26
# File 'app/controllers/action_agent/traces_controller.rb', line 24

def show
  @trace = scoped_traces.find(params[:id])
end