-
Notifications
You must be signed in to change notification settings - Fork 2
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
Sending data to another collector #58
Comments
Hey @bhaskarbanerjee Do you see any debug logs from the sdk you should see a lot with the OTEL_LOG_LEVEL set to "debug" just fyi the log level needs to be all lower case. You can find the code for the tracer here https://github.com/baselime/node-opentelemetry/blob/main/src/baselime.ts |
Thanks @Ankcorn Here are the logs. @opentelemetry/api: Registered a global for diag v1.7.0. |
It doesn't look like you are creating any spans. I'd recommend installing our node-opentelemetry package and using the withOpentelemetry middleware for lambda from it to trace your lambda function |
I am trying a simple hello world app. Do I need to explicitly create spans? `'use strict'; exports.handler = async (event) => { console.log("Hello World") |
Doesn't the layer work out of the box i.e. adding the layer and setting ENV VARs? Or is a code change in the lambda MUST to invoke/utilize this layer? |
You need to change the code. Would look something like this const { withOpentelemetry } = require('@baselime/node-opentelemetry/lambda');
exports.handler = withOpentelemetry((event) => {
return {
statusCode: 200,
body: JSON.stringify('Hello from Lambda!!'),
};
}); If you are using the tag system and are signed up to baselime you can do it without code changes but otherwise you need to import the middleware |
packed @baselime/node-opentelemetry in the node_modules |
@Ankcorn slight change to the code but now a different error `const { baselime } = require('@baselime/node-opentelemetry'); exports.handler = baselime.withOpentelemetry((event) => { { Any suggestions? |
Question -
I am trying to use this opensource and send data to another collector.
I am assuming that does not require the prerequisite of connecting my aws account with Baselime.
I have built the layer using scripts/publish.sh and created a layer out of that.
I have attached the layer to my lambda and am setting up the following ENV vars
AWS_LAMBDA_EXEC_WRAPPER /opt/baselime
BASELIME_ACTUAL_HANDLER app.handler
BASELIME_API_KEY 0123456789 (a ficticious key)
COLLECTOR_URL my_collector_url:port
OTEL_LOG_LEVEL DEBUG
My lamnbda's logs show no errors but the collectior doesn't receive any data either. Additionally, I do not see any console out from this layer. Seeking your suggestions on how to proceed with this.
My lambda handler is also set to app.handler.
The text was updated successfully, but these errors were encountered: