From 485a68804375c3e9aa0c67ae8c8168b4d423ac61 Mon Sep 17 00:00:00 2001 From: Alexander Wert Date: Tue, 18 Oct 2022 08:01:16 +0200 Subject: [PATCH 1/2] Change default send strategy to `background --- apmproxy/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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{}), } From 8ccc7826f44f9ed319a2656ee8bf42c8104acc2a Mon Sep 17 00:00:00 2001 From: Alexander Wert Date: Tue, 18 Oct 2022 08:09:41 +0200 Subject: [PATCH 2/2] added explicit syncflush strategy for tests --- docs/monitoring-aws-lambda.asciidoc | 2 +- e2e-testing/sam-java/template.yml | 1 + e2e-testing/sam-nodejs/template.yml | 1 + e2e-testing/sam-python/template.yml | 1 + tf/main.tf | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) 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 = {