Configuration
The Shinzo TypeScript SDK provides extensive configuration options to customize telemetry collection, data processing, and export behavior for your MCP server.Basic Configuration
The minimal configuration requires only a few essential parameters:TelemetryConfig Interface
TheTelemetryConfig
interface provides comprehensive configuration options:
Required Parameters
Parameter | Type | Description |
---|---|---|
serverName | string | Name of your MCP server |
serverVersion | string | Version of your MCP server |
Export Configuration
Parameter | Type | Default | Description |
---|---|---|---|
exporterEndpoint | string | - | OpenTelemetry collector endpoint URL |
exporterType | 'otlp-http' | 'otlp-grpc' | 'console' | 'otlp-http' | Type of telemetry exporter |
exporterAuth | ExporterAuth | - | Authentication configuration |
Data Collection
Parameter | Type | Default | Description |
---|---|---|---|
enableTracing | boolean | true | Enable trace collection |
enableMetrics | boolean | true | Enable metrics collection |
enableArgumentCollection | boolean | false | Collect tool arguments in traces |
samplingRate | number | 1.0 | Trace sampling rate (0.0 to 1.0) |
Privacy & Processing
Parameter | Type | Default | Description |
---|---|---|---|
enablePIISanitization | boolean | true | Enable automatic PII sanitization |
PIISanitizer | PIISanitizer | - | Custom PII sanitizer instance |
dataProcessors | ((data: any) => any)[] | [] | Custom data processing functions |
Performance
Parameter | Type | Default | Description |
---|---|---|---|
metricExportIntervalMs | number | 5000 | Metric export interval in milliseconds |
batchTimeoutMs | number | 2000 | Batch timeout in milliseconds |
Authentication Configuration
Bearer Token Authentication
API Key Authentication
Basic Authentication
Exporter Types
OTLP HTTP Exporter (Default)
OTLP gRPC Exporter
Console Exporter (Development)
Perfect for development and debugging:Privacy Configuration
Built-in PII Sanitization
The SDK automatically detects and sanitizes common PII patterns:Custom PII Sanitizer
Implement your own PII sanitization logic:Data Processing
Custom Data Processors
Add custom logic to process telemetry data before export:Sampling Configuration
Fixed Sampling Rate
Environment-based Sampling
Performance Tuning
Batch Configuration
Memory Optimization
For high-throughput servers:Environment-Specific Configuration
Development Configuration
Production Configuration
Configuration Validation
The SDK validates configuration at startup and will log warnings for common issues:- Missing required parameters
- Invalid sampling rates (must be between 0.0 and 1.0)
- Incompatible exporter/configuration combinations
- Network connectivity issues