1
votes

I am using @google-cloud/trace-agent library for nodejs for tracing. Once I start my tracer. I am able to see the traces in stackdriver console. Now I want to get the current traceId and spanId so that I can log it and map to my tracing data.

I am unable to find the api that provides the current trace context.

1
When using getResponseTraceContext you should be able to view traceid and spaniddany L

1 Answers

1
votes

I was able to achieve this using getCurrentContextId() method.