Installation
Setup
Node.js Application
Set up OpenTelemetry for a Node.js application:Web Application
Set up OpenTelemetry for a browser application:Tracing
Effect automatically creates spans for your operations:Custom Spans
Create custom spans to track specific operations:Metrics
Collect and export metrics:Logging
Integrate Effect logging with OpenTelemetry:Resource Configuration
Configure resource attributes for better observability:Exporter Options
OTLP Exporter
Export to any OTLP-compatible backend (Jaeger, Grafana Tempo, etc.):Console Exporter
Useful for local development:Prometheus Exporter
Expose metrics in Prometheus format:API Modules
- NodeSdk: OpenTelemetry SDK for Node.js applications
- WebSdk: OpenTelemetry SDK for browser applications
- Tracer: Distributed tracing functionality
- Metrics: Metrics collection and export
- Logger: Logging integration
- Resource: Resource attribute configuration
Best Practices
- Service Naming: Use consistent service names across your application
- Span Attributes: Add meaningful attributes to spans for better observability
- Sampling: Configure sampling rates for high-traffic applications
- Error Tracking: Ensure errors are properly recorded in spans
- Metric Naming: Follow OpenTelemetry semantic conventions for metric names
