AppDynamics Knowledge Base

Monitoring AWS Lambda Cloudwatch metrics with AppDynamics' Custom Namespace Extension

Monitoring AWS Lambda Cloudwatch metrics with AppDynamics' Custom Namespace Extension

Abhi_Bajaj1_0-1747169794841.png

AWS Lambda auto-scales, but every account & region has a concurrency ceiling. When you slam into it CloudWatch emits the Throttles metric. Surfacing that (plus Invocations, Errors, Duration…) in AppDynamics lets you keep all observability in one place and build health rules so you can react before customers feel pain.

Pre-requisite

  1. AppDynamics Controller
  2. Machine Agent
  3. EC2 instance profile (IAM role with cloudwatch:ListMetrics and cloudwatch:GetMetricStatistics only) or AWS AccessKey and Secret
  4. Java 8 + Maven for building the extension

High‑level flow

Abhi_Bajaj1_1-1747169794113.png

 

Install the Machine Agent (recap)

wget https://download.appdynamics.com/.../MachineAgent-25.x.x.zip
unzip MachineAgent-25.x.x.zip -d /opt/appdynamics
# 2 Point to your Controller
vim /opt/appdynamics/conf/controller-info.xml
# <controller-host>my-controller.company.com</controller-host>
# <controller-port>443</controller-port>
# <account-name>customer1</account-name>
# <account-access-key>abcd123…</account-access-key>
# 3 (optional) register as a service
sudo systemctl enable appdynamics-machine-agent
sudo systemctl start appdynamics-machine-agent

Steps are noted here: https://docs.appdynamics.com/appd/24.x/25.4/en/infrastructure-visibility/machine-agent/install-the-m...

Build the Custom Namespace extension

Extension we are using: https://developer.cisco.com/codeexchange/github/repo/Appdynamics/aws-customnamespace-monitoring-exte...

git clone https://github.com/Appdynamics/aws-customnamespace-monitoring-extension.git
cd aws-customnamespace-monitoring-extension
mvn clean package

cp target/AWSCustomNamespaceMonitor-*.zip \
/opt/appdynamics/monitors/
cd /opt/appdynamics/monitors
unzip AWSCustomNamespaceMonitor-*.zip

This creates AWSCustomNamespaceMonitor/ with configuration files you need

Abhi_Bajaj1_2-1747169794075.png

Authoring config.yml

metricPrefix: "Custom Metrics|AWS Lambda|"

namespace: "AWS/Lambda"

accounts:
- displayAccountName: "prod"
regions: ["us-east-2"] # your Lambda region
# keys can stay empty on an EC2 instance profile
# awsAccessKey:
# awsSecretKey:

# optional – pulls every function; give explicit names to narrow it
dimensions:
- name: "FunctionName"
displayName: "Function"
values: [".*"] # Display all Lambda functions


regionEndPoints:
#us-east-1 : monitoring.us-east-1.amazonaws.com
us-east-2 : monitoring.us-east-2.amazonaws.com

cloudWatchMonitoring: "Basic"

concurrencyConfig:
noOfAccountThreads: 3
noOfRegionThreadsPerAccount: 3
noOfMetricThreadsPerRegion: 3
threadTimeOut: 30

# Global metrics config for all accounts
metricsConfig:

# By default, all metrics retrieved from cloudwatch are 'Average' values.
# This option allows you to override the metric type.
# metricName supports regex
# Allowed statTypes are: ave, max, min, sum, samplecount
#
# Note: Irrespective of the metric type, value will still be reported as
# Observed value to the Controller
includeMetrics:
- name: "Invocations"
statType: "sum"
delta: false
multiplier: 1
aggregationType: "OBSERVATION"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"
- name: "Errors"
# alias: "Errors"
statType: "sum"
delta: false
multiplier: 1
aggregationType: "OBSERVATION"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"
- name: "Duration"
# alias: "Duration"
statType: "ave"
delta: false
multiplier: 1
aggregationType: "OBSERVATION"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"
- name: "Throttles"
# alias: "Throttles"
statType: "sum"
delta: false
multiplier: 1
aggregationType: "OBSERVATION"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"
- name: "DeadLetterErrors"
# alias: "DeadLetterErrors"
statType: "ave"
delta: false
multiplier: 1
aggregationType: "OBSERVATION"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"
- name: "Availability"
# alias: "Availability"
statType: "ave"
delta: false
multiplier: 1
aggregationType: "OBSERVATION"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"
- name: "IteratorAge"
# alias: "IteratorAge"
statType: "max"
delta: false
multiplier: 1
aggregationType: "OBSERVATION"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"

metricsTimeRange:
startTimeInMinsBeforeNow: 5
endTimeInMinsBeforeNow: 0

# Rate limit ( per second ) for GetMetricStatistics, default value is 400. https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_limits.html
getMetricStatisticsRateLimit: 400

maxErrorRetrySize: 0

All the metrics that you can configure are listed here:

Types of metrics for Lambda functions
Learn about the different types of metrics for Lambda: invocation metrics, performance metrics, concurrency metrics…docs.aws.amazon.com

Restart & verify

sudo systemctl restart appdynamics-machine-agent 
tail -f /opt/appdynamics/logs/machine-agent.log | grep -i "AWS/Lambda"

DEBUG AMonitorJob-AWSCustomNamespaceMonitor - Printing Metric [OBSERVATION/AVERAGE/INDIVIDUAL] [Custom Metrics|AWS Lambda|AWS/Lambda|prod|us-east-2|Function|appdshield-deploy-agent|Invocations]=[1]]

Abhi_Bajaj1_3-1747169794426.png

 

With ~10 minutes you can bring Lambda’s key CloudWatch metrics into AppDynamics, build proactive health rules, and keep your SRE team on a single pane of glass. Extend the same approach to other AWS namespaces or use AppDynamics’ Lambda‑specific extension if you want the full metric set out‑of‑the‑box.

Happy monitoring!

Version history
Last update:
‎05-13-2025 02:55 PM
Updated by:
Contributors