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
Copy file name to clipboardExpand all lines: README.md
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -280,6 +280,60 @@ _Note_: The descriptions use the npm package parameters, but they also apply to
280
280
|`llmObsMlApp`|`llm_obs_ml_app`| The name of your LLM application, service, or project, under which all traces and spans are grouped. This helps distinguish between different applications or experiments. See [Application naming guidelines](https://docs.datadoghq.com/llm_observability/sdk/?tab=nodejs#application-naming-guidelines) for allowed characters and other constraints. To override this value for a given root span, see [Tracing multiple applications](https://docs.datadoghq.com/llm_observability/sdk/?tab=nodejs#tracing-multiple-applications). Required if `llmObsEnabled` is `true`|
281
281
|`llmObsAgentlessEnabled`|`llm_obs_agentless_enabled`| Only required if you are not using the Datadog Lambda Extension, in which case this should be set to `true`. Defaults to `false`. |
282
282
283
+
#### Setting `DD_*` environment variables
284
+
285
+
To configure Datadog variables for every instrumented function, set the matching field on `DatadogLambdaProps` (for example, `enableDatadogTracing`, `logLevel`, `env`, or `tags`).
286
+
287
+
To override a value on a single function, use one of:
288
+
289
+
-`datadogLambda.setEnvironment(func, key, value)` before `datadogLambda.addLambdaFunctions()`, to override a construct default while letting the construct finish instrumenting the function.
290
+
-`func.addEnvironment(key, value)` after `datadogLambda.addLambdaFunctions()`, to override the value set during instrumentation.
291
+
292
+
When more than one source sets the same key, the following order applies (highest precedence first):
293
+
294
+
1.`func.addEnvironment(key, value)` called after `datadogLambda.addLambdaFunctions()`.
295
+
2.`DatadogLambdaProps` fields dedicated to that key. These fields overwrite a value for the same key set through `datadogLambda.setEnvironment()`:
296
+
- Unified service tagging: `env`, `service`, `version`
3.`datadogLambda.setEnvironment(func, key, value)` called before `datadogLambda.addLambdaFunctions()`.
302
+
4. Construct defaults, which apply only when nothing else set the key: `enableDatadogTracing`, `datadogAppSecMode`, `enableMergeXrayTraces`, `injectLogContext`, `enableDatadogLogs`, `captureLambdaPayload`, `captureCloudServicePayload`, `logLevel`
303
+
304
+
`datadogLambda.addLambdaFunctions` merges the `DD_TAGS` environment variable from three sources, in order:
305
+
306
+
1.`DatadogLambdaProps.tags`.
307
+
2. Per-function tags from `datadogLambda.setEnvironment(func, 'DD_TAGS', ...)`.
308
+
3.`git.commit.sha` and `git.repository_url` from source code integration.
309
+
310
+
If the same tag key appears in more than one source, the later source wins.
311
+
312
+
The following example shows these rules in practice:
-`DD_TRACE_ENABLED=false`, from `datadogLambda.setEnvironment`, overriding the default.
334
+
-`DD_LOG_LEVEL=debug`, from `myFunction.addEnvironment`, overriding the construct.
335
+
-`DD_TAGS=env:prod,service:worker,team:payments,git.commit.sha:...,git.repository_url:...`. `team:payments` replaces `team:platform`, and source code integration appends the git tags.
336
+
283
337
#### Default layer versions
284
338
285
339
When you don't pass a `*LayerVersion` or `*LayerArn`, the construct uses a default layer version bundled with the package. These defaults track the latest released Datadog Lambda layers at the time the construct version was published, and are exposed via the `DatadogDefaultLayerVersions` class so you can reference them directly in any language:
0 commit comments