-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 traces to Datadog using OpenTelemetry from a AWS Lambda #11889
Comments
@dglozano did you come up with any solution? I've got some tracing data because Datadog is pulling from xray and I've got all the autoinstrumentation coming out of the Datadog Extension, but it's super frustrating that current state of otel on lambda is: traces: App -> ADOT Otel Layer -> XRay Backend -> Datadog via Polling I thought I might be able to use I thought I might be able to get around this by building my own lambda layer from the opentelemetry repo, but even that appears to be the stripped-down version without built-in Datadog support. |
@ianwremmel unfortunately not, I haven't come up with any solution yet 😞 There were some talks within my team about having our own OTEL Collector instance that we can send our lambdas traces/logs to, but nothing we have done yet. I will try to remember to update this issue if we come up with any working solution in the future 🙏 |
Acccording to this link OTLP is disabled by default on the agent, you need to enable it in the config file. |
Just tried this, it loaded the config file but the endpoint didn't work, like you said. |
I tried configuring it via the |
I have encountered the same problem. Regardless of the config, This change is introduced by #10068 for reducing the layer size. I'm considering using OpenTelemetry Collector with Datadog exporter distribution instead of Datadog serverless agent. However, currently we have no way to configure |
@maxday would it be possible to publish two Lambda Layer versions one with OTLP disabled and one with OTLP enabled (something like aws lambda get-layer-version-by-arn --arn arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:1
{
"Content": {
"Location": "https://awslambda-eu-west-1-layers.s3.eu-west-1.amazonaws.com/snapshots/901920570463/aws-otel-nodejs-arm64-ver-1-8-0-cc995c8b-3212-4fca-8188-397fa6a2a106?versionId=RDR5zYln3hllivIxXLoY8yMhjYQyHHbB&...",
"CodeSha256": "Lm8D/057SuTlHonEZCVvPlNUKlj8EF4QkB7iVmNQxQM=",
"CodeSize": 14208950
},
"LayerArn": "arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0",
"LayerVersionArn": "arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-8-0:1",
"Description": "",
"CreatedDate": "2022-12-20T20:23:16.666+0000",
"Version": 1
} that the ADOT layer is about 14.2 MB |
I'm pleased to announce that we have released v41 of the Datadog AWS Lambda Extension with OpenTelemetry support. You can enable the feature by setting either |
@purple4reina does this includes metrics, or only traces? |
Just tested it, it worked fine for both traces and metrics! 👍 |
@RangelReale Next to the question in the other issue, what is your flushing strategy for OTLP in your own lambda code? Are you force flushing anything, or just keeping the defaults? |
I thing this is an issue that is not settled yet, I had performance problems in a high-usage lambda, so for traces I've set a sampling of sending only 0.1% of traces (which makes it useless). I created an ENV var to be able to test this value per service, but this is still ongoing. The recommended flushing-per-request on my big lambda (~120 req/s), made its duration ~3x slower, so it is a no go. |
I'm struggling to get the datadog agent to export the OTEL traces on my lambda. @RangelReale how did you configure your lambda? Did you use the AWS ADOT collector with the datadog layers, or did you just configure the datadog layers? |
I gave up on sending traces from lambdas, I'm still only sending 1% of traces. We are moving to a model of sending traces and metrics from the lambda otel collector to the k8s otel collector that we already have, this seems to have better performance, se we will soon be testing enabling more traces. |
Ack, what a mess. Thanks @RangelReale! |
Is this still where things are today? Anyone have any luck pushing traces to the Extension via OTel? The Agent works fine but the extension, not so much. |
In case anyone is looking for this in the future. I have the DD Extension collecting OTel traces in a Lambda. I did this by setting the ENV VAR
From there, I made sure that I was flushing my traces correctly. I'm using Rust and Tokio and this worked great. My SAM template is referencing this layer
Hope this helps someone |
is anything stopping someone from sending protobuf trace data directly to datadog? aside from the fact it's a non public API & requires a bit of dark magic |
Have the same problem here, the Datadog Exporter, even with all the configuration from above, does not send the OTel traces, only Datadog Library collected traces which makes us vendor lock. Did you manage to solve this @johnkoehn ? Thanks! |
@benbpyle I have tried this but it doesn't send OTel traces, can you please share more info regarding how you flush the traces correctly? Thanks! |
I gave up sending traces in lambdas, I am sending only 1% of traces, having to sync each and every call makes it too slow. |
@ktruedat here is a working sample https://github.com/benbpyle/lambda-dotnet-datadog-sam. I also wrote a blog article on it https://binaryheap.com/rust-and-opentelemetry-with-lambda-datadog/ Hope this helps |
When using OpenTelemetry instrumentation SDK, there are two different ways to send data to Datadog, as described here.
Send traces to the OpenTelemetry collector, and use the Datadog exporter to forward them to Datadog, or
Ingest traces with the Datadog Agent, which collects them for Datadog.
These two alternatives probably work fine when running a "normal" application, but I have come to a dead end when trying to send OpenTelemetry data to Datadog from a AWS Lambda using .NET.
Is there any possible workaround? Could the datadog agent included in the lambda extension accept ingestion over OTLP?
I only managed to make it work using what would be the flow described at the bottom in this image, which is to use DD SDK instead... but I would prefer to use the OpenTelemetry SDK if possible.
The text was updated successfully, but these errors were encountered: