Class: ActiveAgent::Dashboard::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/active_agent/dashboard/engine.rb

Overview

Rails Engine for the ActiveAgent Dashboard.

Provides the free self-hosted dashboard: telemetry traces, metrics, and the local trace ingestion API.

Mount in your routes:

mount ActiveAgent::Dashboard::Engine => "/activeagents"

Class Method Summary collapse

Class Method Details

.dashboard_rootObject

Alias for consistency with existing code



36
37
38
# File 'lib/active_agent/dashboard/engine.rb', line 36

def self.dashboard_root
  root
end

.find_root(_from) ⇒ Object

The engine lives at lib/active_agent/dashboard rather than the gem root. Rails derives an engine's load paths (app/models, app/controllers, app/jobs, app/views, config/routes.rb) from find_root when config is first materialized — which isolate_namespace below triggers via routes — so this override must be defined before anything touches config. Overriding only root leaves the engine's classes off host applications' autoload paths entirely.



22
23
24
# File 'lib/active_agent/dashboard/engine.rb', line 22

def self.find_root(_from)
  root
end

.rootObject



26
27
28
# File 'lib/active_agent/dashboard/engine.rb', line 26

def self.root
  @root ||= Pathname.new(File.expand_path("..", __FILE__))
end