feat: complete OpenTelemetry distributed tracing integration#84
Merged
memplethee-lab merged 1 commit intoJun 24, 2026
Conversation
…XL#75) - Add Jaeger exporter alongside OTLP with env-based configuration - Add W3CTraceContextPropagator for trace context propagation across services - Add TracingInterceptor that wraps every HTTP handler in a named span with request metadata, handler class/method, upstream context extraction - Instrument WebSocket gateway (connect/disconnect) with tracing spans - Register TracingInterceptor globally via APP_INTERCEPTOR in ObservabilityModule - Export extractContext/injectContext helpers for service-boundary propagation - Auto-instrumentations cover DB queries and external HTTP/AI provider calls Closes SourceXXL#75
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the OpenTelemetry distributed tracing implementation across all services as specified in issue #75.
Implementation Details
src/config/tracing.tsJAEGER_AGENT_HOSTorJAEGER_ENDPOINTenv vars — falls back to OTLP-native Jaeger 1.41+)W3CTraceContextPropagatorso trace context propagates correctly across service boundaries viatraceparent/tracestateHTTP headersextractContextandinjectContexthelpers for explicit context propagation at service boundariesspanProcessorwithspanProcessorsarray to support multiple exportersshutdownTracingagainst being called before SDK is startedsrc/observability/tracing.interceptor.ts(new)TracingInterceptor— NestJS interceptor that wraps every HTTP handler in a named OTel spanhttp.method,http.url,http.route,handler.class,handler.method, andhttp.status_codeERRORspan status on failuressrc/observability/observability.module.tsTracingInterceptorglobally viaAPP_INTERCEPTORso 100% of HTTP endpoints are tracedsrc/dashboard/websocket/dashboard.gateway.tsconnectanddisconnectevents with client ID, namespace, and trace context attributesAuto-instrumentation coverage (via
@opentelemetry/auto-instrumentations-node)x-request-id,x-correlation-id) captured in span attributesValidation Results
npm run build— compiled successfully (webpack)npm test— pre-existingRangeError: Maximum call stack size exceededin@nestjs/coreinjector; not introduced by this change (confirmed identical failure on upstreammainbefore changes)Closes #75