{"modulePath":"github.com/stroem/datadog-lambda-go","version":"v0.9.1-0.20201119131949-64b69e399c40","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ddlambda\n\n## Constants\n\n```go\nconst (\n\t// DatadogAPIKeyEnvVar is the environment variable that will be used to set the API key.\n\tDatadogAPIKeyEnvVar = \"DD_API_KEY\"\n\t// DatadogKMSAPIKeyEnvVar is the environment variable that will be sent to KMS for decryption, then used as an API key.\n\tDatadogKMSAPIKeyEnvVar = \"DD_KMS_API_KEY\"\n\t// DatadogSiteEnvVar is the environment variable that will be used as the API host.\n\tDatadogSiteEnvVar = \"DD_SITE\"\n\t// LogLevelEnvVar is the environment variable that will be used to set the log level.\n\tLogLevelEnvVar = \"DD_LOG_LEVEL\"\n\t// ShouldUseLogForwarderEnvVar is the environment variable that enables log forwarding of metrics.\n\tShouldUseLogForwarderEnvVar = \"DD_FLUSH_TO_LOG\"\n\t// DatadogTraceEnabledEnvVar is the environment variable that enables Datadog tracing.\n\tDatadogTraceEnabledEnvVar = \"DD_TRACE_ENABLED\"\n\t// MergeXrayTracesEnvVar is the environment variable that enables the merging of X-Ray and Datadog traces.\n\tMergeXrayTracesEnvVar = \"DD_MERGE_XRAY_TRACES\"\n\n\t// DefaultSite to send API messages to.\n\tDefaultSite = \"datadoghq.com\"\n\t// DefaultEnhancedMetrics enables enhanced metrics by default.\n\tDefaultEnhancedMetrics = true\n)\n```\n\n## Functions\n\n```go\nfunc AddTraceHeaders(ctx context.Context, req *http.Request)\n```\nAddTraceHeaders adds Datadog trace headers to a HTTP Request Deprecated: Use dd-trace-go to extract the current span from the context instead\n\n```go\nfunc Distribution(metric string, value float64, tags ...string)\n```\nDistribution sends a distribution metric to Datadog Deprecated: Use Metric method instead\n\n```go\nfunc GetContext() context.Context\n```\nGetContext retrieves the last created lambda context. Only use this if you aren't manually passing context through your call hierarchy.\n\n```go\nfunc GetTraceHeaders(ctx context.Context) map[string]string\n```\nGetTraceHeaders reads a map containing the Datadog trace headers from a context object. Deprecated: Use dd-trace-go to extract the current span from the context instead\n\n```go\nfunc InvokeDryRun(callback func(ctx context.Context), cfg *Config) (interface{}, error)\n```\nInvokeDryRun is a utility to easily run your lambda for testing\n\n```go\nfunc Metric(metric string, value float64, tags ...string)\n```\nMetric sends a distribution metric to DataDog\n\n```go\nfunc MetricWithTimestamp(metric string, value float64, timestamp time.Time, tags ...string)\n```\nMetricWithTimestamp sends a distribution metric to DataDog with a custom timestamp\n\n```go\nfunc WrapHandler(handler interface{}, cfg *Config) interface{}\n```\nWrapHandler is used to instrument your lambda functions. It returns a modified handler that can be passed directly to the lambda. Start function.\n\n## Types\n\n```go\ntype Config struct {\n\t// APIKey is your Datadog API key. This is used for sending metrics.\n\tAPIKey string\n\t// KMSAPIKey is your Datadog API key, encrypted using the AWS KMS service. This is used for sending metrics.\n\tKMSAPIKey string\n\t// ShouldRetryOnFailure is used to turn on retry logic when sending metrics via the API. This can negatively effect the performance of your lambda,\n\t// and should only be turned on if you can't afford to lose metrics data under poor network conditions.\n\tShouldRetryOnFailure bool\n\t// ShouldUseLogForwarder enabled the log forwarding method for sending metrics to Datadog. This approach requires the user to set up a custom lambda\n\t// function that forwards metrics from cloudwatch to the Datadog api. This approach doesn't have any impact on the performance of your lambda function.\n\tShouldUseLogForwarder bool\n\t// BatchInterval is the period of time which metrics are grouped together for processing to be sent to the API or written to logs.\n\t// Any pending metrics are flushed at the end of the lambda.\n\tBatchInterval time.Duration\n\t// Site is the host to send metrics to. If empty, this value is read from the 'DD_SITE' environment variable, or if that is empty\n\t// will default to 'datadoghq.com'.\n\tSite string\n\t// DebugLogging will turn on extended debug logging.\n\tDebugLogging bool\n\t// EnhancedMetrics enables the reporting of enhanced metrics under `aws.lambda.enhanced*` and adds enhanced metric tags\n\tEnhancedMetrics bool\n\t// DDTraceEnabled enables the Datadog tracer.\n\tDDTraceEnabled bool\n\t// MergeXrayTraces will cause Datadog traces to be merged with traces from AWS X-Ray.\n\tMergeXrayTraces bool\n}\n```\nConfig gives options for how ddlambda should behave\n\n","path":"github.com/stroem/datadog-lambda-go","name":"ddlambda","synopsis":"","isRedistributable":true}
