Skip to content
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

Authorizer traces not correlated with API gateway traces #252

Closed
arturenault opened this issue Apr 9, 2022 · 7 comments · Fixed by DataDog/datadog-lambda-js#300 or DataDog/datadog-lambda-python#256
Assignees
Labels
enhancement New feature or request

Comments

@arturenault
Copy link

Expected Behavior

If a lambda is gated behind an AWS API Gateway Authorizer, I'd expect the call to the authorizer to be part of the same trace as the overall API Gateway call and lambda execution.

Actual Behavior

The overarching trace that captures the full request trace goes through to the main lambda, but not to the authorizer lambda. That one has a separate trace.

Steps to Reproduce the Problem

  1. Create a lambda with a function gated by an API Gateway authorizer
  2. Cnfigure the datadog library and extension for both
  3. See the traces separately on the dashboard

Specifications

  • Serverless Framework version: 3.12.0 (upgraded to debug, was using 2.72.2 before)
  • Datadog Serverless Plugin version: 4.3.0 (upgraded to debug, was using 3.7.1 before)
  • Lambda function runtime (Python 3.7, Node 10, etc.): Node 14

Let me know if this isn't the right place for this issue - I'm using the plugin so I figured I'd start here.

@dls314
Copy link
Contributor

dls314 commented Apr 9, 2022

A 'request' typed authorizer has access to the request headers while a token authorizer doesn't have the header data, so you might get something workable with the other authenticator type.

Even there, I'd expect that the layer may not automatically extract the trace context

@astuyve
Copy link
Contributor

astuyve commented Apr 13, 2022

Hi @arturenault - this is true. Right now, we do not propagate trace context through authorizer functions. I will forward this on to the Product team and leave it open as a feature request.

Thanks!

@astuyve astuyve added the enhancement New feature or request label Apr 13, 2022
@tianchu
Copy link
Contributor

tianchu commented Jul 29, 2022

Just a quick update, @astuyve already have a RFC, will likely make some progress later this quarter. But it's non-trivial, so it will take some time.

@arturenault
Copy link
Author

Thank you - for others hitting this, I was able to get correlated traces by switching to Request authorizers. But would be nice to get it in all kinds of authorizers.

@dls314
Copy link
Contributor

dls314 commented Nov 15, 2022

Will this work for TOKEN and REQUEST typed authorizers?

@astuyve
Copy link
Contributor

astuyve commented Nov 15, 2022

Yes!

@ranayash45
Copy link

@joeyzhao2018 Can you please also done this improvement for Go Lang??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants