-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get tracer in aws auto instrumented lambda #106
Comments
tracing
in aws lambda, Distributed tracingtracing
in aws lambda, Distributed tracing constraints ???
I am asking the above question because in the first experimentation with opentelemetry/api in combination with Lambda and Layer extesion installed, i get the following results: (with this result i am out of ideas or sources to read in order to continue ... by first creating spans and adding to current active context) So, In method invocation of Lambda
After reading the tests of the opentelemetryAPI , i understand that Also by logging the event object in method Lambda invocation i get The question is how do get a Tracer from Tracer Provider in order to create spans and add spans to an active context ? |
Hi @niko-achilles - we store the lambda span into the current context here Without it other instrumentation would not connect to the trace. So your code snippet seems like it's supposed to work. Are you able to create a small repro? |
Hi @anuraaga , thanks for the link, nice to learn from this. So, Notice in this line that i get a and here the Can you help on how to get a tracer in order to create Spans and how to get the active context ? |
Thanks for the repro @niko-achilles. Just wondering, do you see the behavior on all requests, not just the first? Here's where we set a "real" tracer Due to the design of open-telemetry/opentelemetry-js#1484 Will ping it |
hi @anuraaga i modified the code to add timer execution, in order to https://github.com/niko-achilles/lambda-otel-spans/blob/main/functions/hello.js#L23 Additionally i invoked the function under oberservabilty 50 times via a script in order to be able to answer your question about Yes the behavior is the same . /* -- Tracer instance Log -- and created spans as |
update i also added a waiting behavior before getting a tracer , but i get the same results: and created spans as undefined |
@anuraaga with interacting with openetelemetry-js community contrib. i managed to get information for a workaround , in order to create custome span names. I unistalled "@opentelemetry/api": "^1.0.0" and installed "@opentelemetry/api": "^1.0.0-rc.0". Then i get a NodeTraceProvider and with openetelemetry api i can set/get Spans . |
tracing
in aws lambda, Distributed tracing constraints ???
Is your feature request related to a problem? Please describe.
Is there a way to use the tracing api (@opentelemetry/api ) in aws lambda in order to interact in my Lambda app with the extension Layer of OpenTelemetry, which is intalled as extension to my Lambda app ?
Describe the solution you'd like
Assumption: given the Extension Layer of OpenTelemetry for lambda does automatic instrumentation, as read the code by registering instrumentation and providing a tracerProvider: https://github.com/open-telemetry/opentelemetry-lambda/blob/c58c998138f355b1faa5fa071a645ca37895ccb3/nodejs/packages/layer/src/wrapper.ts
On top of the instrumentation that the Layer extension provides for my application in aws Lambda, without modifying my code,
i would like to use the @opentelemetry/api to get a tracer in order to create custom
Spans
, add Spans to an activecontext
.The same way as described in the specs: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#context-interaction and in the opentelemetry/api repo .
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: