Logs Collection
Using Lambda Layers, you can configure your Lambda functions to start sending logs to Lumigo.
Quickstart guide
Enable Logging for Lambda Manually
This is the recommended method of installation.
- Add the logging layer according to your architecture.
Note
Make sure to update the
<REGION>
according to your lambda.
- For ARM architecture: use
arn:aws:lambda:<REGION>:114300393969:layer:lumigo-log-collector-arm64:24
- For x86 architecture: use
arn:aws:lambda:<REGION>:114300393969:layer:lumigo-log-collector-amd64:24
- Add the following environment variable. Make sure to replace
token
with your Lumigo token, available in the settings page.
LUMIGO_LOG_ENDPOINT
: <https://logs-ga.lumigo-tracer-edge.golumigo.com/api/logs?token=t_xxxxxxxxx>
Enable Logging for Lambda (AWS Tag) Automatically
You can automatically enable Lumigo logging by adding the following AWS tag to your Lambda functions:
LUMIGO_LOG_COLLECTION: true
Lumigo periodically scans Lambda functions in your environment for the LUMIGO_LOG_COLLECTION
AWS tag. When Lumigo identifies a Lambda function with this tag, it automatically adds a Lumigo logging layer and a Lumigo endpoint.
Note
It may take several minutes for Lumigo to identify the tag and instrument your function, which is why this installation method is NOT recommended to be used in Production.
Requirements for Lumigo Log Management
In order to use Lumigo's Logging Layer, you need to meet the following requirements.
- The Lambda's unzipped total deployment package size must not exceed 250 MB total. This is an AWS limit for all Lambda deployments. The Lumigo log layer adds around 12 MB on its own.
- Custom Runtimes for Lambda do not support layers.
- For Lambdas that use Aliases, the layer can be added by adding the layer directly during deployment.
Modes of sending logs to Lumigo
There are two modes that allow you to send logs to Lumigo:
- On next invocation: Invocation logs are buffered in the Lambda container and sent on the next function invocation, in parallel to its execution. This parallelization results in virtually no latency addition to the function execution time. This is the default and recommended mode for production. In the event that there isn't a subsequent invocation, it may take up to 5 minutes for logs to be sent to Lumigo.
- On invocation end: Logs are sent to Lumigo at the end of each invocation. This mode is only recommended in cases where many minutes can pass between function invocations, and added invocation duration is not significant. For example, when you are debugging in your dev environment as a developer.
To change the log sending mode for a Lambda function, add the following environment variable:
LUMIGO_SEND_ON_INVOCATION_END
:true
Shutdown sending logs
To disable sending logs from your lambda functions, you need to set/update the following AWS tag:
LUMIGO_LOG_COLLECTION: false
Log collection from containerized lambda functions
To use Lumigo's lambda extension, the binary should be copied to /opt/extensions/
. Lumigo's log collection extension supports both amd64 and arm64 architectures.
To add the extension to the required path:
FROM public.ecr.aws/lumigo/lumigo-log-collection-extension:19 as lumigo-log-collecting-extension
COPY --from=lumigo-log-collecting-extension /opt/extensions/log-collector-extension /opt/extensions/log-collector-extension
To add the extension to your dockerfile:
FROM public.ecr.aws/lumigo/lumigo-log-collection-extension:19 as lumigo-log-collecting-extension
FROM public.ecr.aws/lambda/nodejs:18 as builder
WORKDIR /usr/app
COPY package.json index.ts ./
RUN npm install
RUN npm run build
FROM public.ecr.aws/lambda/nodejs:18
COPY --from=lumigo-log-collecting-extension /opt/extensions/log-collector-extension /opt/extensions/log-collector-extension
WORKDIR ${LAMBDA_TASK_ROOT}
COPY --from=builder /usr/app/dist/* ./
CMD ["index.handler"]
Updated 5 days ago