Repository navigation
Expand file tree
/
Copy pathtelemetry.config.ts
More file actions
118 lines (109 loc) · 3.31 KB
/
Copy pathtelemetry.config.ts
File metadata and controls
118 lines (109 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/**
* Sim OpenTelemetry Configuration
*
* PRIVACY NOTICE:
* - Telemetry is enabled by default to help us improve the product
* - You can disable telemetry via:
* 1. Settings UI > Privacy tab > Toggle off "Allow anonymous telemetry"
* 2. Setting NEXT_TELEMETRY_DISABLED=1 environment variable
*
* This file allows you to configure OpenTelemetry collection for your
* Sim instance. If you've forked the repository, you can modify
* this file to send telemetry to your own collector.
*
* We only collect anonymous usage data to improve the product:
* - Feature usage statistics
* - Error rates (always captured)
* - Performance metrics (sampled at 10%)
* - AI/LLM operation traces (always captured for workflows)
*
* We NEVER collect:
* - Personal information
* - Workflow content or outputs
* - API keys or tokens
* - IP addresses or geolocation data
*/
import { env } from './lib/core/config/env'
const config = {
/**
* OTLP Endpoint URL where telemetry data is sent
* Change this if you want to send telemetry to your own collector
* Supports any OTLP-compatible backend (Jaeger, Grafana Tempo, etc.)
*/
endpoint: env.TELEMETRY_ENDPOINT || 'https://telemetry.simstudio.ai/v1/traces',
/**
* Service name used to identify this instance
* You can change this for your fork
*/
serviceName: 'sim-studio',
/**
* Version of the service, defaults to the app version
*/
serviceVersion: '0.1.0',
/**
* Batch settings for OpenTelemetry BatchSpanProcessor
* Optimized for production use with minimal overhead
*
* - maxQueueSize: Max number of spans to buffer (increased from 100 to 2048)
* - maxExportBatchSize: Max number of spans per batch (increased from 10 to 512)
* - scheduledDelayMillis: Delay between batches (5 seconds)
* - exportTimeoutMillis: Timeout for exporting data (30 seconds)
*/
batchSettings: {
maxQueueSize: 2048,
maxExportBatchSize: 512,
scheduledDelayMillis: 5000,
exportTimeoutMillis: 30000,
},
/**
* Sampling configuration
* - Errors: Always sampled (100%)
* - AI/LLM operations: Always sampled (100%)
* - Other operations: Sampled at 10%
*/
sampling: {
defaultRate: 0.1, // 10% sampling for regular operations
alwaysSampleErrors: true,
alwaysSampleAI: true,
},
/**
* Categories of events that can be collected
* This is used for validation when events are sent
*/
allowedCategories: [
'page_view',
'feature_usage',
'performance',
'error',
'workflow',
'consent',
'batch', // Added for batched events
],
/**
* Client-side instrumentation settings
* Set enabled: false to disable client-side telemetry entirely
*
* Client-side telemetry now uses:
* - Event batching (send every 10s or 50 events)
* - Only critical Web Vitals (LCP, FID, CLS)
* - Unhandled errors only
*/
clientSide: {
enabled: true,
batchIntervalMs: 10000, // 10 seconds
maxBatchSize: 50,
},
/**
* Server-side instrumentation settings
* Set enabled: false to disable server-side telemetry entirely
*
* Server-side telemetry uses:
* - OpenTelemetry SDK with BatchSpanProcessor
* - Intelligent sampling (errors and AI ops always captured)
* - Semantic conventions for AI/LLM operations
*/
serverSide: {
enabled: true,
},
}
export default config