Improved Instructions for Deploying split2DynatraceAws

git clone https://github.com/dbmartin00/split2DynatraceAws.git
cd split2DynatraceAws

Edit your src/main/java/attachedRules.json and src/main/java/split2dynatrace.config as discussed in main documentation.

mvn install

This compiles everything with its dependencies. Now there should be a target/ subdirectory with compiled code.

find . -name \*.class
./target/classes/io/split/dbm/integrations/split2dynatrace/TagRule.class
./target/classes/io/split/dbm/integrations/split2dynatrace/LambdaFunctionHandler.class
./target/classes/io/split/dbm/integrations/split2dynatrace/SplitChange.class
./target/classes/io/split/dbm/integrations/split2dynatrace/AttachedRules.class
./target/classes/io/split/dbm/integrations/split2dynatrace/Tag.class
./target/classes/io/split/dbm/integrations/split2dynatrace/Configuration.class

Copy the JAR file created into a lib directory, then zip the directory for upload to AWS.

cp src/main/java/split2dynatrace.config .
cp src/main/java/attachedRules.json .
mkdir lib
cp target/split2dynatrace-1.0.0.jar lib/
zip -r dynatrace.zip *

This wraps up target and src both. That’s OK.

In AWS, I can’t easily capture the specifics, but the steps are as follows:

  • Create a new Lambda for your Java code
  • Choose Java 11 (Corretto)
  • Skip the API Gateway. Instead, give the Lambda a Function URL
  • Auth Type NONE
  • Configure CORS; Add * as an Allow Header
  • Allow method POST

Now upload the dynatrace.zip in the Code screen of your lambda. “Upload from…” “.zip or .jar”…

Change the Runtime settings handler:

io.split.dbm.integrations.split2dynatrace.LambdaFunctionHandler::handleRequest

Copy your function URL into an Audit Log webhook and press to test. At Split, you should get “Test Message Succesful”. You should see this on CloudWatch:

INFO - finished sending annotations to Dynatrace in 5117ms

Written with StackEdit.