-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy path.env.tracing.example
More file actions
175 lines (129 loc) · 5.88 KB
/
.env.tracing.example
File metadata and controls
175 lines (129 loc) · 5.88 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# Distributed Tracing Environment Configuration
# Copy this to .env and adjust values for your environment
# ============================================================================
# OPENTELEMETRY CORE CONFIGURATION
# ============================================================================
# Disable tracing completely (useful for development/testing)
OTEL_DISABLED=false
# Service identification
OTEL_SERVICE_NAME=substream-protocol-backend
OTEL_SERVICE_VERSION=1.0.0
# Diagnostic logging level (debug, info, warn, error)
OTEL_DIAG_LEVEL=error
# ============================================================================
# OTLP EXPORTER CONFIGURATION (Jaeger, DataDog, etc)
# ============================================================================
# Main OTLP endpoint (gRPC receiver)
# For Jaeger: http://jaeger:4317
# For DataDog: https://trace.agentless.us/v1/traces (requires API key)
# For local development: http://localhost:4317
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# Traces-specific endpoint (overrides general endpoint)
# OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4317/v1/traces
# Additional headers for authentication/customization
# Format: key1=value1,key2=value2
# Example for DataDog:
# OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20<API_KEY>,DD-API-KEY=<API_KEY>
OTEL_EXPORTER_OTLP_HEADERS=
# ============================================================================
# TRACING CONFIGURATION
# ============================================================================
# Paths to exclude from HTTP tracing (comma-separated)
# Common exclusions: /health, /metrics, /status
OTEL_IGNORE_PATHS=/health,/metrics,/status
# Sampling configuration
# 1.0 = sample all traces (100%)
# 0.1 = sample 10% of traces
# 0.01 = sample 1% of traces (recommended for production)
OTEL_SAMPLING_RATE=0.1
# ============================================================================
# SPAN PROCESSOR CONFIGURATION
# ============================================================================
# Batch span processor settings
# Maximum number of spans to batch before export
OTEL_BATCH_SPAN_PROCESSOR_MAX_QUEUE_SIZE=2048
# Maximum number of spans to export per batch
OTEL_BATCH_SPAN_PROCESSOR_MAX_EXPORT_BATCH_SIZE=512
# Delay (milliseconds) between batch exports
OTEL_BATCH_SPAN_PROCESSOR_SCHEDULED_DELAY_MS=5000
# ============================================================================
# INSTRUMENTATION SETTINGS
# ============================================================================
# Enable/disable specific instrumentations
OTEL_INSTRUMENTATION_HTTP_ENABLED=true
OTEL_INSTRUMENTATION_EXPRESS_ENABLED=true
OTEL_INSTRUMENTATION_PG_ENABLED=true
OTEL_INSTRUMENTATION_REDIS_ENABLED=true
OTEL_INSTRUMENTATION_AMQP_ENABLED=true
# Request size limits for recording
OTEL_MAX_REQUEST_SIZE=1024000 # 1MB
OTEL_MAX_RESPONSE_SIZE=10485760 # 10MB
# ============================================================================
# TRACE CONTEXT PROPAGATION
# ============================================================================
# Trace context propagation format
# Options: w3c (recommended), b3, jaeger, datadog
OTEL_PROPAGATORS=w3c
# Enable correlation ID tracking
CORRELATION_ID_HEADER=x-correlation-id
# Trace context header name
TRACE_CONTEXT_HEADER=traceparent
# ============================================================================
# PERFORMANCE & MEMORY
# ============================================================================
# Memory limit for span buffer (in bytes)
OTEL_MEMORY_LIMIT=0 # 0 = unlimited
# Span attribute limit (max attributes per span)
OTEL_SPAN_ATTRIBUTE_LIMIT=128
# Event limit (max events per span)
OTEL_SPAN_EVENT_LIMIT=128
# Link limit (max links per span)
OTEL_SPAN_LINK_LIMIT=128
# ============================================================================
# DEVELOPMENT SETTINGS
# ============================================================================
# Enable verbose console logging (development only)
# Set to 'true' to see all spans in console
OTEL_CONSOLE_EXPORTER=false
# Enable span metrics (slower, development only)
OTEL_METRICS_ENABLED=false
# Pretty print spans in logs
OTEL_PRETTY_PRINT_SPANS=false
# ============================================================================
# DATABASE TRACING
# ============================================================================
# Include SQL queries in spans (security: don't enable in production with PII)
OTEL_DB_INCLUDE_SQL=false
# Limit SQL query length (prevents large queries from bloating spans)
OTEL_DB_SQL_MAX_LENGTH=500
# Capture number of rows affected
OTEL_DB_CAPTURE_ROW_COUNT=true
# ============================================================================
# EXTERNAL SERVICE CONFIGURATION
# ============================================================================
# IPFS/Storage service endpoints for trace context propagation
PINATA_API_ENDPOINT=https://api.pinata.cloud
WEB3_STORAGE_ENDPOINT=https://api.web3.storage
INFURA_IPFS_ENDPOINT=https://infura-ipfs.io
# Stripe configuration
STRIPE_API_KEY=sk_live_...
STRIPE_API_ENDPOINT=https://api.stripe.com
# Stellar configuration
STELLAR_NETWORK=TESTNET
STELLAR_SERVER_URL=https://horizon-testnet.stellar.org
# ============================================================================
# MONITORING & ALERTING
# ============================================================================
# Enable automatic performance alerts
OTEL_PERFORMANCE_ALERTS=true
# Span duration threshold for alerts (milliseconds)
OTEL_SPAN_DURATION_ALERT_THRESHOLD=5000
# Error rate threshold for alerts (0.0-1.0)
OTEL_ERROR_RATE_ALERT_THRESHOLD=0.05
# Enable distributed trace visualization
OTEL_TRACE_VISUALIZATION_ENABLED=true
# ============================================================================
# ENVIRONMENT
# ============================================================================
NODE_ENV=development
LOG_LEVEL=info