diff --git a/checks/runtime_check.go b/checks/runtime_check.go index 7742b22..cfe4dac 100644 --- a/checks/runtime_check.go +++ b/checks/runtime_check.go @@ -46,7 +46,9 @@ func checkAndReturnRuntime() (runtimeConfig, error) { func latestAgentTag(r *runtimeConfig) error { resp, err := client.Get(r.agentVersionUrl) if err != nil { - return err + // Likely a connectivity issue, log the error but skip check + util.Debugf("Can't query latest agent version. Request to %v returned error %v", r.agentVersionUrl, err) + return nil } defer resp.Body.Close() diff --git a/checks/runtime_check_test.go b/checks/runtime_check_test.go index 260a0ce..c6228ae 100644 --- a/checks/runtime_check_test.go +++ b/checks/runtime_check_test.go @@ -50,7 +50,7 @@ func TestRuntimeCheckNil(t *testing.T) { func TestLatestAgentTag(t *testing.T) { client = &mockClientError{} - assert.Error(t, latestAgentTag(&runtimeConfig{})) + assert.Nil(t, latestAgentTag(&runtimeConfig{})) client = &mockClientRedirect{} assert.Nil(t, latestAgentTag(&runtimeConfig{})) diff --git a/examples/sam/java/deploy.sh b/examples/sam/java/deploy.sh index 53392ba..1b667dd 100755 --- a/examples/sam/java/deploy.sh +++ b/examples/sam/java/deploy.sh @@ -9,11 +9,11 @@ sam build --use-container bucket="newrelic-example-${region}-${accountId}" -aws s3 mb --region ${region} s3://${bucket} +#aws s3 mb --region ${region} s3://${bucket} -sam package --region ${region} --s3-bucket=${bucket} --output-template-file packaged.yaml -aws cloudformation deploy --region ${region} \ +sam package --region ${region} --s3-bucket ${bucket} --output-template-file packaged.yaml +sam deploy --region ${region} \ --template-file packaged.yaml \ - --stack-name NewrelicExampleJava \ + --stack-name NewrelicExampleJava2 \ --capabilities CAPABILITY_IAM \ --parameter-overrides "NRAccountId=${accountId}" diff --git a/examples/sam/java/template.yaml b/examples/sam/java/template.yaml index 1d70462..c8b05c6 100644 --- a/examples/sam/java/template.yaml +++ b/examples/sam/java/template.yaml @@ -29,7 +29,7 @@ Resources: Layers: # This layer includes the New Relic Java agent and Lambda Extension, a sidecar process that sends telemetry, # as well as the New Relic Agent for java, and a handler wrapper that makes integration easy. - - !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:451483290750:layer:NewRelicJava11:3 + - !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:451483290750:layer:NewRelicJava11:11 Policies: # This policy allows the lambda to know the value of the New Relic licence key. We need this so # that we can send telemetry back to New Relic @@ -49,7 +49,7 @@ Resources: NEW_RELIC_LAMBDA_HANDLER: com.newrelic.lambda.example.Stream::handleRequest NEW_RELIC_ACCOUNT_ID: !Sub ${NRAccountId} Layers: - - !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:451483290750:layer:NewRelicJava11:2 + - !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:451483290750:layer:NewRelicJava11:11 Policies: - AWSSecretsManagerGetSecretValuePolicy: SecretArn: !ImportValue NewRelicLicenseKeySecret-NewRelic-LicenseKeySecretARN diff --git a/util/extension.go b/util/extension.go index d80ef10..7c60d61 100644 --- a/util/extension.go +++ b/util/extension.go @@ -2,6 +2,6 @@ package util const ( Name = "newrelic-lambda-extension" - Version = "2.0.5" + Version = "2.0.6" Id = Name + ":" + Version )