diff --git a/apmproxy/client.go b/apmproxy/client.go index 7b161abe..58066acb 100644 --- a/apmproxy/client.go +++ b/apmproxy/client.go @@ -84,7 +84,7 @@ func NewClient(opts ...Option) (*Client, error) { WriteTimeout: defaultDataReceiverTimeout, MaxHeaderBytes: 1 << 20, }, - sendStrategy: SyncFlush, + sendStrategy: Background, flushCh: make(chan struct{}), } diff --git a/docs/monitoring-aws-lambda.asciidoc b/docs/monitoring-aws-lambda.asciidoc index 9615a4da..7c87d4b1 100644 --- a/docs/monitoring-aws-lambda.asciidoc +++ b/docs/monitoring-aws-lambda.asciidoc @@ -131,7 +131,7 @@ The timeout value, for the {apm-lambda-ext}'s HTTP client sending data to the AP [float] === `ELASTIC_APM_SEND_STRATEGY` Whether to synchronously flush APM agent data from the {apm-lambda-ext} to the APM Server at the end of the function invocation. -The two accepted values are `background` and `syncflush`. The _default_ is `syncflush`. +The two accepted values are `background` and `syncflush`. The _default_ is `background`. * The `background` strategy indicates that the {apm-lambda-ext} will not flush when it receives a signal that the function invocation has completed. It will instead send any remaining buffered data on the next function invocation. The result is that, if the diff --git a/e2e-testing/sam-java/template.yml b/e2e-testing/sam-java/template.yml index 0b9a4733..e21e87a1 100644 --- a/e2e-testing/sam-java/template.yml +++ b/e2e-testing/sam-java/template.yml @@ -57,6 +57,7 @@ Resources: ELASTIC_APM_CENTRAL_CONFIG: false ELASTIC_APM_CLOUD_PROVIDER: none ELASTIC_APM_SERVER_URL: http://localhost:8200 + ELASTIC_APM_SEND_STRATEGY: syncflush AWS_LAMBDA_EXEC_WRAPPER: /opt/elastic-apm-handler ELASTIC_APM_APPLICATION_PACKAGES: true APM_AWS_EXTENSION_TEST_UUID: !Ref TestUUID diff --git a/e2e-testing/sam-nodejs/template.yml b/e2e-testing/sam-nodejs/template.yml index 23d5ddbe..8d1ed72c 100644 --- a/e2e-testing/sam-nodejs/template.yml +++ b/e2e-testing/sam-nodejs/template.yml @@ -46,4 +46,5 @@ Resources: ELASTIC_APM_CENTRAL_CONFIG: false ELASTIC_APM_CLOUD_PROVIDER: none ELASTIC_APM_SERVER_URL: http://localhost:8200 + ELASTIC_APM_SEND_STRATEGY: syncflush APM_AWS_EXTENSION_TEST_UUID: !Ref TestUUID diff --git a/e2e-testing/sam-python/template.yml b/e2e-testing/sam-python/template.yml index e4c4682b..bd427fde 100644 --- a/e2e-testing/sam-python/template.yml +++ b/e2e-testing/sam-python/template.yml @@ -48,4 +48,5 @@ Resources: ELASTIC_APM_CENTRAL_CONFIG: false ELASTIC_APM_CLOUD_PROVIDER: none ELASTIC_APM_SERVER_URL: http://localhost:8200 + ELASTIC_APM_SEND_STRATEGY: syncflush APM_AWS_EXTENSION_TEST_UUID: !Ref TestUUID diff --git a/tf/main.tf b/tf/main.tf index c68c701b..9b67a15a 100644 --- a/tf/main.tf +++ b/tf/main.tf @@ -33,6 +33,7 @@ module "lambda_function" { ELASTIC_APM_LOG_LEVEL = var.log_level ELASTIC_APM_LAMBDA_APM_SERVER = module.ec_deployment.apm_url ELASTIC_APM_SECRET_TOKEN = module.ec_deployment.apm_secret_token + ELASTIC_APM_SEND_STRATEGY = "syncflush" } tags = {