DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node
Apache License 2.0
113 stars 35 forks source link

Usage with Lambda@Edge #102

Closed dtothefp closed 4 years ago

dtothefp commented 4 years ago

Expected Behavior

Aggregate logs from multiple regions into DataDog from Lambda@Edge

Actual Behavior

Not sure...not seeing logs. We setup Forwarders in multiple regions but are unsure how / if to use this package in combination with that.

https://github.com/DataDog/datadog-serverless-functions/issues/359

Steps to Reproduce the Problem

For our non Lambda@Edge Lambdas I use the Serverless Plugin Datadog in combination with this datadog-lambda-js library and we see consistent logs / traces in DataDog

Screen Shot 2020-09-25 at 12 43 18 PM

When using Lambda@Edge Cloudwatch logs occur in the AWS region where the request is routed to. We have setup forwarders in multiple regions but still are seeing no logs. I tried wrapping my handler in the datadog function and tried variations both with:

process.env.DD_FLUSH_TO_LOG = 'false';

and

process.env.DD_FLUSH_TO_LOG = 'true';
process.env.DD_SITE = 'datadoghq.com';
process.env.DD_API_KEY = dataDogApiKey

Specifications

tianchu commented 4 years ago

Thanks for your feedback @dtothefp!

I responded on the linked issue for Forwarder, but basically due to the complex limits and restrictions on Lambda@Edge functions, the Datadog Lambda library does not yet really work for lambda@edge.

Do you mind submitting an official feature request to support@datadoghq.com instead? I'm going to close this issue for now, since there is no immediate actions we can take here.

chandywerks commented 3 years ago

Is this still true? The documentation here implies that Lambda@Edge is supported.

https://docs.datadoghq.com/serverless/serverless_integrations/#lambdaedge

tianchu commented 3 years ago

@chandywerks nothing really changed since then. Those tags mentioned in the doc are automatically enriched my our AWS integration, and it doesn't depend on our Lambda library.

w3nda commented 1 year ago

@tianchu any update here?

dr-bizz commented 1 year ago

Any update here?

JanGanaCode commented 1 year ago

any update here? 🙂

edtep-relayfi commented 1 year ago

@tianchu any update here?

artem-pdus commented 9 months ago

any update here?

chandywerks commented 9 months ago

Try this, https://github.com/chandywerks/terraform-datadog-cloudwatch