diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index be1bf45f..787e7e53 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { steps { withGithubNotify(context: "Lint") { withGoEnv(){ - dir("${BASE_DIR}/apm-lambda-extension"){ + dir("${BASE_DIR}"){ sh(label: 'lint-prep', script: 'go mod tidy && git diff --exit-code') sh(label: 'lint-run', script: 'make lint') sh(label: 'Go vet', script: 'go vet') @@ -54,7 +54,7 @@ pipeline { } withGithubNotify(context: "NOTICE.txt") { withGoEnv(){ - dir("${BASE_DIR}/apm-lambda-extension"){ + dir("${BASE_DIR}"){ sh(label: 'notice', script: ''' make NOTICE.txt git diff --exit-code --quiet && exit 0 || echo "regenerate NOTICE.txt" && exit 1 @@ -82,7 +82,7 @@ pipeline { deleteDir() unstash 'source' withGoEnv(){ - dir("${BASE_DIR}/apm-lambda-extension"){ + dir("${BASE_DIR}"){ cmd(label: 'make build', script: 'make build') } } @@ -93,7 +93,7 @@ pipeline { steps { withGithubNotify(context: "Test-${GO_VERSION}-${PLATFORM}") { withGoEnv(){ - dir("${BASE_DIR}/apm-lambda-extension"){ + dir("${BASE_DIR}"){ goTestJUnit(options: '-v ./...', output: 'junit-report.xml') } } @@ -135,7 +135,7 @@ pipeline { deleteDir() unstash 'source' withGoEnv(){ - dir("${BASE_DIR}/apm-lambda-extension"){ + dir("${BASE_DIR}"){ cmd(label: 'make dist', script: 'make dist') } } @@ -146,7 +146,7 @@ pipeline { steps { withGithubNotify(context: "Push-Docker-${PLATFORM}") { withGoEnv(){ - dir("${BASE_DIR}/apm-lambda-extension"){ + dir("${BASE_DIR}"){ dockerLogin(secret: "${DOCKER_SECRET}", registry: "${DOCKER_REGISTRY}") cmd(label: 'make push-docker', script: 'make push-docker') } @@ -159,7 +159,7 @@ pipeline { withGithubNotify(context: "Publish-Layer-${PLATFORM}") { withGoEnv(){ withAWSEnv(secret: 'secret/observability-team/ci/service-account/apm-aws-lambda', forceInstallation: true, version: '2.4.10') { - dir("${BASE_DIR}/apm-lambda-extension"){ + dir("${BASE_DIR}"){ cmd(label: 'make publish-in-all-aws-regions', script: 'make publish-in-all-aws-regions') cmd(label: 'make create-arn-file', script: 'make create-arn-file') stash(includes: "*${SUFFIX_ARN_FILE}", name: "arn-${isArm() ? 'arm' : 'amd'}") @@ -171,9 +171,9 @@ pipeline { } post { always { - archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/apm-lambda-extension/.regions") - archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/apm-lambda-extension/*${SUFFIX_ARN_FILE}") - archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/apm-lambda-extension/.aws") + archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/.regions") + archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/*${SUFFIX_ARN_FILE}") + archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/.aws") } } } @@ -183,7 +183,7 @@ pipeline { stage('Release Notes') { steps { withGhEnv(forceInstallation: true, version: '2.4.0') { - dir("${BASE_DIR}/apm-lambda-extension"){ + dir("${BASE_DIR}"){ unstash "arn-arm" unstash "arn-amd" unstash "dist-arm" diff --git a/.gitignore b/.gitignore index 89c0ede3..ae5d3d40 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ # AWS regions file .regions .aws/ + +bin/ diff --git a/apm-lambda-extension/CHANGELOG.asciidoc b/CHANGELOG.asciidoc similarity index 100% rename from apm-lambda-extension/CHANGELOG.asciidoc rename to CHANGELOG.asciidoc diff --git a/apm-lambda-extension/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md similarity index 100% rename from apm-lambda-extension/CODE_OF_CONDUCT.md rename to CODE_OF_CONDUCT.md diff --git a/apm-lambda-extension/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from apm-lambda-extension/CONTRIBUTING.md rename to CONTRIBUTING.md diff --git a/apm-lambda-extension/Dockerfile b/Dockerfile similarity index 100% rename from apm-lambda-extension/Dockerfile rename to Dockerfile diff --git a/apm-lambda-extension/LICENSE.txt b/LICENSE.txt similarity index 100% rename from apm-lambda-extension/LICENSE.txt rename to LICENSE.txt diff --git a/apm-lambda-extension/Makefile b/Makefile similarity index 100% rename from apm-lambda-extension/Makefile rename to Makefile diff --git a/apm-lambda-extension/NOTICE.txt b/NOTICE.txt similarity index 100% rename from apm-lambda-extension/NOTICE.txt rename to NOTICE.txt diff --git a/README.md b/README.md index f22c08f3..31b64e98 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,19 @@ Ready to use Elastic APM to monitor your Lambda functions? See [Monitoring AWS L Backport any changes made in the `docs` directory to the branches that you'd like to see the docs show up in. Branch names must follow the `major.minor` naming scheme and match a new or recent Elastic Stack version. -## License - -Apache 2.0. - ## Getting Help If you find a bug, please [report an issue](https://github.com/elastic/apm-agent-go/issues). For any other assistance, please open or add to a topic on the [APM discuss forum](https://discuss.elastic.co/c/apm). + +## Contributing + +See [contributing](CONTRIBUTING.md) for details about reporting bugs, requesting features, or code contributions. + +## Release Procedure + +See [release](RELEASE.md) for details. + +## License + +Apache 2.0. diff --git a/apm-lambda-extension/RELEASE.md b/RELEASE.md similarity index 100% rename from apm-lambda-extension/RELEASE.md rename to RELEASE.md diff --git a/apm-lambda-extension/SECURITY.md b/SECURITY.md similarity index 100% rename from apm-lambda-extension/SECURITY.md rename to SECURITY.md diff --git a/apm-lambda-extension/README.md b/TESTING.md similarity index 63% rename from apm-lambda-extension/README.md rename to TESTING.md index 3ff9957b..75b4ac2a 100644 --- a/apm-lambda-extension/README.md +++ b/TESTING.md @@ -1,28 +1,13 @@ -[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=library%2Fapm-aws-lambda-mbp%2Fmain)](https://apm-ci.elastic.co/job/library/job/apm-aws-lambda-mbp/job/main/) - -# Elastic APM AWS Lambda extension - -Elastic APM Agents can be used with AWS Lambda to monitor the execution of your AWS Lambda functions. -Currently the Node.js, Python and Java Agents are supported. - -The extension listens for data once per function invocation and forwards data to an APM Server. - -## Getting Started -Ready to use Elastic APM to monitor your Lambda functions? -See [Monitoring AWS Lambda Functions](https://www.elastic.co/guide/en/apm/guide/current/monitoring-aws-lambda.html) to get started and learn more about available configuration options. - -## Contributing - -See [contributing](CONTRIBUTING.md) for details about reporting bugs, requesting features, or code contributions. +# APM AWS Lambda extension Testing ## Testing unreleased versions -If you need to test an unreleased version you can compile the package and it's dependencies and make them available as AWS Lambda Layer. +If you need to test an unreleased version you can compile the package and its dependencies and make them available as AWS Lambda Layer. ### Compile package and dependencies To run an unreleased version of this extension, you will need to ensure that your build architecture matches that of the Lambda execution environment by compiling with `GOOS=linux` and `GOARCH=amd64` if you are not running in a Linux environment. -To build the extension into the `bin/extensions` folder, run the following commands. +To build the extension in the `bin/extensions` folder, run the following commands. ```bash $ cd apm-lambda-extension @@ -55,7 +40,7 @@ aws lambda publish-layer-version \ --zip-file "fileb://extension.zip" ``` -The out from the above command will include a `LayverVersionArn` field, which contains the unique string identifier for your layer. The will look something like the following. +The output from the above command will include a `LayerVersionArn` field, which contains the unique string identifier for your layer. The will look something like the following. `"LayerVersionArn": "arn:aws:lambda::123456789012:layer::1"` @@ -70,7 +55,3 @@ The `Makefile` also provides a `build-and-publish` command which will perform th AWS_ACCESS_KEY_ID=A...X \ AWS_SECRET_ACCESS_KEY=h...E \ make build-and-publish - -## Release Procedure - -See [release](RELEASE.md) for details. \ No newline at end of file diff --git a/apm-lambda-extension/.gitignore b/apm-lambda-extension/.gitignore deleted file mode 100644 index e660fd93..00000000 --- a/apm-lambda-extension/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bin/ diff --git a/apm-lambda-extension/apmproxy/apmserver.go b/apmproxy/apmserver.go similarity index 100% rename from apm-lambda-extension/apmproxy/apmserver.go rename to apmproxy/apmserver.go diff --git a/apm-lambda-extension/apmproxy/apmserver_test.go b/apmproxy/apmserver_test.go similarity index 99% rename from apm-lambda-extension/apmproxy/apmserver_test.go rename to apmproxy/apmserver_test.go index e6534a4b..3e5cc952 100644 --- a/apm-lambda-extension/apmproxy/apmserver_test.go +++ b/apmproxy/apmserver_test.go @@ -20,7 +20,7 @@ package apmproxy_test import ( "compress/gzip" "context" - "elastic/apm-lambda-extension/apmproxy" + "github.com/elastic/apm-aws-lambda/apmproxy" "io" "net/http" "net/http/httptest" diff --git a/apm-lambda-extension/apmproxy/client.go b/apmproxy/client.go similarity index 100% rename from apm-lambda-extension/apmproxy/client.go rename to apmproxy/client.go diff --git a/apm-lambda-extension/apmproxy/client_test.go b/apmproxy/client_test.go similarity index 97% rename from apm-lambda-extension/apmproxy/client_test.go rename to apmproxy/client_test.go index ae4e05f9..8dd75d36 100644 --- a/apm-lambda-extension/apmproxy/client_test.go +++ b/apmproxy/client_test.go @@ -18,7 +18,7 @@ package apmproxy_test import ( - "elastic/apm-lambda-extension/apmproxy" + "github.com/elastic/apm-aws-lambda/apmproxy" "testing" "github.com/stretchr/testify/require" diff --git a/apm-lambda-extension/apmproxy/metadata.go b/apmproxy/metadata.go similarity index 100% rename from apm-lambda-extension/apmproxy/metadata.go rename to apmproxy/metadata.go diff --git a/apm-lambda-extension/apmproxy/metadata_test.go b/apmproxy/metadata_test.go similarity index 99% rename from apm-lambda-extension/apmproxy/metadata_test.go rename to apmproxy/metadata_test.go index 6ac647e1..be88a0f3 100644 --- a/apm-lambda-extension/apmproxy/metadata_test.go +++ b/apmproxy/metadata_test.go @@ -21,7 +21,7 @@ import ( "bytes" "compress/gzip" "compress/zlib" - "elastic/apm-lambda-extension/apmproxy" + "github.com/elastic/apm-aws-lambda/apmproxy" "io" "testing" diff --git a/apm-lambda-extension/apmproxy/option.go b/apmproxy/option.go similarity index 100% rename from apm-lambda-extension/apmproxy/option.go rename to apmproxy/option.go diff --git a/apm-lambda-extension/apmproxy/receiver.go b/apmproxy/receiver.go similarity index 100% rename from apm-lambda-extension/apmproxy/receiver.go rename to apmproxy/receiver.go diff --git a/apm-lambda-extension/apmproxy/receiver_test.go b/apmproxy/receiver_test.go similarity index 99% rename from apm-lambda-extension/apmproxy/receiver_test.go rename to apmproxy/receiver_test.go index f4e681ac..a66de72c 100644 --- a/apm-lambda-extension/apmproxy/receiver_test.go +++ b/apmproxy/receiver_test.go @@ -19,7 +19,7 @@ package apmproxy_test import ( "bytes" - "elastic/apm-lambda-extension/apmproxy" + "github.com/elastic/apm-aws-lambda/apmproxy" "io" "net" "net/http" diff --git a/apm-lambda-extension/apmproxy/status.go b/apmproxy/status.go similarity index 100% rename from apm-lambda-extension/apmproxy/status.go rename to apmproxy/status.go diff --git a/apm-lambda-extension/app/app.go b/app/app.go similarity index 95% rename from apm-lambda-extension/app/app.go rename to app/app.go index 1ffbe709..c7788390 100644 --- a/apm-lambda-extension/app/app.go +++ b/app/app.go @@ -18,10 +18,10 @@ package app import ( - "elastic/apm-lambda-extension/apmproxy" - "elastic/apm-lambda-extension/extension" - "elastic/apm-lambda-extension/logger" - "elastic/apm-lambda-extension/logsapi" + "github.com/elastic/apm-aws-lambda/apmproxy" + "github.com/elastic/apm-aws-lambda/extension" + "github.com/elastic/apm-aws-lambda/logger" + "github.com/elastic/apm-aws-lambda/logsapi" "fmt" "os" "strconv" diff --git a/apm-lambda-extension/app/config.go b/app/config.go similarity index 100% rename from apm-lambda-extension/app/config.go rename to app/config.go diff --git a/apm-lambda-extension/app/run.go b/app/run.go similarity index 98% rename from apm-lambda-extension/app/run.go rename to app/run.go index 85766f5c..3c35aa5e 100644 --- a/apm-lambda-extension/app/run.go +++ b/app/run.go @@ -19,9 +19,9 @@ package app import ( "context" - "elastic/apm-lambda-extension/apmproxy" - "elastic/apm-lambda-extension/extension" - "elastic/apm-lambda-extension/logsapi" + "github.com/elastic/apm-aws-lambda/apmproxy" + "github.com/elastic/apm-aws-lambda/extension" + "github.com/elastic/apm-aws-lambda/logsapi" "fmt" "sync" "time" diff --git a/apm-lambda-extension/build.sh b/build.sh similarity index 100% rename from apm-lambda-extension/build.sh rename to build.sh diff --git a/apm-lambda-extension/cli/.eslintrc.js b/cli/.eslintrc.js similarity index 100% rename from apm-lambda-extension/cli/.eslintrc.js rename to cli/.eslintrc.js diff --git a/apm-lambda-extension/cli/.gitignore b/cli/.gitignore similarity index 100% rename from apm-lambda-extension/cli/.gitignore rename to cli/.gitignore diff --git a/apm-lambda-extension/cli/README.md b/cli/README.md similarity index 100% rename from apm-lambda-extension/cli/README.md rename to cli/README.md diff --git a/apm-lambda-extension/cli/build-and-publish.js b/cli/build-and-publish.js similarity index 100% rename from apm-lambda-extension/cli/build-and-publish.js rename to cli/build-and-publish.js diff --git a/apm-lambda-extension/cli/elastic-lambda.js b/cli/elastic-lambda.js similarity index 100% rename from apm-lambda-extension/cli/elastic-lambda.js rename to cli/elastic-lambda.js diff --git a/apm-lambda-extension/cli/install.js b/cli/install.js similarity index 100% rename from apm-lambda-extension/cli/install.js rename to cli/install.js diff --git a/apm-lambda-extension/cli/install.yaml.dist b/cli/install.yaml.dist similarity index 100% rename from apm-lambda-extension/cli/install.yaml.dist rename to cli/install.yaml.dist diff --git a/apm-lambda-extension/cli/package-lock.json b/cli/package-lock.json similarity index 100% rename from apm-lambda-extension/cli/package-lock.json rename to cli/package-lock.json diff --git a/apm-lambda-extension/cli/package.json b/cli/package.json similarity index 100% rename from apm-lambda-extension/cli/package.json rename to cli/package.json diff --git a/apm-lambda-extension/cli/profile.js b/cli/profile.js similarity index 100% rename from apm-lambda-extension/cli/profile.js rename to cli/profile.js diff --git a/apm-lambda-extension/cli/profile.yaml.dist b/cli/profile.yaml.dist similarity index 100% rename from apm-lambda-extension/cli/profile.yaml.dist rename to cli/profile.yaml.dist diff --git a/apm-lambda-extension/cli/profile/code/collector.yaml b/cli/profile/code/collector.yaml similarity index 100% rename from apm-lambda-extension/cli/profile/code/collector.yaml rename to cli/profile/code/collector.yaml diff --git a/apm-lambda-extension/cli/profile/code/index.js b/cli/profile/code/index.js similarity index 100% rename from apm-lambda-extension/cli/profile/code/index.js rename to cli/profile/code/index.js diff --git a/apm-lambda-extension/cli/profile/elasticagent/index.js b/cli/profile/elasticagent/index.js similarity index 100% rename from apm-lambda-extension/cli/profile/elasticagent/index.js rename to cli/profile/elasticagent/index.js diff --git a/apm-lambda-extension/cli/profile/elasticagent/package-lock.json b/cli/profile/elasticagent/package-lock.json similarity index 100% rename from apm-lambda-extension/cli/profile/elasticagent/package-lock.json rename to cli/profile/elasticagent/package-lock.json diff --git a/apm-lambda-extension/cli/profile/elasticagent/package.json b/cli/profile/elasticagent/package.json similarity index 100% rename from apm-lambda-extension/cli/profile/elasticagent/package.json rename to cli/profile/elasticagent/package.json diff --git a/apm-lambda-extension/cli/profile/noagent/index.js b/cli/profile/noagent/index.js similarity index 100% rename from apm-lambda-extension/cli/profile/noagent/index.js rename to cli/profile/noagent/index.js diff --git a/apm-lambda-extension/cli/tests/build-and-publish.test.js b/cli/tests/build-and-publish.test.js similarity index 100% rename from apm-lambda-extension/cli/tests/build-and-publish.test.js rename to cli/tests/build-and-publish.test.js diff --git a/apm-lambda-extension/cli/tests/profile.test.js b/cli/tests/profile.test.js similarity index 100% rename from apm-lambda-extension/cli/tests/profile.test.js rename to cli/tests/profile.test.js diff --git a/apm-lambda-extension/cli/tests/update-layer.test.js b/cli/tests/update-layer.test.js similarity index 100% rename from apm-lambda-extension/cli/tests/update-layer.test.js rename to cli/tests/update-layer.test.js diff --git a/apm-lambda-extension/cli/update-function-env.js b/cli/update-function-env.js similarity index 100% rename from apm-lambda-extension/cli/update-function-env.js rename to cli/update-function-env.js diff --git a/apm-lambda-extension/cli/update-layer.js b/cli/update-layer.js similarity index 100% rename from apm-lambda-extension/cli/update-layer.js rename to cli/update-layer.js diff --git a/apm-lambda-extension/dependencies.asciidoc b/dependencies.asciidoc similarity index 100% rename from apm-lambda-extension/dependencies.asciidoc rename to dependencies.asciidoc diff --git a/apm-lambda-extension/e2e-testing/.e2e_test_config b/e2e-testing/.e2e_test_config similarity index 100% rename from apm-lambda-extension/e2e-testing/.e2e_test_config rename to e2e-testing/.e2e_test_config diff --git a/apm-lambda-extension/e2e-testing/.gitignore b/e2e-testing/.gitignore similarity index 100% rename from apm-lambda-extension/e2e-testing/.gitignore rename to e2e-testing/.gitignore diff --git a/apm-lambda-extension/e2e-testing/README.md b/e2e-testing/README.md similarity index 100% rename from apm-lambda-extension/e2e-testing/README.md rename to e2e-testing/README.md diff --git a/apm-lambda-extension/e2e-testing/e2e_test.go b/e2e-testing/e2e_test.go similarity index 99% rename from apm-lambda-extension/e2e-testing/e2e_test.go rename to e2e-testing/e2e_test.go index f8c86bd3..8481f15d 100644 --- a/apm-lambda-extension/e2e-testing/e2e_test.go +++ b/e2e-testing/e2e_test.go @@ -18,7 +18,7 @@ package e2eTesting import ( - "elastic/apm-lambda-extension/logger" + "github.com/elastic/apm-aws-lambda/logger" "flag" "fmt" "io" diff --git a/apm-lambda-extension/e2e-testing/e2e_util.go b/e2e-testing/e2e_util.go similarity index 99% rename from apm-lambda-extension/e2e-testing/e2e_util.go rename to e2e-testing/e2e_util.go index b51de712..42bb63a6 100644 --- a/apm-lambda-extension/e2e-testing/e2e_util.go +++ b/e2e-testing/e2e_util.go @@ -29,7 +29,7 @@ import ( "path/filepath" "strings" - "elastic/apm-lambda-extension/apmproxy" + "github.com/elastic/apm-aws-lambda/apmproxy" "go.uber.org/zap" ) diff --git a/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/build.gradle b/e2e-testing/sam-java/sam-testing-java/build.gradle similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/build.gradle rename to e2e-testing/sam-java/sam-testing-java/build.gradle diff --git a/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/gradlew b/e2e-testing/sam-java/sam-testing-java/gradlew similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/gradlew rename to e2e-testing/sam-java/sam-testing-java/gradlew diff --git a/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/gradlew.bat b/e2e-testing/sam-java/sam-testing-java/gradlew.bat similarity index 96% rename from apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/gradlew.bat rename to e2e-testing/sam-java/sam-testing-java/gradlew.bat index ac1b06f9..107acd32 100644 --- a/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/gradlew.bat +++ b/e2e-testing/sam-java/sam-testing-java/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/src/main/java/samtestingjava/App.java b/e2e-testing/sam-java/sam-testing-java/src/main/java/samtestingjava/App.java similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/src/main/java/samtestingjava/App.java rename to e2e-testing/sam-java/sam-testing-java/src/main/java/samtestingjava/App.java diff --git a/apm-lambda-extension/e2e-testing/sam-java/template.yml b/e2e-testing/sam-java/template.yml similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-java/template.yml rename to e2e-testing/sam-java/template.yml diff --git a/apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/.npmignore b/e2e-testing/sam-nodejs/sam-testing-nodejs/.npmignore similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/.npmignore rename to e2e-testing/sam-nodejs/sam-testing-nodejs/.npmignore diff --git a/apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/app.js b/e2e-testing/sam-nodejs/sam-testing-nodejs/app.js similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/app.js rename to e2e-testing/sam-nodejs/sam-testing-nodejs/app.js diff --git a/apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/package.json b/e2e-testing/sam-nodejs/sam-testing-nodejs/package.json similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/package.json rename to e2e-testing/sam-nodejs/sam-testing-nodejs/package.json diff --git a/apm-lambda-extension/e2e-testing/sam-nodejs/template.yml b/e2e-testing/sam-nodejs/template.yml similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-nodejs/template.yml rename to e2e-testing/sam-nodejs/template.yml diff --git a/apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/__init__.py b/e2e-testing/sam-python/sam-testing-python/__init__.py similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/__init__.py rename to e2e-testing/sam-python/sam-testing-python/__init__.py diff --git a/apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/app.py b/e2e-testing/sam-python/sam-testing-python/app.py similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/app.py rename to e2e-testing/sam-python/sam-testing-python/app.py diff --git a/apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/requirements.txt b/e2e-testing/sam-python/sam-testing-python/requirements.txt similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/requirements.txt rename to e2e-testing/sam-python/sam-testing-python/requirements.txt diff --git a/apm-lambda-extension/e2e-testing/sam-python/template.yml b/e2e-testing/sam-python/template.yml similarity index 100% rename from apm-lambda-extension/e2e-testing/sam-python/template.yml rename to e2e-testing/sam-python/template.yml diff --git a/apm-lambda-extension/extension/client.go b/extension/client.go similarity index 100% rename from apm-lambda-extension/extension/client.go rename to extension/client.go diff --git a/apm-lambda-extension/extension/client_test.go b/extension/client_test.go similarity index 100% rename from apm-lambda-extension/extension/client_test.go rename to extension/client_test.go diff --git a/apm-lambda-extension/extension/process_env.go b/extension/process_env.go similarity index 99% rename from apm-lambda-extension/extension/process_env.go rename to extension/process_env.go index 6d0e90c6..b747ce5c 100644 --- a/apm-lambda-extension/extension/process_env.go +++ b/extension/process_env.go @@ -19,7 +19,7 @@ package extension import ( "context" - "elastic/apm-lambda-extension/logger" + "github.com/elastic/apm-aws-lambda/logger" "encoding/base64" "fmt" "os" diff --git a/apm-lambda-extension/extension/process_env_test.go b/extension/process_env_test.go similarity index 100% rename from apm-lambda-extension/extension/process_env_test.go rename to extension/process_env_test.go diff --git a/apm-lambda-extension/extension/util.go b/extension/util.go similarity index 100% rename from apm-lambda-extension/extension/util.go rename to extension/util.go diff --git a/apm-lambda-extension/extension/version.go b/extension/version.go similarity index 100% rename from apm-lambda-extension/extension/version.go rename to extension/version.go diff --git a/apm-lambda-extension/go.mod b/go.mod similarity index 97% rename from apm-lambda-extension/go.mod rename to go.mod index 4ca6edb4..1dd77f6f 100644 --- a/apm-lambda-extension/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module elastic/apm-lambda-extension +module github.com/elastic/apm-aws-lambda go 1.19 diff --git a/apm-lambda-extension/go.sum b/go.sum similarity index 100% rename from apm-lambda-extension/go.sum rename to go.sum diff --git a/apm-lambda-extension/logger/logger.go b/logger/logger.go similarity index 100% rename from apm-lambda-extension/logger/logger.go rename to logger/logger.go diff --git a/apm-lambda-extension/logger/logger_test.go b/logger/logger_test.go similarity index 98% rename from apm-lambda-extension/logger/logger_test.go rename to logger/logger_test.go index c0215e5e..ae176b5a 100644 --- a/apm-lambda-extension/logger/logger_test.go +++ b/logger/logger_test.go @@ -18,7 +18,7 @@ package logger_test import ( - "elastic/apm-lambda-extension/logger" + "github.com/elastic/apm-aws-lambda/logger" "os" "testing" diff --git a/apm-lambda-extension/logger/option.go b/logger/option.go similarity index 100% rename from apm-lambda-extension/logger/option.go rename to logger/option.go diff --git a/apm-lambda-extension/logsapi/client.go b/logsapi/client.go similarity index 100% rename from apm-lambda-extension/logsapi/client.go rename to logsapi/client.go diff --git a/apm-lambda-extension/logsapi/client_test.go b/logsapi/client_test.go similarity index 99% rename from apm-lambda-extension/logsapi/client_test.go rename to logsapi/client_test.go index cb75cf0c..d3878528 100644 --- a/apm-lambda-extension/logsapi/client_test.go +++ b/logsapi/client_test.go @@ -19,7 +19,7 @@ package logsapi_test import ( "bytes" - "elastic/apm-lambda-extension/logsapi" + "github.com/elastic/apm-aws-lambda/logsapi" "encoding/json" "net/http" "net/http/httptest" diff --git a/apm-lambda-extension/logsapi/event.go b/logsapi/event.go similarity index 97% rename from apm-lambda-extension/logsapi/event.go rename to logsapi/event.go index 345b39f8..544633ae 100644 --- a/apm-lambda-extension/logsapi/event.go +++ b/logsapi/event.go @@ -19,8 +19,8 @@ package logsapi import ( "context" - "elastic/apm-lambda-extension/apmproxy" - "elastic/apm-lambda-extension/extension" + "github.com/elastic/apm-aws-lambda/extension" + "github.com/elastic/apm-aws-lambda/apmproxy" "time" ) diff --git a/apm-lambda-extension/logsapi/metrics.go b/logsapi/metrics.go similarity index 97% rename from apm-lambda-extension/logsapi/metrics.go rename to logsapi/metrics.go index e5213c40..36e9e9c5 100644 --- a/apm-lambda-extension/logsapi/metrics.go +++ b/logsapi/metrics.go @@ -20,9 +20,8 @@ package logsapi import ( "math" - "elastic/apm-lambda-extension/apmproxy" - "elastic/apm-lambda-extension/extension" - + "github.com/elastic/apm-aws-lambda/apmproxy" + "github.com/elastic/apm-aws-lambda/extension" "go.elastic.co/apm/v2/model" "go.elastic.co/fastjson" ) diff --git a/apm-lambda-extension/logsapi/metrics_test.go b/logsapi/metrics_test.go similarity index 98% rename from apm-lambda-extension/logsapi/metrics_test.go rename to logsapi/metrics_test.go index 23652848..05f8ba75 100644 --- a/apm-lambda-extension/logsapi/metrics_test.go +++ b/logsapi/metrics_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "elastic/apm-lambda-extension/apmproxy" - "elastic/apm-lambda-extension/extension" + "github.com/elastic/apm-aws-lambda/apmproxy" + "github.com/elastic/apm-aws-lambda/extension" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/apm-lambda-extension/logsapi/option.go b/logsapi/option.go similarity index 100% rename from apm-lambda-extension/logsapi/option.go rename to logsapi/option.go diff --git a/apm-lambda-extension/logsapi/route_handlers.go b/logsapi/route_handlers.go similarity index 100% rename from apm-lambda-extension/logsapi/route_handlers.go rename to logsapi/route_handlers.go diff --git a/apm-lambda-extension/logsapi/route_handlers_test.go b/logsapi/route_handlers_test.go similarity index 100% rename from apm-lambda-extension/logsapi/route_handlers_test.go rename to logsapi/route_handlers_test.go diff --git a/apm-lambda-extension/logsapi/subscribe.go b/logsapi/subscribe.go similarity index 100% rename from apm-lambda-extension/logsapi/subscribe.go rename to logsapi/subscribe.go diff --git a/apm-lambda-extension/main.go b/main.go similarity index 97% rename from apm-lambda-extension/main.go rename to main.go index c3e4921b..fbc7069b 100644 --- a/apm-lambda-extension/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( "path/filepath" "syscall" - "elastic/apm-lambda-extension/app" + "github.com/elastic/apm-aws-lambda/app" ) func main() { diff --git a/apm-lambda-extension/main_test.go b/main_test.go similarity index 99% rename from apm-lambda-extension/main_test.go rename to main_test.go index a7fe9341..1bf0b0dd 100644 --- a/apm-lambda-extension/main_test.go +++ b/main_test.go @@ -31,11 +31,11 @@ import ( "testing" "time" - "elastic/apm-lambda-extension/app" - e2eTesting "elastic/apm-lambda-extension/e2e-testing" - "elastic/apm-lambda-extension/extension" - "elastic/apm-lambda-extension/logger" - "elastic/apm-lambda-extension/logsapi" + "github.com/elastic/apm-aws-lambda/app" + e2eTesting "github.com/elastic/apm-aws-lambda/e2e-testing" + "github.com/elastic/apm-aws-lambda/extension" + "github.com/elastic/apm-aws-lambda/logger" + "github.com/elastic/apm-aws-lambda/logsapi" "github.com/google/uuid" "github.com/stretchr/testify/assert" diff --git a/apm-lambda-extension/scripts/notice.sh b/scripts/notice.sh similarity index 100% rename from apm-lambda-extension/scripts/notice.sh rename to scripts/notice.sh diff --git a/apm-lambda-extension/scripts/overrides/overrides.json b/scripts/overrides/overrides.json similarity index 100% rename from apm-lambda-extension/scripts/overrides/overrides.json rename to scripts/overrides/overrides.json diff --git a/apm-lambda-extension/scripts/rules.json b/scripts/rules.json similarity index 100% rename from apm-lambda-extension/scripts/rules.json rename to scripts/rules.json diff --git a/apm-lambda-extension/scripts/templates/NOTICE.txt.tmpl b/scripts/templates/NOTICE.txt.tmpl similarity index 100% rename from apm-lambda-extension/scripts/templates/NOTICE.txt.tmpl rename to scripts/templates/NOTICE.txt.tmpl diff --git a/apm-lambda-extension/scripts/templates/dependencies.asciidoc.tmpl b/scripts/templates/dependencies.asciidoc.tmpl similarity index 100% rename from apm-lambda-extension/scripts/templates/dependencies.asciidoc.tmpl rename to scripts/templates/dependencies.asciidoc.tmpl