-
Notifications
You must be signed in to change notification settings - Fork 3
Configuration
There are two applications that we will need to provide an application.properties file to configure.
To run the application in "dev" mode, there is already an application-dev.properties file in the project. You can modify it as you wish. Another option is to copy the file as "application.properties" to the same resources folder. Note that this is by git as we don't want to have a global configuration file in the application.
If you want to use the jar file provided in the release part, as there is no application.properties file included in the jar file itself, you will need to put "application.properties" file to the same folder that your jar file is.
For more information about this, you can visit Running using Maven page.
As an agent can run for one application at the same time, and there can more than one supported application in the agent itself, we will need to tell the application to run for which application. Let's say agent will work with EasyTravel application. (Supported by default)
scenario.application=easyTravel
This config is to tell application to start for which application. Related service will be registered accordingly. You can see ScenarioServiceConfig.java
file to understand more about this.
easyTravel.apiUrl=http://localhost:8091
In easyTravel's case we will need some additional configs. So, we have EasyTravelConfigurationProperties.java
file to access easyTravel related configs. If you need something like this for your own application, you can create one and use it in the same way.
easyTravel.availableScenarios[0].name=CPULoad
easyTravel.availableScenarios[0].minTime=20
easyTravel.availableScenarios[0].maxTime=200
easyTravel.availableScenarios[1].name=CrashCouchDB
Scenarios need some basic configurations. In easyTravel's case, we decided to restrict the available error patterns so we have availableScenarios config. This config is an array and you can define as many error patterns as you want. You need to be careful about giving the exact name of the error pattern in easyTravel to the name field.
We also have a config that specifies the minimum and maximum time allowed for a scenario. In easyTravel's case, we decide this through config (may be different for other apps). If you don't specify min and max time for a scenario, it is set as min=60
and max=180
seconds by default.
OpsGenie Playground - https://opsgenie.com/playground