SignalFX Java Training example
Assumes properly setup SignalFx Smart Agent as described here: https://docs.signalfx.com/en/latest/apm2/apm2-getting-started/apm2-smart-agent.html
How to build: ( linux )
-
Git Clone this Repository
-
Install Maven:
sudo apt-get install maven
-
Build from Local Repository directory ( where pom.xml is )
sudo mvn install
-
Set Environment Variables
#SIGNALFX_ENDPOINT_URL='http://localhost:9080/v1/trace' - only required if Agent is on another host
SIGNALFX_INGEST_URL=https://ingest.YourRealm.signalfx.com SIGNALFX_SERVICE_NAME=SfxCurrencyConverterInstrumented SIGNALFX_TOKEN=
NOTE SIGNALFX_TRACE_METHODS is only required for Auto-Instrunentation of custom methods SIGNALFX_TRACE_METHODS= package.class[method1,method2]
-
Run the Example:
mvn exec:java -Dexec.mainClass="com.signalfx.training.SfxCurrencyConverterInstrumented"
mvn exec:java -Dexec.mainClass="com.signalfx.training.SfxCurrencyConverter"
Jetty - you can run this example with a Jetty webserver.
mvn exec:java -Dexec.mainClass="com.signalfx.training.SfxCurrencyConverterServer"
Then Goto: http://localhost:8888/?amt=amountToConvert. example http://localhost:8888/?amt=100
Set the Folowing Environment Variable: SIGNALFX_TRACE_METHODS=com.signalfx.training.SfxCurrencyConverterAuto[doConversion,convertMyAmount]
mvn exec:java -Dexec.mainClass="com.signalfx.training.SfxCurrencyConverterServerAuto"
Then Goto: http://localhost:8888/?amt=amountToConvert. example http://localhost:8888/?amt=100