In FusionReactor 6.0.0 we have added the ability to name the Application for each web request. This feature allows for a greater break down of requests by each application. There are many different ways to name the application and FusionReactor will automatically try all options, however there is a priority order.
- Request attribute (fr.application.name)
- Middleware server (e.g.CFAPPLICATION)
- Servlet init parameter (fr.application.name)
- Filter init parameter (fr.application.name)
- Web app context parameter (fr.application.name)
- Web app context name (display-name)
- Web app servlet context path
- The Default Application Name
In the event that FusionReactor is unable to detect the name of the application via any of the options above (or if the automatic application naming is disabled), it will default to name set as the default. This is set in the FusionReactor -> Settings page (http://docs.intergral.com/display/FR60/Settings).
If you want to override the automatic naming detected by FusionReactor you can set the name for the application using request attributes of parameters at different levels (context, filter and servlet). In all cases the key used is fr.application.name.
To set the application name used by FusionReactor as a context parameter, edit the web.xml file and add the following code block.
To set the application name used by FusionReactor as a filter init parameter, edit the filter configuration and add the property fr.application.name with the value being the name of the application. This can be done via the web.xml adding the parameter to the filter definition.
Similar to the filter parameter settings you can set the application name for FusionReactor to use as a servlet init parameter. This is also done via the web.xml file.
To set the application name with a request attribute simply add the attribute to the request object. FusionReactor will then use this attribute as the application name when the request is complete. This approach will only affect the requests where this attribute is set.
To set the application name with the FusionReactor API (FRAPI) you simply need to call the appropriate method within your code. This method of setting the application name takes precedence over all other methods, however it will only affect the single request where this method is called.
FusionReactor will automatically name applications using a few different ways, FusionReactor will try all of these methods without needing any additional settings.
With some application servers it is possible to set the name of the application in the code. For example in Coldfusion you can set the name of the application using the <CFAPPLICATION> tag.
The most common name will become the application context name. This name is defined in the web.xml for the application, using the display-name element.
The last resort for the application name before it becomes the default is to use the context path for the application. This is the root of the URL for the application.
This image shows the URL for the Apache Tomcat Manager app, where the context paht is /manager.
When running microservices or other small J2EE servers its nice to be able to set the application name to a single value for the whole server if the server is only running one application. E.g dev_website or prod_website.
You can configure this by disabling Auto Application Naming in the FusionReactor Settings. This is set in the FusionReactor -> Settings page (http://docs.intergral.com/display/FR60/Settings). You can these configure the Default Application Name to be the name of your application. E.g dev_website. This will result in all information that FusionReactor tracks be attributed to this application name.
Both these settings can be set at the command line too.
- -Dfr.application.name can be used to set the default application name
- -Dfr.application.auto_naming can be used to enable or disable the automatic application naming.
So the following would set the application name to be dev_website for all transactions :