Setting up CodeGuru Profiler - Amazon CodeGuru Profiler

Setting up CodeGuru Profiler

An Amazon CodeGuru Profiler profiling group is a group of applications for which data is meant to be aggregated and analyzed together. To create a profiling group, sign in to the AWS Management Console and set permissions for the CodeGuru Profiler profiling agent.

The profiling agent collects runtime data from your applications. Data that the agent collects is analyzed to provide flame graphs and hourly reports with recommendations for how you can optimize your applications.

You can create a profiling group using your own application or the demo application. For more information about using the demo application, see Getting started with CodeGuru Profiler.

Before you can start using CodeGuru Profiler, you must complete the following steps.

Step 1: Sign up for AWS

When you sign up for Amazon Web Services (AWS), your AWS account is automatically signed up for all services in AWS, including CodeGuru Profiler. You're charged only for the services that you use.

If you have an AWS account already, skip to the next task. If you don't have an AWS account, use the following procedure to create one.

To create an AWS account

  1. Open https://portal.aws.amazon.com/billing/signup.

  2. Follow the online instructions.

    Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad.

Step 2: Create a CodeGuru Profiler profiling group

A profiling group can profile one or more applications. Data is aggregated and displayed based on the whole profiling group.

For example, if you have a collection of microservices that handle restaurant recommendations, you can collect profile data and identify performance issues across all these microservices in a single profiling group named "Restaurant-Recommendations".

To create a profiling group

  1. Sign in to the AWS Management Console, and then open the CodeGuru Profiler console at https://console.aws.amazon.com/codeguru.

  2. In the navigation pane on the left, choose Profiler, and then choose Profiling groups.

  3. On the Profiling groups page, choose Create profiling group.

  4. Provide a Name for the new profiling group. Choose the compute platform that your applications are running on. If your applications run on AWS Lambda, choose the AWS Lambda option. Choose Other if your applications run on a compute platform other than AWS Lambda, such as Amazon EC2, on-premises servers, or a different platform.

  5. Choose Create profiling group.

Step 3: Set permissions

The CodeGuru Profiler profiling agent needs permissions to write data to the profiling group.

To set permissions for the new CodeGuru Profiler agent:

  1. Start by choosing Give access to users and roles. Choose the IAM users or roles that can submit profiling data and configure the agent.

  2. If your applications run on AWS Lambda, choose the role that your AWS Lambda function uses.

  3. After you grant permissions for a user or role, you don't need to attach IAM policies for agent permissions.

    
            Image: Manage user and role permissions to submit profiling data.

    Use IAM:ListUsers and IAM:ListRoles permissions to see your users and roles. Otherwise, you can add a user or Amazon Resource Name (ARN) role. You'll see the following message.

    
            Image: Error message on the manage permissions section. Cannot list users and
              roles.

    Alternatively, you can add a policy like the following to the role that your application uses. For more information about roles, see Modifying a role.

    { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codeguru-profiler:ConfigureAgent", "codeguru-profiler:PostAgentProfile" ], "Resource": "arn:aws:codeguru-profiler:<region>:<accountID>:profilingGroup/<profilingGroupName>" } ] }

If your application is running in a Region that CodeGuru Profiler doesn't support and if you have the appropriate permissions, you can submit profiling data to one of the supported Regions. For more information about using CodeGuru Profiler in a Region it doesn't support, see Working with unsupported Regions.

Step 4: Start CodeGuru Profiler in your application

Run your application with the profiling agent

Run your application with the CodeGuru Profiler profiling agent. You can either start the agent as a Java virtual machine (JVM) agent, or start it manually with a code change in your application. To start profiling your application, see Integrating with Amazon CodeGuru Profiler.