How to enrich LogRecord with traceid and spanid? (web) #4210
Unanswered
gitck-scch
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In our setup we use NgxLogger and provide a specific logger monitor (impementation of
INGXLoggerMonitor
) that forwards the log messages via otlp to a running opentelemetry collector instance.Currently, I'm struggeling with two things:
const currentSpan = trace.getSpan(context.active());
is undefined, even though the logger is triggered by interacting with the web page and instrumenation of user-interactions is configured correctlyregisterInstrumentations({ instrumentations: [ new DocumentLoadInstrumentation(), new UserInteractionInstrumentation(), ], });
I appreciate any hint pointing me in the right direction. I could only find one example that shows the basic use (see here
\opentelemetry-js\experimental\examples\logs\index.ts
). But this example does not cover how to get the current trace and span identifier and how to propagate them to the log record, for correlation of traces with log records.Beta Was this translation helpful? Give feedback.
All reactions