You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running this code in Lambda on LocalStack will result in two trace segments being created in XRay - one from the instrumented `boto3` client when running `create_bucket(..)`, and one for the custom subsegment denoted `'my_code'`. You can use the regular XRay API calls (e.g., [`GetTraceSummaries`](https://docs.aws.amazon.com/xray/latest/api/API_GetTraceSummaries.html), [`BatchGetTraces`](https://docs.aws.amazon.com/xray/latest/api/API_BatchGetTraces.html)) to retrieve the details (timestamps, IDs, etc) of these segments.
28
+
29
+
{{< alert >}}
30
+
**Note:** To use XRay in Lambdas, please note that you'll need to configure `LAMBDA_XRAY_INIT=1` - this will ensure that the XRay daemon process is fully initialized when spawning Lambda containers (may slightly increase startup times).
Copy file name to clipboardExpand all lines: content/en/localstack/configuration.md
+2-3
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,6 @@ This section covers configuration values that are specific to AWS services.
72
72
|`DYNAMODB_DELAY_TRANSIENT_STATUSES`|`0`\|`1`| When activated, DynamoDB will introduce artificial delays in resource creation to simulate the actual cloud service more closely. Currently works only for CREATING and DELETING online index statuses. |
73
73
|`DYNAMODB_CORS`|`*`| Enable CORS support for specific allow-list list the domains separated by `,` use `*` for public access (default is `*`) |
74
74
75
-
76
75
### Elasticsearch
77
76
78
77
| Variable | Example Values | Description |
@@ -81,7 +80,6 @@ This section covers configuration values that are specific to AWS services.
81
80
|`ES_MULTI_CLUSTER`|`0`\|`1`| When activated, LocalStack will spawn one Elasticsearch cluster per domain. Otherwise all domains will share a single cluster instance. This is ignored if `ES_CUSTOM_BACKEND` is set. |
82
81
|`ES_ENDPOINT_STRATEGY`|`path`\|`domain`\|`off`| Governs how domain endpoints are created to access a cluster (see [Elasticsearch#endpoints]({{< ref "elasticsearch#endpoints" >}})) |
83
82
84
-
85
83
### Kinesis
86
84
87
85
| Variable | Example Values | Description |
@@ -109,11 +107,12 @@ This section covers configuration values that are specific to AWS services.
109
107
|`LAMBDA_DOCKER_DNS`|| Optional DNS server for the container running your lambda function. |
110
108
|`LAMBDA_DOCKER_FLAGS`|`-e KEY=VALUE`, `-v host:container`, `-p host:container`, `--add-host domain:ip`| Additional flags passed to Lambda Docker `run`\|`create` commands (e.g., useful for specifying custom volume mounts). Does only support environment, volume, port and add-host flags |
111
109
|`LAMBDA_CONTAINER_REGISTRY`|`lambci/lambda` (default) | An alternative docker registry from where to pull lambda execution containers.|
112
-
|`LAMBDA_REMOVE_CONTAINERS`|`true` (default) | Whether to remove containers after Lambdas finished executing.|
110
+
|`LAMBDA_REMOVE_CONTAINERS`|`1` (default) | Whether to remove containers after Lambdas finished executing.|
113
111
|`LAMBDA_FALLBACK_URL`|| Fallback URL to use when a non-existing Lambda is invoked. Either records invocations in DynamoDB (value `dynamodb://<table_name>`) or forwards invocations as a POST request (value `http(s)://...`).|
114
112
| `LAMBDA_FORWARD_URL` | | URL used to forward all Lambda invocations (useful to run Lambdas via an external service).
115
113
|`LAMBDA_JAVA_OPTS`|`-Xmx512M`| Allow passing custom JVM options to Java Lambdas executed in Docker. Use `_debug_port_` placeholder to configure the debug port, e.g., `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=_debug_port_`. |
116
114
|`HOSTNAME_FROM_LAMBDA`|`localstack`| Endpoint host under which APIs are accessible from Lambda containers (optional). This can be useful in docker-compose stacks to use the local container hostname if neither IP address nor container name of the main container are available (e.g., in CI). Often used in combination with `LAMBDA_DOCKER_NETWORK`. |
115
+
|`LAMBDA_XRAY_INIT`|`1` / `0` (default) | Whether to fully initialize XRay daemon for Lambda containers (may increase Lambda startup times) |
0 commit comments