To add the Contrast agent in your Google App Engine environment:
Contrast only works in your locally deployed instance of App Engine. Google App Engine in the cloud does not support the Java instrumentation libraries that Contrast requires, but you can still run this integration locally.
-
If you use Maven to deploy your application, you need to edit your pom.xml file under
<build>/<plugins>/<plugin>
with agroupid
of<groupId>com.google.appengine</groupId>
andartifactid
of<artifactId>appengine-maven-plugin</artifactId>
. -
Replace
<YourContrastJarPath>
with the path to your Contrast JAR and<YourAppName>
with the name of your application. Then add this code:<configuration> <jvmFlags> <jvmFlag>-javaagent:<YourContrastJarPath></jvmFlag> <jvmFlag>-Dcontrast.application.name=<YourAppName></jvmFlag> </jvmFlags> </configuration>
The result should look like this:
<plugin> <groupId>com.google.appengine</groupId> <artifactId>appengine-maven-plugin</artifactId> <version>1.9.0</version> <configuration> <jvmFlags> <jvmFlag>-javaagent:<YourContrastJarPath></jvmFlag> <jvmFlag>-Dcontrast.application.name=<YourAppName></jvmFlag> </jvmFlags> </configuration> </plugin>
If you don't provide the
-Dcontrast.application.name
JVM flag, Contrast will refer to your application by the nameROOT
. -
After you edit the file, install and run the Java agent with the following commands:
mvn clean install mvn appengine:devserver
-
When you launch your application, the Contrast Java agent will instrument and monitor it.