Node.js async handlers
Use a Lambda Node.js runtime that meets the SDK’s Node.js 22.15 minimum. Install the SDK and include it in your deployment package:withFlush so buffered telemetry is exported before the invocation returns:
index.handler. If you bundle the function, keep the SDK and instrumented dependencies external and include them in the deployment package. Do not also enable an auto-instrumentation Lambda layer for this setup.
Set the destination variables below in the Lambda function’s environment configuration. The endpoint must be reachable from your function. The SDK ends its flush before the invocation deadline; callback-based handlers are not supported by withFlush.
Configure your destination
Set the OTLP HTTP endpoint and ingestion key for your ClickStack collector. Usehttp:// if your collector does not have TLS configured. For collector setup, see Ingesting with OpenTelemetry.
Other runtimes and handlers
Follow the official Lambda auto-instrumentation instructions to select layers for your runtime, architecture, and AWS region and configure the instrumentation wrapper. Add and configure the OpenTelemetry Collector Lambda layer. Keep the application’s SDK exporters pointed at the local Collector, as described upstream. Configure the Collector’s outgoing connection below.Configure the Lambda Collector destination
SetCLICKHOUSE_OTLP_ENDPOINT and CLICKHOUSE_INGESTION_API_KEY in your Lambda function’s environment variables. Add the following exporter to your Collector configuration.
Set CLICKHOUSE_OTLP_ENDPOINT to your ClickStack collector’s OTLP HTTP endpoint and CLICKHOUSE_INGESTION_API_KEY to its ingestion key. The endpoint must be reachable from your Lambda function.
otlphttp/clickhouse in the exporters list of each signal pipeline you want to send. For example, with the upstream otlp receiver:
OPENTELEMETRY_COLLECTOR_CONFIG_URI to its location, such as /var/task/collector.yaml, following the upstream Collector setup instructions.