Set Up the Lambda Telemetry Extension
You’ll take one Lambda function from no telemetry to logs, metrics, and traces in KloudMate. It’s about five minutes, and nothing in your function code changes.
Before you start
Section titled “Before you start”- A KloudMate ingest API key. Create one under API Keys.
- Your KloudMate OTLP endpoint —
https://otel.kloudmate.com:4318for most accounts. - Permission to update the function’s configuration (its layers and environment variables).
Add the layer and configure the function
Section titled “Add the layer and configure the function”-
Find the layer ARN for your function. It has to match the function’s Region and architecture (x86_64 or arm64). Copy the matching ARN from Layer ARNs.
-
Add the layer to the function. A function can carry up to five layers, so this one sits alongside any you already use.
-
Set the environment variables:
-
Deploy and invoke the function. The change takes effect on the next invocation. Open the function in KloudMate to confirm data is arriving.
Configure it with infrastructure as code
Section titled “Configure it with infrastructure as code”Drop the same layer ARN and environment variables into whatever you use to manage the function. The examples below use us-east-1 (x86_64) — swap in the ARN for your Region and architecture, and your own API key.
- Open the function in the AWS Lambda console.
- Under Layers, choose Add a layer → Specify an ARN, paste the ARN for your Region and architecture, and add it.
- Under Configuration → Environment variables, add
OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_HEADERS, and (optionally)OTEL_SERVICE_NAME. - Save, then invoke the function.
Confirm it’s working
Section titled “Confirm it’s working”Invoke the function once, then check KloudMate:
- Logs — the function’s output shows up in Log Explorer, tagged with its service name.
- Metrics —
faas.invoke_durationand the related metrics appear for the function. - Traces — with X-Ray active tracing enabled, each invocation produces a trace.
Nothing within a minute? Set OTEL_LOG_LEVEL=debug and check the function’s own CloudWatch logs — the extension reports what it’s doing on lines tagged [KloudMate].
Troubleshooting
Section titled “Troubleshooting”| What you see | Likely cause and fix |
|---|---|
| No data in KloudMate | Check that the API key in OTEL_EXPORTER_OTLP_HEADERS is valid and the endpoint is reachable. Turn on OTEL_LOG_LEVEL=debug and read the [KloudMate] lines. |
export rejected (401) | The API key is missing or wrong. Recheck the Authorization value against API Keys. |
| Function fails to start | The layer’s architecture doesn’t match the function. Use the ARN that matches x86_64 or arm64. |
| Logs and metrics work, but no traces | Traces need X-Ray active tracing on the function. Turn it on, or expect logs and metrics only. |