Serverless computing has taken off in recent years with more efficient cloud services. AWS Lambda is a great example of this, where provisioning and management of resources happens from the service’s end. You only have to deal with the code. This article will give a brief overview of AWS Lambda in contrast to EC2 instances, then walk through shipping AWS Lambda metrics to

The idea with this kind of service is to provide a lean option for developers who are without the need of a robust virtual infrastructure.

AWS Lambda is Amazon’s event-based computing service for running code without having to manage servers. Users apply Lambda to things APIs, S3 buckets, and DynamoDB tables. Consequently, it produces telemetry the same as EC2 instances, producing logs and metrics via CloudWatch.

Code in Lambda is called a function. Lambda functions can be in Python, node.js, Ruby, Java, GoLang and .NET (and several versions of each as well). This means that Lambda’s main limitation is to apps that use the aforementioned languages.


AWS EC2 vs. Lambda

On availability, Lambda is far more convenient. Lambda is meant to be efficient, being a tradeoff relative to EC2 instances in that you can’t log into individual instances. EC2s require management and provisioning. AWS charges according to compute time and won’t charge its customers when the code isn’t running. The AWS Lambda service offers virtual machines, load balancing, and scaling without customers having to get their hands dirty.

It wouldn’t be fair to say EC2 operates on-demand while Lambda doesn’t. EC2 instances are always running, while events switch Lambda on and off. In addition, there are a number of use cases that contrast the two tools.

EC2 instances are mainly for hosting, high performance computing, and disaster recovery. However, Lambda can automate tasks and deal with a few real-time tasks (log analysis, filtering, and transforming data). Actions from a few sources trigger Lambda—S3 buckets, API Gateway, Alexa devices or AWS IOT, DynamoDB, and SNS.

While EC2 has snapshotting available, it’s more complex than Lambda’s. Lambda keeps records of versions of its functions and even lets you organize them by category.

Ship AWS Lambda Metrics to uses its Docker Metrics Collector, a container running metricbeat alongside your modules at runtime.

Set Up an IAM User

Retrieve your IAM user or make a new one. Create (if you haven’t already) an Access Key ID and Secret Access Key. Subsequrntly, make sure the IAM user you have or you are creating has the following seven permissions:


Select Your Metrics Region

Amazon has many regions available, each centering in specific countries or cities. Some have more than one option. US East has two choices in either northern Virginia or Ohio; Asia Pacific northeast out of Tokyo; etc.

Each will have its own slug, like us-east-1, us-east-2, ap-northeast-1, etc. Find and copy the relevant slug to your text editor.
Next, pull the Docker image docker-collector-metrics:

docker pull logzio/docker-collector-metrics

Run the Container

You’ll set your configuration using environment variables in the docker run command. Format each parameter like this: --env ENV_VARIABLE_NAME="value".

See the optional parameters below the code block. All the parameters in the code are required.

docker run --name docker-collector-metrics \
--env LOGZIO_TOKEN="<>" \
--env LOGZIO_MODULES="aws" \
--env AWS_ACCESS_KEY="<>" \
--env AWS_SECRET_KEY="<>" \
--env AWS_REGION="<>" \
--env AWS_NAMESPACES="<>" \

LOGZIO_REGION, LOGZIO_TYPE, LOGZIO_LOG_LEVEL, LOGZIO_EXTRA_DIMENSIONS, and DEBUG are optional settings. If you wish to add any of them, here they are in their proper formats:

--env LOGZIO_REGION="uk" \
--env LOGZIO_TYPE="docker-collector-metrics" \
--env LOGZIO_EXTRA_DIMENSIONS="dimensionName1=value1" \
--env DEBUG=”false” \

Open Your Lambda Dashboard in
Your metrics should appear after a few minutes in the dashboard in your Metrics account. To open it, go to Manage in the left menu, then click Dashboards > Cloudwatch AWS/Lambda.

Observability at scale, powered by open source


2022 Gartner® Magic Quadrant for Application Performance Monitoring and Observability
Forrester Observability Snapshot.

Organize Your Kubernetes Logs On One Unified SaaS Platform

Learn More