Overview
ExuluOtel provides built-in OpenTelemetry (OTEL) support for distributed tracing and logging across your Exulu application. It automatically instruments your application to collect traces and logs, helping you monitor performance, debug issues, and understand system behavior in production.
Key features
Distributed tracing
Track requests across services and components
Structured logging
Correlate logs with traces for better debugging
Auto-instrumentation
Automatic instrumentation of Node.js modules
SigNoz integration
Built-in support for SigNoz (cloud and self-hosted)
Component control
Enable/disable telemetry per component
Graceful shutdown
Ensures traces are flushed before exit
What is OpenTelemetry?
OpenTelemetry (OTEL) is an open-source observability framework for collecting traces, metrics, and logs from your applications. It helps you:- Monitor performance: Identify slow operations and bottlenecks
- Debug issues: Trace requests through your entire system
- Understand behavior: See how components interact
- Optimize resources: Find inefficient code paths
- Alert on problems: Set up monitoring and alerting
Quick start
Prerequisites
ExuluOtel currently supports SigNoz as the observability backend. You can use:- SigNoz Cloud (hosted solution)
- Self-hosted SigNoz (open-source)
Environment variables
Set up your SigNoz credentials:- Get your ingestion URL and token from your SigNoz dashboard
- Format:
https://ingest.{region}.signoz.cloud:443 - Regions:
us,in,eu
Initialize OpenTelemetry
Enable in ExuluApp
Enable telemetry in your application configuration:Configuration
Global telemetry
Enable or disable telemetry globally:- Express server routes are traced
- MCP operations are traced
- Logs are correlated with traces
Component-level telemetry
Enable telemetry for specific components:- Workers: BullMQ job processing traces
- Express server: HTTP request/response traces
- MCP server: Model Context Protocol operation traces
Environment-specific configuration
Different settings for dev/staging/prod:What gets traced?
Automatic instrumentation
ExuluOtel uses OpenTelemetry auto-instrumentation to automatically trace:HTTP requests/responses
HTTP requests/responses
- Express.js routes
- Outgoing HTTP/HTTPS requests
- Response status codes and timing
- Headers and query parameters
Database operations
Database operations
- PostgreSQL queries
- Connection pool usage
- Query timing and errors
Redis operations
Redis operations
- BullMQ queue operations
- Redis commands
- Connection management
File system operations
File system operations
- File reads/writes
- Directory operations
- S3 storage interactions
LLM API calls
LLM API calls
- OpenAI API requests
- Anthropic API requests
- Other provider API calls
- Token usage and latency
Custom traces
Components automatically create custom traces for:- Agent operations:
generateSync(),generateStream() - Context operations:
search(),createItem(),updateItem() - Tool executions: Function tool calls
- Worker jobs: Background job processing
- Embeddings generation: Batch and single embeddings
Viewing traces in SigNoz
After enabling telemetry, visit your SigNoz dashboard to view traces.Trace structure
Key metrics
- Duration: How long each operation took
- Status: Success, error, or timeout
- Attributes: Operation-specific metadata
- Events: Important moments in the trace
- Logs: Structured logs correlated with spans
Configuration examples
Production setup
Development setup
Selective component tracing
Integration with logging
ExuluOtel automatically correlates structured logs with traces:Performance considerations
Overhead
OpenTelemetry adds minimal overhead:- CPU: ~1-2% increase
- Memory: ~10-20MB for SDK
- Network: Batched export reduces impact
Sampling
For high-traffic applications, consider sampling:Batch export
Traces and logs are exported in batches to minimize network overhead:- Traces: Batched every 5 seconds or 512 spans
- Logs: Batched every 1 second or 512 records
Troubleshooting
Traces not appearing in SigNoz
Check environment variables
Check environment variables
Ensure all required variables are set:Verify URLs are correct:
- SigNoz Cloud:
https://ingest.{region}.signoz.cloud:443 - Self-hosted:
http://localhost:4318(or your host)
Verify telemetry is enabled
Verify telemetry is enabled
Check your configuration:
Check network connectivity
Check network connectivity
Test connection to SigNoz:
Review logs
Review logs
Check for OTEL initialization:Look for errors:
High cardinality warnings
If you see high cardinality warnings in SigNoz:- Avoid using user IDs or request IDs as span names
- Use attributes instead of span names for variable data
- Limit the number of unique span names
Memory issues
If experiencing memory pressure:- Reduce batch sizes (requires custom configuration)
- Enable selective component tracing
- Consider sampling for high-traffic routes
Graceful shutdown
ExuluOtel handles graceful shutdown automatically:- In-flight traces are flushed
- Connections are closed properly
- No data is lost on shutdown
Best practices
Use in production: OpenTelemetry is production-ready and adds minimal overhead. Enable it to gain visibility into your application.
Correlate logs: Enable OTEL-aware logging to correlate logs with traces for better debugging.
SigNoz setup
SigNoz Cloud
- Sign up at signoz.io
- Create a new project
- Copy ingestion details from Settings → Ingestion Settings
- Set environment variables with your credentials
Self-hosted SigNoz
- Install SigNoz using Docker:
-
Access SigNoz at
http://localhost:3301 - Configure environment variables:
Future enhancements
Planned features for ExuluOtel:- Support for additional OTEL backends (Jaeger, Zipkin, etc.)
- Custom sampling strategies
- Metrics collection (in addition to traces and logs)
- Advanced span filtering
- Custom instrumentation helpers
Example traces
Agent generation trace
Context search trace
Worker job trace
API reference
ExuluOtel.create()
Factory method to create and configure OpenTelemetry SDK.URL for trace export (OTLP/HTTP endpoint)
URL for log export (OTLP/HTTP endpoint)
SigNoz access token for authentication
NodeSDK - OpenTelemetry Node SDK instance
Example: