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
Codeguru Profiler Fails with Custom Java Runtime? #20
Comments
Hi @brcolow! Thanks for reaching out! Can you please confirm a few settings in your lambda function?
Thanks! |
@pandpara Thanks for the response. Here are the requested environment variables: AWS_EXECUTION_ENV: null The first one looks like it could be the culprit. What should I set it to in my custom java runtime so that codeguru knows it's on AWS Lambda? |
Hi @brcolow ! AWS_EXECUTION_ENV is a reserved env variable[1], you cannot set it. Yes, and we do depend on value of this environment variable to decide whether you are using the correct compute platform(Lambda in your case) |
@pandpara Okay. So is there anyway to use codeguru profiler with a custom (java) runtime? |
I see that it is being set by the default AWS Java runtime: https://github.com/aws/aws-lambda-java-libs/blob/311f97cc47b414633c62ee96d9df3e8404e14d69/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/util/EnvWriter.java Why can I not set it in my custom runtime? I understand it is reserved for Lambda's that run on the default runtimes, but it shouldn't be reserved for custom runtimes? Or perhaps there would be a better way for codeguru profiler to check if it's on Lambda but a custom runtime? |
You can try to set it actually! |
This makes things like Codeguru Profiler work, see: aws-samples/aws-codeguru-profiler-demo-application#20
So I now have my Lambda reporting the following: AWS_EXECUTION_ENV: AWS_Lambda_java11 But I am still getting the same error: INFO: CodeGuru Profiler agent was found to be running on a compute platform other than AWS Lambda. Profiling will be terminated. Please refer to CodeGuru Profiler's documentation to learn more about how to profile AWS Lambda functions Are you sure that is how codeguru profiler determines it is on AWS Lambda? |
This makes things like Codeguru Profiler work, see: aws-samples/aws-codeguru-profiler-demo-application#20
This makes things like Codeguru Profiler work, see: aws-samples/aws-codeguru-profiler-demo-application#20
@pandpara Any ideas? |
Hmmm..looking at the decompiled source code more closely I wonder if it is because |
Yep. That was it. So to summarize - in order to use codeguru profiler agent on a Java custom runtime the following three conditions must be met: 1.) Thanks for your help. |
Although codeguru profiler does now run and I have run the Lambda many times (in 5 minute intervals as according to docs) it still says setup required - I wonder if this is because of the custom runtime aspect? |
Hi @brcolow Can you provide the profiling group name? I can check if we have gotten the profile or not. |
You want the profiling group ARN? Not sure what "name" you are referring to? Thank you. |
Yes, profiling group ARN would suffice. It has profiling group name in it. |
Thank you! |
@pandpara Did you have any time to look at this? |
@pandpara Ping :) |
Hi @brcolow I don't see any profile submitted yet. Do you see from the logs that a profile has been submitted successfully? |
@pandpara Do you know if running on a custom runtime is supported? Maybe we should start there? |
Hi, sorry for the late traction on this. Our documentation does not state that we support custom runtimes and I'm not aware of any testing for it. Thanks for all your findings, this is helpful for us. Either if not working, profiler should log if it report or not. Could you please enable more logs and let us know what the agent prints? Maybe something like this. To enable the logs, enable the TRACE for |
Closing due to inactivity and due to the fact that our documentation doesn't specify yet anything about custom runtime. If interested again, please open a new issue, and sorry for the late traction on this. Thank you. |
I am getting the following sequence of log messages when attempting to run CodeGuru on my custom java runtime which can be found here: https://github.com/brcolow/lambda-java-runtime
It is running on AWS Lambda and I have the two environment variables properly set, and the permissions set to the same thing as the lambda's execution role.
I am invoking the profiler as follows:
I have found the error in the source code, but I have no idea what
FleetInfo
is or how it is set:I wonder if maybe it is because of the
AWS_EXECUTION_ENV
variable being different on a custom runtime (i.e.provided
versusjava11
- though not sure why codeguru-profiler-java-agent is checking that).Thank you.
The text was updated successfully, but these errors were encountered: