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
+3-96Lines changed: 3 additions & 96 deletions
Original file line number
Diff line number
Diff line change
@@ -10,104 +10,11 @@ Datadog Lambda Library for Go enables enhanced Lambda metrics, distributed traci
10
10
11
11
## Installation
12
12
13
-
Follow the installation instructions[here](https://docs.datadoghq.com/serverless/installation/go/).
13
+
Follow the [installation instructions](https://docs.datadoghq.com/serverless/installation/go/), and view your function's enhanced metrics, traces and logs in Datadog.
14
14
15
-
## Enhanced Metrics
15
+
## Configurations
16
16
17
-
Once [installed](#installation), you should be able to view enhanced metrics for your Lambda function in Datadog.
18
-
19
-
Check out the official documentation on [Datadog Lambda enhanced metrics](https://docs.datadoghq.com/integrations/amazon_lambda/?tab=go#real-time-enhanced-lambda-metrics).
20
-
21
-
## Custom Metrics
22
-
23
-
Once [installed](#installation), you should be able to submit custom metrics from your Lambda function.
24
-
25
-
Check out the instructions for [submitting custom metrics from AWS Lambda functions](https://docs.datadoghq.com/integrations/amazon_lambda/?tab=go#custom-metrics).
26
-
27
-
## Tracing
28
-
29
-
Set the `DD_TRACE_ENABLED` environment variable to `true` to enable Datadog tracing. When Datadog tracing is enabled, the library will inject a span representing the Lambda's execution into the context object. You can then use the included `dd-trace-go` package to create additional spans from the context or pass the context to other services. For more information, see the [dd-trace-go documentation](https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace).
If you are also using AWS X-Ray to trace your Lambda functions, you can set the `DD_MERGE_XRAY_TRACES` environment variable to `true`, and Datadog will merge your Datadog and X-Ray traces into a single, unified trace.
61
-
62
-
### Trace Context Extraction
63
-
64
-
To link your distributed traces, datadog-lambda-go looks for the `x-datadog-trace-id`, `x-datadog-parent-id` and `x-datadog-sampling-priority` trace `headers` in the Lambda event payload.
65
-
If the headers are found it will set the parent trace to the trace context extracted from the headers.
66
-
67
-
It is possible to configure your own trace context extractor function if the default extractor does not support your event.
68
-
69
-
```go
70
-
myExtractorFunc:=func(ctx context.Context, ev json.RawMessage) map[string]string {
71
-
// extract x-datadog-trace-id, x-datadog-parent-id and x-datadog-sampling-priority.
72
-
}
73
-
74
-
cfg:= &ddlambda.Config{
75
-
TraceContextExtractor: myExtractorFunc,
76
-
}
77
-
ddlambda.WrapFunction(handler, cfg)
78
-
```
79
-
80
-
A more complete example can be found in the `ddlambda_example_test.go` file.
81
-
82
-
## Environment Variables
83
-
84
-
### DD_FLUSH_TO_LOG
85
-
86
-
Set to `true` (recommended) to send custom metrics asynchronously (with no added latency to your Lambda function executions) through CloudWatch Logs with the help of [Datadog Forwarder](https://github.com/DataDog/datadog-serverless-functions/tree/master/aws/logs_monitoring). Defaults to `false`. If set to `false`, you also need to set `DD_API_KEY` and `DD_SITE`.
87
-
88
-
### DD_API_KEY
89
-
90
-
If `DD_FLUSH_TO_LOG` is set to `false` (not recommended), the Datadog API Key must be defined.
91
-
92
-
### DD_SITE
93
-
94
-
If `DD_FLUSH_TO_LOG` is set to `false` (not recommended), you must set `DD_SITE`. Possible values are `datadoghq.com`, `datadoghq.eu`, `us3.datadoghq.com`, `us5.datadoghq.com`, and `ddog-gov.com`. The default is `datadoghq.com`.
95
-
96
-
### DD_LOG_LEVEL
97
-
98
-
Set to `debug` enable debug logs from the Datadog Lambda Library. Defaults to `info`.
99
-
100
-
### DD_ENHANCED_METRICS
101
-
102
-
Generate enhanced Datadog Lambda integration metrics, such as, `aws.lambda.enhanced.invocations` and `aws.lambda.enhanced.errors`. Defaults to `true`.
103
-
104
-
### DD_TRACE_ENABLED
105
-
106
-
Initialize the Datadog tracer when set to `true`. Defaults to `false`.
107
-
108
-
### DD_MERGE_XRAY_TRACES
109
-
110
-
If you are using both X-Ray and Datadog tracing, set this to `true` to merge the X-Ray and Datadog traces. Defaults to `false`.
17
+
See the [advanced configuration options](https://docs.datadoghq.com/serverless/configuration) to tag your telemetry, capture request/response payloads, filter or scrub sensitive information from logs or traces, and more.
0 commit comments