ServiceAnalyticsSpec class

Per-service analytics catalog: declares WHAT a service's analytics page shows, while the data source and AnalyticsDashboard handle HOW.

Composes the existing dashboard config types (ChartConfig, TableConfig) so a service UI can do:

const spec = ServiceAnalyticsSpec(
  service: 'payment',
  kpis: [
    KpiSpec('total', label: 'Payments', metric: 'payment_total'),
  ],
  charts: [
    ChartConfig.timeSeries('payment_total', label: 'Volume'),
  ],
  tables: [
    TableConfig.topN('payment_total', label: 'Top Routes',
        groupBy: 'route'),
  ],
);

AnalyticsDashboard(
  service: spec.service,
  title: 'Payments',
  metrics: spec.metricKeys,
  charts: spec.charts,
  tables: spec.tables,
)

Constructors

ServiceAnalyticsSpec({required String service, Map<String, String> baseFilters = const {}, List<KpiSpec> kpis = const [], List<ChartConfig> charts = const [], List<TableConfig> tables = const []})
const

Properties

baseFilters Map<String, String>
Filters applied to every query for this service (e.g. {'service': 'payment'}).
final
charts List<ChartConfig>
Charts (time series and distributions), reusing the dashboard config.
final
hashCode int
The hash code for this object.
no setterinherited
kpis List<KpiSpec>
KPI cards, each backed by a scalar query.
final
metricKeys List<String>
KPI keys, in declared order, for AnalyticsDashboard.metrics.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
service String
Service identifier matching the service argument that AnalyticsDashboard and the data source pass around.
final
tables List<TableConfig>
Top-N tables, reusing the dashboard config.
final

Methods

chartFor(String metric, {ChartType? type}) ChartConfig?
The chart config for metric, optionally narrowed by chart type, or null when not declared.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
tableFor(String metric) TableConfig?
The table config for metric, or null when not declared.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited