From 1980cea1de80bce1b1c93bd1d1eaf8eca4f9b13d Mon Sep 17 00:00:00 2001 From: kruskall <99559985+kruskall@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:43:40 +0100 Subject: [PATCH] feat: add `ELASTIC_APM_LAMBDA_DISABLE_LOGS_API` env var to disable logs api (#434) * feat: add flag to disable logs api * refactor: parse boolean for consistency with other flags --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 5cd56ba1..23ec9511 100644 --- a/main.go +++ b/main.go @@ -47,6 +47,11 @@ func main() { app.WithAWSConfig(cfg), } + rawDisableLogsAPI := os.Getenv("ELASTIC_APM_LAMBDA_DISABLE_LOGS_API") + if disableLogsAPI, _ := strconv.ParseBool(rawDisableLogsAPI); disableLogsAPI { + appConfigs = append(appConfigs, app.WithoutLogsAPI()) + } + // ELASTIC_APM_LAMBDA_CAPTURE_LOGS indicate if the lambda extension // should capture logs, the value defaults to true i.e. the extension // will capture function logs by default