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

APM for AWS Lambda? #318

Open
paul-uz opened this issue Sep 25, 2024 · 6 comments
Open

APM for AWS Lambda? #318

paul-uz opened this issue Sep 25, 2024 · 6 comments

Comments

@paul-uz
Copy link

paul-uz commented Sep 25, 2024

Looking at the docs, to use APM, an agent is required, which is not possible when using AWS Lambda.

We have Xray tracing, but at a cost. If we want to use Raygun APM, we can't from the looks of it.

Does this package provide any APM functionality?

Any way APM can be implemented for Lambda?

@sumitramanga
Copy link
Collaborator

Hi @paul-uz

Thank you for your request!

I've passed this over to our rostered support team for consideration and investigation.

They'll let you know of their findings.

Cheers,
Sumitra

@PanosNB
Copy link

PanosNB commented Sep 25, 2024

Hello Paul,

It is theoretically feasible but we have not tried it ourselves nor do we have ready-made aws-lambda docker images.

First off, that would only work for C#, Ruby and Node.js, the three languages we support APM.

Next, if you need this for Node.js or Ruby, you can put the agent on a separate virtualized OS because for these two, you can modify the APM agent's url and port that the profiler sends data to. If it is C# though, the APM Agent needs to be in the same OS as the profiled application.

So, if C#, you will need to set up a docker container image that is compatible with AWS lambda, and install both the APM agent and your C# application on it.

If Ruby or Node.js, you can set up the agent on an AWS lambda or an EC2 instance, create a VPC that they can see each other, and add your Node/Ruby apps with the Raygun profiler on their own lambda.

I have fiddled around with all these, so do reach out if you decide to undertake this project and I'll help you out as well! Also, if you do get this running, it might be a good opportunity for us to do a joint tech write-up!

Let me know what you think

Dr. Panos Patros, CPEng
VPEng at Raygun

@paul-uz
Copy link
Author

paul-uz commented Sep 26, 2024

Thanks for the reply @PanosNB !

In my case, I am only concerned with AWS Lambda. I'm curious to understand how the agent would run on AWS Lambda? Would it be a custom runtime?

@PanosNB
Copy link

PanosNB commented Oct 13, 2024

Hi Paul,

No, it doesn't need a custom runtime. Just one that we already support (i.e., Ruby, .NET or Node.js). If you are thinking about writing code in the AWS lambda field directly, that won't work though. You'd need to set up an image with your function (that includes all of the above) and load that into what the AWS Lambda would execute.

Not sure if this answers your question. happy to have video call and discuss your use case though?

Dr. Panos Patros, CPEng
VPEng at Raygun

@paul-uz
Copy link
Author

paul-uz commented Oct 14, 2024

Hi Paul,

No, it doesn't need a custom runtime. Just one that we already support (i.e., Ruby, .NET or Node.js). If you are thinking about writing code in the AWS lambda field directly, that won't work though. You'd need to set up an image with your function (that includes all of the above) and load that into what the AWS Lambda would execute.

Not sure if this answers your question. happy to have video call and discuss your use case though?

Dr. Panos Patros, CPEng
VPEng at Raygun

Ah yes, so a Lambda Layer with a modified NodeJS image that has the APM agent on it?

@PanosNB
Copy link

PanosNB commented Oct 14, 2024

Yes, you can do that. You must have the profiler in that image. The agent would also be ok to have but, for Node.JS APM, you could put the agent elsewhere so you don't spin up an agent every time the lambda scales out. To go for the second option, you'd need to set the IP that the profiler sends the packets to not be localhost, rather where you're hosting the agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

No branches or pull requests

3 participants