File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
apps/api/src/core/providers Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 11import { LoggerService as LoggerServiceOriginal } from "@akashnetwork/logging" ;
22import { HttpLoggerIntercepter } from "@akashnetwork/logging/hono" ;
3- import { context , trace } from "@opentelemetry/api " ;
3+ import { collectOtel } from "@akashnetwork/logging/otel " ;
44import { container , injectable } from "tsyringe" ;
55
66// Set up OpenTelemetry mixin for all LoggerService instances
77// This collects trace information and adds it to log entries
8- LoggerServiceOriginal . mixin = ( ) => {
9- const currentSpan = trace . getSpan ( context . active ( ) ) ;
10- return { ...currentSpan ?. spanContext ( ) } ;
11- } ;
8+ LoggerServiceOriginal . mixin = collectOtel ;
129
1310container . register ( HttpLoggerIntercepter , { useValue : new HttpLoggerIntercepter ( LoggerServiceOriginal . forContext ( "HTTP" ) ) } ) ;
1411
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { LoggerService } from "./services/logger/logger.service";
77 * Collects OpenTelemetry span context for logging
88 * This mixin adds trace information to log entries
99 */
10- function collectOtel ( ) {
10+ export function collectOtel ( ) {
1111 const currentSpan = trace . getSpan ( context . active ( ) ) ;
1212 return { ...currentSpan ?. spanContext ( ) } ;
1313}
You can’t perform that action at this time.
0 commit comments