stackConsult commited on
Commit
276436b
·
verified ·
1 Parent(s): 59b4838

Create docs/configs/analytics_config.json

Browse files
Files changed (1) hide show
  1. docs/configs/analytics_config.json +363 -0
docs/configs/analytics_config.json ADDED
@@ -0,0 +1,363 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "analytics_agent": {
3
+ "version": "1.0.0",
4
+ "enabled": true,
5
+ "description": "Advanced analytics agent with custom metrics, notifications, and multi-role support",
6
+
7
+ "custom_metrics": {
8
+ "enabled": true,
9
+ "collection_interval_seconds": 60,
10
+ "retention_days": 90,
11
+ "metrics": [
12
+ {
13
+ "id": "user_engagement_score",
14
+ "name": "User Engagement Score",
15
+ "type": "composite",
16
+ "formula": "(active_users * avg_session_duration) / total_users",
17
+ "threshold_warning": 0.3,
18
+ "threshold_critical": 0.15
19
+ },
20
+ {
21
+ "id": "api_response_time_p95",
22
+ "name": "API Response Time (95th Percentile)",
23
+ "type": "performance",
24
+ "unit": "milliseconds",
25
+ "threshold_warning": 500,
26
+ "threshold_critical": 1000
27
+ },
28
+ {
29
+ "id": "error_rate",
30
+ "name": "Error Rate",
31
+ "type": "reliability",
32
+ "unit": "percentage",
33
+ "threshold_warning": 2,
34
+ "threshold_critical": 5
35
+ },
36
+ {
37
+ "id": "resource_utilization",
38
+ "name": "Resource Utilization",
39
+ "type": "system",
40
+ "components": ["cpu", "memory", "disk", "network"],
41
+ "threshold_warning": 75,
42
+ "threshold_critical": 90
43
+ }
44
+ ]
45
+ },
46
+
47
+ "notifications": {
48
+ "enabled": true,
49
+ "channels": [
50
+ {
51
+ "type": "email",
52
+ "enabled": true,
53
+ "recipients": ["admin@strategystack.io", "ops-team@strategystack.io"],
54
+ "severity_levels": ["warning", "critical"]
55
+ },
56
+ {
57
+ "type": "slack",
58
+ "enabled": true,
59
+ "webhook_url": "${SLACK_WEBHOOK_URL}",
60
+ "channel": "#analytics-alerts",
61
+ "severity_levels": ["critical"]
62
+ },
63
+ {
64
+ "type": "webhook",
65
+ "enabled": true,
66
+ "endpoint": "${WEBHOOK_ENDPOINT}",
67
+ "severity_levels": ["info", "warning", "critical"]
68
+ }
69
+ ],
70
+ "rate_limiting": {
71
+ "enabled": true,
72
+ "max_notifications_per_hour": 10,
73
+ "cooldown_minutes": 15
74
+ }
75
+ },
76
+
77
+ "role_views": {
78
+ "enabled": true,
79
+ "roles": [
80
+ {
81
+ "id": "admin",
82
+ "name": "Administrator",
83
+ "permissions": ["view_all", "configure", "export", "delete"],
84
+ "default_dashboard": "system_overview",
85
+ "visible_metrics": ["*"]
86
+ },
87
+ {
88
+ "id": "analyst",
89
+ "name": "Data Analyst",
90
+ "permissions": ["view_all", "export"],
91
+ "default_dashboard": "analytics_deep_dive",
92
+ "visible_metrics": ["user_engagement_score", "custom_metrics", "historical_trends"]
93
+ },
94
+ {
95
+ "id": "developer",
96
+ "name": "Developer",
97
+ "permissions": ["view_technical", "export"],
98
+ "default_dashboard": "api_performance",
99
+ "visible_metrics": ["api_response_time_p95", "error_rate", "system_health"]
100
+ },
101
+ {
102
+ "id": "viewer",
103
+ "name": "Read-Only Viewer",
104
+ "permissions": ["view_summary"],
105
+ "default_dashboard": "executive_summary",
106
+ "visible_metrics": ["user_engagement_score"]
107
+ }
108
+ ]
109
+ },
110
+
111
+ "batch_processing": {
112
+ "enabled": true,
113
+ "schedule": "0 2 * * *",
114
+ "operations": [
115
+ {
116
+ "name": "daily_aggregation",
117
+ "type": "aggregate",
118
+ "source_metrics": ["*"],
119
+ "output_format": "parquet",
120
+ "retention_days": 365
121
+ },
122
+ {
123
+ "name": "weekly_report",
124
+ "type": "report",
125
+ "schedule": "0 3 * * 1",
126
+ "recipients": ["leadership@strategystack.io"],
127
+ "format": "pdf"
128
+ },
129
+ {
130
+ "name": "data_cleanup",
131
+ "type": "maintenance",
132
+ "schedule": "0 1 * * 0",
133
+ "purge_older_than_days": 90
134
+ }
135
+ ]
136
+ },
137
+
138
+ "historical_analysis": {
139
+ "enabled": true,
140
+ "storage_backend": "timeseries_db",
141
+ "compression": "zstd",
142
+ "features": [
143
+ {
144
+ "name": "trend_detection",
145
+ "enabled": true,
146
+ "algorithms": ["moving_average", "exponential_smoothing", "seasonal_decomposition"]
147
+ },
148
+ {
149
+ "name": "anomaly_detection",
150
+ "enabled": true,
151
+ "algorithms": ["isolation_forest", "statistical_outliers", "prophet"]
152
+ },
153
+ {
154
+ "name": "forecasting",
155
+ "enabled": true,
156
+ "horizon_days": 30,
157
+ "confidence_interval": 0.95
158
+ },
159
+ {
160
+ "name": "comparative_analysis",
161
+ "enabled": true,
162
+ "comparison_periods": ["day_over_day", "week_over_week", "month_over_month", "year_over_year"]
163
+ }
164
+ ]
165
+ },
166
+
167
+ "system_health": {
168
+ "enabled": true,
169
+ "monitoring_interval_seconds": 30,
170
+ "components": [
171
+ {
172
+ "name": "database",
173
+ "checks": ["connection_pool", "query_performance", "replication_lag"],
174
+ "critical_threshold": 5
175
+ },
176
+ {
177
+ "name": "cache",
178
+ "checks": ["hit_rate", "memory_usage", "eviction_rate"],
179
+ "critical_threshold": 3
180
+ },
181
+ {
182
+ "name": "queue",
183
+ "checks": ["depth", "processing_rate", "dead_letter_queue"],
184
+ "critical_threshold": 1000
185
+ },
186
+ {
187
+ "name": "external_services",
188
+ "checks": ["api_availability", "response_time", "rate_limits"],
189
+ "critical_threshold": 2
190
+ }
191
+ ],
192
+ "auto_recovery": {
193
+ "enabled": true,
194
+ "actions": ["restart_service", "clear_cache", "scale_resources"]
195
+ }
196
+ },
197
+
198
+ "api_endpoints": {
199
+ "enabled": true,
200
+ "base_path": "/api/v1/analytics",
201
+ "authentication": "bearer_token",
202
+ "rate_limiting": {
203
+ "enabled": true,
204
+ "requests_per_minute": 100
205
+ },
206
+ "endpoints": [
207
+ {
208
+ "path": "/metrics",
209
+ "methods": ["GET"],
210
+ "description": "Retrieve current metrics",
211
+ "parameters": ["metric_id", "start_time", "end_time", "granularity"]
212
+ },
213
+ {
214
+ "path": "/metrics/custom",
215
+ "methods": ["POST", "PUT", "DELETE"],
216
+ "description": "Manage custom metrics",
217
+ "permissions": ["admin"]
218
+ },
219
+ {
220
+ "path": "/dashboards",
221
+ "methods": ["GET"],
222
+ "description": "Get dashboard configurations for user role"
223
+ },
224
+ {
225
+ "path": "/alerts",
226
+ "methods": ["GET", "POST"],
227
+ "description": "Manage alert configurations"
228
+ },
229
+ {
230
+ "path": "/export",
231
+ "methods": ["POST"],
232
+ "description": "Export analytics data",
233
+ "parameters": ["format", "metrics", "date_range"],
234
+ "formats": ["json", "csv", "parquet", "excel"]
235
+ },
236
+ {
237
+ "path": "/health",
238
+ "methods": ["GET"],
239
+ "description": "Get system health status",
240
+ "public": true
241
+ },
242
+ {
243
+ "path": "/historical",
244
+ "methods": ["GET"],
245
+ "description": "Access historical analysis and trends",
246
+ "parameters": ["analysis_type", "metric_id", "time_range"]
247
+ }
248
+ ]
249
+ },
250
+
251
+ "failover_logging": {
252
+ "enabled": true,
253
+ "primary_logger": {
254
+ "type": "elasticsearch",
255
+ "endpoint": "${ELASTICSEARCH_URL}",
256
+ "index_pattern": "analytics-logs-%{+YYYY.MM.dd}"
257
+ },
258
+ "failover_loggers": [
259
+ {
260
+ "priority": 1,
261
+ "type": "cloudwatch",
262
+ "log_group": "strategystack-analytics",
263
+ "retention_days": 30
264
+ },
265
+ {
266
+ "priority": 2,
267
+ "type": "file",
268
+ "path": "/var/log/analytics",
269
+ "rotation": "daily",
270
+ "max_size_mb": 100,
271
+ "retention_days": 7
272
+ },
273
+ {
274
+ "priority": 3,
275
+ "type": "syslog",
276
+ "endpoint": "${SYSLOG_ENDPOINT}",
277
+ "protocol": "tcp"
278
+ }
279
+ ],
280
+ "health_check_interval_seconds": 60,
281
+ "auto_failover": true,
282
+ "log_levels": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
283
+ "structured_logging": true,
284
+ "include_metadata": {
285
+ "timestamp": true,
286
+ "correlation_id": true,
287
+ "user_id": true,
288
+ "session_id": true,
289
+ "environment": true
290
+ }
291
+ },
292
+
293
+ "integration_points": {
294
+ "ui_interface": {
295
+ "enabled": true,
296
+ "framework": "react",
297
+ "components": [
298
+ {
299
+ "name": "MetricsDashboard",
300
+ "path": "src/components/analytics/MetricsDashboard.tsx",
301
+ "props": ["roleId", "dateRange", "refreshInterval"]
302
+ },
303
+ {
304
+ "name": "CustomMetricBuilder",
305
+ "path": "src/components/analytics/CustomMetricBuilder.tsx",
306
+ "permissions": ["admin", "analyst"]
307
+ },
308
+ {
309
+ "name": "AlertsPanel",
310
+ "path": "src/components/analytics/AlertsPanel.tsx",
311
+ "realtime": true
312
+ },
313
+ {
314
+ "name": "HistoricalAnalyzer",
315
+ "path": "src/components/analytics/HistoricalAnalyzer.tsx",
316
+ "features": ["trends", "forecasting", "anomalies"]
317
+ },
318
+ {
319
+ "name": "SystemHealthMonitor",
320
+ "path": "src/components/analytics/SystemHealthMonitor.tsx",
321
+ "update_interval_seconds": 10
322
+ }
323
+ ],
324
+ "websocket_endpoint": "${WEBSOCKET_URL}/analytics",
325
+ "state_management": "redux"
326
+ },
327
+ "backend_services": {
328
+ "strategy_engine": {
329
+ "metrics_export": true,
330
+ "event_hooks": ["strategy_execution", "performance_update"]
331
+ },
332
+ "user_service": {
333
+ "metrics_export": true,
334
+ "event_hooks": ["user_action", "session_start", "session_end"]
335
+ },
336
+ "notification_service": {
337
+ "alert_integration": true,
338
+ "priority_routing": true
339
+ }
340
+ }
341
+ },
342
+
343
+ "performance_optimization": {
344
+ "caching": {
345
+ "enabled": true,
346
+ "strategy": "redis",
347
+ "ttl_seconds": 300,
348
+ "cache_warmer": true
349
+ },
350
+ "query_optimization": {
351
+ "enabled": true,
352
+ "use_materialized_views": true,
353
+ "parallel_queries": true,
354
+ "query_timeout_seconds": 30
355
+ },
356
+ "data_sampling": {
357
+ "enabled": true,
358
+ "high_cardinality_threshold": 10000,
359
+ "sampling_rate": 0.1
360
+ }
361
+ }
362
+ }
363
+ }