Skip to content

app_debugger_analytics Pro

Analytics event inspector sub-brick for app_debugger. Adds an Analytics tab to the debugger panel that captures all AnalyticInterceptor events in a ring buffer (default: 1000 entries). Automatically swapped to a no-op stub in release builds.

Version: 1.0.0

Variables

This brick has no generation-time variables.

Prerequisites

  • app_debugger brick must be installed first (provides archipelago:debug_panel_pages sentinel).
  • analytics_impl must be a dependency of template_app (provides AnalyticsInitializer).

Usage

Interactive

bash
archipelago generate app_debugger_analytics

Non-interactive (CI)

bash
archipelago generate app_debugger_analytics --config my_config.json

Generated Structure

features/
└── app_debugger_analytics/
    ├── app_debugger_analytics_api/
    │   └── lib/src/
    │       └── models/
    ├── app_debugger_analytics/
    │   └── lib/src/
    │       └── di/
    └── app_debugger_analytics_noop/
        └── lib/src/
            └── di/

Wiring (Auto-Patched by post_gen.dart)

bootstrap.dart — eager resolution

dart
// archipelago:debug_panel_pages:start
GetIt.I<AnalyticsInspectorSDK>();
// archipelago:debug_panel_pages:end

bootstrap.dart — interceptor registration

dart
// archipelago:analytics_inspector_interceptor:start
final analyticsInterceptor = GetIt.I<AnalyticsInspectorSDK>().interceptor;
if (analyticsInterceptor != null) {
  AnalyticsInitializer.registerInterceptor(analyticsInterceptor);
}
// archipelago:analytics_inspector_interceptor:end

If the post-gen hook could not locate the sentinel (e.g. app_debugger was not installed), add this wiring manually to apps/template_app/lib/bootstrap.dart.

Interceptor Chain Semantics

The AnalyticsDebuggerInterceptor is purely observational — it never drops events. intercept() always calls chain.proceed(data) and returns the result. Adding this interceptor has no side-effects on your analytics pipeline.

The onSetUserId and onReset hooks track the current user ID so captured entries carry the user context at the time of the event.

build_prepare Swap

yaml
- debug: app_debugger_analytics
  release: app_debugger_analytics_noop

Built by Banua Coder