Commit 9a5c6a2
feat: add telemetry engine for distributed tracing (#326)
* feat: add telemetry engine for distributed tracing
Adds a comprehensive telemetry system for collecting and reporting agent traces
to hosted or self-hosted observability endpoints.
Features:
- Trace collection with spans for generation lifecycle
- Token usage tracking (input, output, thinking)
- Tool call tracing with timing
- Error recording with backtraces
- Async HTTP reporting with batching
- Configurable sampling rate
- Auto-instrumentation via railtie
Configuration via YAML:
telemetry:
enabled: true
endpoint: https://api.activeagents.ai/v1/traces
api_key: your-api-key
sample_rate: 1.0
Or programmatically:
ActiveAgent::Telemetry.configure do |config|
config.enabled = true
config.endpoint = "https://..."
config.api_key = "..."
end
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add dashboard engine for telemetry visualization
This adds a Rails Engine to the ActiveAgent gem that provides:
- TelemetryTrace model for storing traces
- TracesController for viewing traces in a dashboard
- API::TracesController for ingesting traces
- ProcessTelemetryTracesJob for async trace processing
- ERB views with Tailwind CSS for the dashboard UI
- Install generator for migrations and configuration
The dashboard supports two modes:
- Local mode: Single-tenant, no auth, synchronous processing
- Multi-tenant mode: Account association, API key auth, async processing
Configuration options:
- multi_tenant: Enable multi-tenant mode
- account_class: Class name for Account model
- current_account_method: Controller method to get current account
- trace_model_class: Custom trace model class
- use_inertia: Enable React/Inertia frontend
- authentication_method: Custom auth callback
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: rename create_migration to avoid Rails conflict
The method name 'create_migration' conflicts with
ActiveRecord::Generators::Migration module internals.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(dashboard): Add engine models, jobs, and install generator
- Add Agent, AgentRun, AgentVersion, AgentTemplate models
- Add SandboxSession, SandboxRun models
- Add SessionRecording, RecordingAction, RecordingSnapshot models
- Add AgentExecutionJob, SandboxProvisionJob, SandboxCleanupJob
- Add install generator with migrations
- Add DashboardController for root view
- Fix RuboCop: exclude generator templates from linting
- Fix style issues (array bracket spacing)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 209e23e commit 9a5c6a2
57 files changed
Lines changed: 6868 additions & 1050 deletions
File tree
- docs
- .vitepress
- theme
- framework
- public
- lib
- active_agent
- dashboard
- app
- controllers/active_agent/dashboard
- api
- jobs/active_agent
- dashboard
- models/active_agent
- dashboard
- views
- active_agent/dashboard/traces
- layouts/active_agent/dashboard
- config
- telemetry
- generators/active_agent/dashboard
- install
- templates
- migrations
- templates
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
0 commit comments