DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[question] How do I configure the tags, service name and plugins from within the lambda code?

agoldis opened this issue · comments

After following https://docs.datadoghq.com/serverless/installation/nodejs/?tab=containerimage
How do I configure the tags, service name and plugins from within the code?

I have been using tracer.init for that, but not sure what should be used with container lambda integration.

See https://docs.datadoghq.com/serverless/configuration?tab=others#connect-telemetry-using-tags. It's recommended to set tags using the environment variables.

But if you already know how to use tracer.init() to set those tags, i believe that should work too.

Thanks for your reply @tianchu.
Is there any way to do that from within the code?
tracer.init() is not working

Sorry, a better doc https://docs.datadoghq.com/tracing/trace_collection/library_config/nodejs/. Again, our recommendation for serverless applications is to use env vars. I believe you can configure all tracer options using env vars.

Also see https://docs.datadoghq.com/serverless/guide/handler_wrapper/ for tracer.init() example in serverless.

Closing the issue, since I don't expect anything to change in this code base. For additional questions, feel free to find us in our community slack channel https://github.com/DataDog/datadog-lambda-js#community.