Monitor a Web Application through Servlet Monitoring

Oracle Application Performance Monitoring is capable of monitoring Java web applications by instrumenting the application's Filters and Servlets, through Servlet Monitoring.

When a request is made to a web application / Servlet, a Server Request will be created with type SERVLET. The name of this Server Request will be the request URL path, without the schema, port, host, and query parameters.

For example, if a user calls http://localhost:7654/contextRoot/test.jspx?param1=value1&param2=value2, the default Server Request name will be /contextRoot/test.jspx.

Topics:

Frameworks

Servlet Monitoring detects some popular UI frameworks automatically and appends the name of the framework to the Server Request type. For example, if the framework detected is JSF, the Server Request type will be SERVLET_JSF. Here is the list of frameworks that are detected:

  • STRUTS1

  • STRUTS2

  • JSF

  • SPRING_MVC

  • JERSEY

  • APACHE_CXF

  • RESTEASY

  • APACHE_WINK

  • RESTLET

  • LIFERAY

  • Oracle ADF-UI

    Note: For the framework Oracle ADF-UI, the Server Request type will be SERVLET_ADF_UI.

Special Cases

There are two special Servlet related Server Requests that are used to prevent an excessive number of unique Server Requests.

  • Not-Found: Groups together Server Requests that resulted in a HTTP 404 (Not Found) response status.

  • Invalid-URL: Groups together Server Requests that resulted in a HTTP 500 response status due to using an invalid URL. For example, you will see this Server Request if the following Servlet frameworks are used with invalid URLs:

    • JSF (JavaServer Faces) 2.x

    • Struts 1.x

Configuring Servlet Monitoring

You can configure Servlet Monitoring to prevent monitoring of certain pages/resources in your application.

Without a configuration, Servlet Monitoring would monitor all requests to the web application. In many cases, however, you may not want to monitor all requests. For example, you might not want to monitor requests for static resources such as images and HTML files. For this reason, there is a default servlet configuration that is configured to not monitor requests with the following file extensions: bmp, css, png, swz, jar, htm, html, dtd, mpeg, jpg, dat, mpg, mid, properties, js, ico, class, tif, gif, jpeg, swf, cur, and woff. This selective monitoring is specified by way of a snippet of JSON configuration code that appears in the default servlet configuration:

{
    "type" : "servlet",
    "extensionGroups" : {
        "default" : [ ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur", ".woff" ]
    },
    "excludedContextRoots" : [ "/bea_wls_management_internal2", "/bea_wls_cluster_internal", "/bea_wls_internal", "/soa-infra", "/bea_wls_deployment_internal", "/empbs" ],
    "excludedServletClasses" : [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet", "oracle.webcenter.content.http.GetHandlerServlet" ],
    "excludedServletPackages" : [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig" : {
        "extensionGroup" : "default",
        "patternReplacements" : [
            {"patternString" : "[0-9][0-9][0-9][0-9][:-][01]?[0-9][:-][0-9]?[0-9](T)?", "replaceString" : "*$1"},
            {"patternString" : "[012]?[0-9]:[0-9][0-9]:[0-9][0-9](Z)?", "replaceString" : "*$1"},
            {"patternString" : "/_/.*", "replaceString" : "/*"},
            {"patternString" : "/[0-9a-zA-Z_\\.]{14,}[=|-]{1,2}(/|$)", "replaceString" : "/*$1"},
            {"patternString" : "([a-fA-F\\._\\:-]*[0-9]+){2,}[a-fA-F_\\:-]*([/\\.])?", "replaceString" : "*$2"}
        ]
    }

You can edit this default JSON configuration code in order to control the types of requests that are monitored. You can also add JSON values to control how your application's Server Request names are abbreviated for display in the Oracle Application Performance Monitoring UI (Server Request names are derived from request URLs).

The servlet configuration can be found in two places:
  • <DOMAIN_HOME>/apmagent/config/Servlet.json - If this file is modified, all agents on this domain will be updated to use the new configuration.

  • <DOMAIN_HOME>/apmagent/config/<server-name>/Servlet.json - If this file is modified, only the agent on that specific server will be updated to use the new configuration.

After the configuration is changed, you need not restart the application server, as the agent will automatically detect the change, and update within a minute.

Browser Agent Configuration

Browser Agent Configuration uses the same format as the Servlet Configuration, but targets Pages instead of Server Requests. When a Page is excluded, Browser Injection will not be performed on it, which will cause the Page and its AJAX Calls to not be monitored. This configuration uses the following options:

  • Extension exclusion (extensionGroup and extensionGroups)

  • excludedContextRoots

  • excludedServletClasses

  • excludedServletPackages

  • Pattern Matching

The type option determines if the configuration targets Servlet Monitoring or the Browser Agent. Servlet uses servlet and Browser Agent uses browseragent. For example, here is the default BrowserAgent.json:

{
    "type" : "browseragent",
    "extensionGroups" : {
        "default" : [ ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur", ".woff" ]
    },
    "excludedContextRoots" : [ "/bea_wls_management_internal2", "/bea_wls_cluster_internal", "/bea_wls_internal", "/soa-infra", "/bea_wls_deployment_internal", "/empbs" ],
    "excludedServletClasses" : [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet", "oracle.webcenter.content.http.GetHandlerServlet" ],
    "excludedServletPackages" : [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig" : {
        "extensionGroup" : "default"
    }
}

Note the type at the top. In addition, the default browser agent configuration does not exclude .html by default, since .html is necessary to monitor some web application frameworks properly (such as Jet).

The Browser Agent configuration can be found in two places:
  • <DOMAIN_HOME>/apmagent/config/BrowserAgent.json - If this file is modified, all agents on this domain will be updated to use the new configuration.

  • <DOMAIN_HOME>/apmagent/config/<server-name>/BrowserAgent.json - If this file is modified, only the agent on that specific server will be updated to use the new configuration.

If the BrowserAgent.json is removed and the application server is restarted, it will use the Servlet.json configuration instead.

Servlet Configuration Options

You can specify various servlet configuration options to change how your web application / servlet is being monitored by Oracle Application Performance Monitoring.

ServletConfiguration

The following is the outermost object in the .json file, and represents the ServletConfiguration class:

{
    "type": "servlet",
    "extensionGroups": {
        "default" : [ ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat" ],
        "test" : [".js", "htm", "html" ]
    },
    "excludedContextRoots": [ "/console", "/em"],
    "excludedFrameworks": [ "JERSEY", "STRUTS1" ],
    "excludedServletClasses": [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet"],
    "excludedServletPackages": [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig": {},
    "frameworkConfigs": {
        "ADF_UI" : {},
        "STRUTS2" : {}
    },
    "deploymentConfigs": {
        "/queryRunner" : {},
        "/simpleServlet" : {}
    },
    "urlConfigs": [{}, {}]
}

Here is the list of classes in the above code, and their description.

Class Description
type (String) Indicates the type of JSON configuration. The servlet configuration uses servlet. The Browser Agent configuration, which uses the same JSON format uses browseragent.
extensionGroups (Map) Key is the group name, value is the array of file extensions (For example, .jpg, .png, .gif). Extensions that do not start with a "." will have it added in the agent run-time. The group name is used in the ScopeConfiguration object.
excludedContextRoots (Array) List of context-roots that should not be monitored. Context-roots that do not start with a "/" will have it added in the agent run-time.
excludedFrameworks (Array) List of frameworks that should not be monitored. You can exclude any of these frameworks: STRUTS1, STRUTS2, JSF, SPRING_MVC, JERSEY, APACHE_CXF, RESTEASY, APACHE_WINK, RESTLET, LIFERAY, ADF_UI.  Through the apmUi you can specify which Server Requests are related to which frameworks based on the type (SERVLET_FRAMEWORK_NAME).
excludedServletClasses (Array) List of full servlet class names that should not be monitored.
excludedServletPackages (Array) List of servlet Java packages that should not be monitored.
defaultConfig (Object) ScopeConfiguration object. This will be used if a request does not use any of the specified frameworkConfigs, deploymentConfigs, or urlConfigs.
frameworkConfigs (Map) Key is framework name. Value is ScopeConfiguration object. Currently supported framework names: STRUTS1, STRUTS2, JSF, SPRING_MVC, GWT, JERSEY, APACHE_CXF, RESTEASY, APACHE_WINK, RESTLET, LIFERAY, ADF_UI. This can be used to create a configuration that targets all requests that are from a particular framework. deploymentConfigs and urlConfigs take precedence over this.
deploymentConfigs (Map) Key is context-root. Value is ScopeConfiguration object. This can be used to create a configuration that targets all requests that are for a particular deployment/application. urlConfigs takes precedence over this.
urlConfigs (Array) List of UrlConfiguration objects. This can be used to create a configuration that targets all requests with URLs that fit a particular regex pattern.

UrlConfiguration

The UrlConfiguration is used to create ScopeConfigurations that are based on a regex pattern, instead of a framework name or context-root.

Note:

This check is run on every request. Use this option only if the context root is not sufficient.
{
    "patternString" : ".*/test/.*",
    "config" : {}
}
Class Description
patternString (String) A regex pattern.  This is used to determine if the specified config should be used.
config (Object) ScopeConfiguration object.

ScopeConfiguration

ScopeConfiguration is the configuration that targets a specific scope (framework, deployment, URL).

{
    "extensionGroup" : "default",
    "patternMatching" : [{}, {}],
    "patternMappings" : [{}, {}],
    "patternReplacements" : [{}, {}],
    "frameworkOptions" : {},
    "parameterGroups" : [ [ "param5" ], [ "param1", "param4", "param2" ], [ "param3", "param1", "param2" ], ["param6"] ],
    "headerGroups" : [ [ "header5" ], [ "header1", "header4", "header2" ], [ "header3", "header1", "header2" ], ["header6"] ]
}
Class Description
extensionGroup (String) Specifies which extension group this particular scope uses. All extensions in the specified extension group will be excluded.
patternMatching (Array) List of PatternMatcher objects. It works on a match first system. The first pattern that matches the URL determines if it is excluded or not.
patternMappings (Array) List of PatternMapping objects.
patternReplacements (Array) List of PatternReplacement objects.
frameworkOptions (Object) FrameworkOptions object.
parameterGroups (Array) Array of arrays. Each group contains a list of parameters (GET or POST). Servlet Monitoring will check each group in the order specified. If all of the parameters in the group are present, it will add them all to the Server Request name in a format similar to query strings (?param1=value1&param2=value2). If at least one is missing, it will move onto the next group.
headerGroups (Array) Array of arrays. Each group contains a list of HTTP request header names. Servlet Monitoring will check each group in the order specified. If all of the headers in the group are present, it will add them all to the Server Request name in the following format: [header1=value1][header2=value2]

PatternMatcher

This is used to help filter out particular requests by using URL-based regex patterns.

{
    "patternString" : ".*/patternMatching/discover/this",
    "excluded" : false,
    "includeQueryString": false
}
Class Description
patternString (String) A regex pattern.
excluded (Boolean) If true, the URL will be excluded if it matches this pattern. If false, the URL will be monitored if it matches this pattern. Defaults to false if unspecified.
includeQueryString (Boolean) If true, the query string at the end of the URL will be included when applying the pattern. Defaults to false if unspecified.

PatternMapping

This is used to help alter request URLs that match a specified URL-based regex pattern. In particular, it helps group REST-like URLs into a single Server Request.

{
    "patternString" : ".*/patternMapping/convertThis",
    "formatString" : "/patternMapping/intoThis",
    "formatType" : "BASIC",
    "includeQueryString" : false
}
Class Description
patternString (String) A regex pattern.
formatString (String) Used to create a MessageFormat object. You can specify "{#}" in a format to insert particular values. These values are determined by the formatType setting.
formatType (String) Determines how the Server Request name is formatted. Options are: BASIC, POSITION, and GROUP.
includeQueryString (Boolean) If true, the query string at the end of the URL will be included when applying the pattern. Defaults to false if unspecified. For example, in the URL http://localhost:7654/simpleServlet/test/1/2/3?param1=value1&param2=value2, only /simpleServlet/test/1/2/3 will be applied to the regex pattern by default. If includeQueryString is true, it will include ?param1=value1&param2=value2.

PatternReplacement

This is used to help alter request URLs that contain one or more specified regex patterns. All specified PatternReplacements will be applied to the request URL. This is useful for removing common patterns across multiple URL formats, such as dates, IDs, and numbers.

{
    "patternString" : "/[0-9]+/",
    "replaceString" : "/num/"
}
Class Description
patternString (String) A regex pattern.
replaceString (String) Used to replace each occurrence the regex pattern matches.

Note that this utilizes Matcher.replaceAll, so if the regex pattern has a group specified, it can be referenced here using $1, $2, etc.

FrameworkOptions

This is a collection of framework specific options. Currently, options are available only for ADF-UI.

{
    "adf": {}
}
Class Description
adf  (Object) AdfOptions object

AdfOptions

ADF-UI specific configuration options. Some ADF-UI applications are setup to run under a single page, which can cause all requests to fall under a single Server Request by default. These options will help you split apart the Server Request.

All the options utilize the oracle.adf.view.rich.monitoring.UserActivityInfo parameter. The available options will append the following three properties from the UserActivityInfo: regionViewId, componentClientId, and eventType.

If all the three properties are enabled, the format/order will be:

/server/request/name/{regionViewId}/{componentClientId}/{eventType}

{
    "appendRegionViewId": true,
    "removeActivityId": false,
    "componentClientIds" : [ "r1:0:sayHello", "r2:0:sayGoodbye" ],
    "eventTypes" : [ "action", "dialog" ],
    "appendAllComponentClientIds": false,
    "appendAllEventTypes": false
}
Class Description
appendRegionViewId (Boolean) Appends the regionViewId value from UserActivityInfo to the Server Request name if true.
removeActivityId (Boolean) regionViewId typically has the following format: taskFlowName/activityId. If removeActivityId is true, the /activityId will be stripped out. appendRegionViewId must also be true.
componentClientIds (Array) List of componentClientIds that, if detected, will be appended onto the end of the Server Request name. Specified componentClientIds will be stripped of sections that contain only numbers. For example, r1:0:sayHello will be reduced to r1:sayHello.
eventTypes (Array) List of eventTypes that, if detected, will be appended onto the end of the Server Request name.
appendAllComponentClientIds (Boolean) Appends the componentClientId value from UserActivityInfo to the Server Request name if true. Overrides componentClientIds.
appendAllEventTypes (Boolean) Appends the eventType value from UserActivityInfo to the Server Request name if true. Overrides eventTypes.

By default, an ADF-UI application will not provide the oracle.adf.view.rich.monitoring.UserActivityInfo parameter. To enable it, add the following context-param to the application's web.xml:

<context-param>
  <description>
    This parameter notifies ADF Faces that the ExecutionContextProvider
    service provider is enabled. When enabled, this will start
    monitoring and aggregating user activity information for the client
    initiated requests. By default, this param is not set or is false.
  </description>
  <param-name>
    oracle.adf.view.faces.context.ENABLE_ADF_EXECUTION_CONTEXT_PROVIDER
  </param-name>
  <param-value>true</param-value>
</context-param>

Examples of Servlet Configuration

Multiple Scopes

If multiple scopes are configured, ScopeConfigurations are checked in the following order, and work on a match-first system: url > deployment > framework > default. The following actions occur on the agent:

  1. Request is picked up by Servlet Monitoring.

  2. Request URL is checked against any specified urlConfig pattern strings. If a match is found, that ScopeConfiguration will be used. Otherwise, the request moves on.

  3. Then, the request moves onto deployments. If the context-root matches any specified under deploymentConfigs, that ScopeConfiguration will be used. Otherwise, the request moves on.

  4. Next, the request moves onto frameworks. If a framework is detected, and it matches any specified under frameworkConfigs, that ScopeConfiguration will be used. Otherwise, the request moves on.

  5. Finally, the request will use the defaultConfig if nothing else matched.

Below is an example of multiple scopes:

{
    "type" : "servlet",
    "extensionGroups" : {
        "default" : [ ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur", ".woff" ],
        "framework" : [ ".json" ],
        "deployment" : [ ".docx" ],
        "url" : [ ".fake" ]
    },
    "excludedContextRoots" : [ "/bea_wls_management_internal2", "/bea_wls_cluster_internal", "/bea_wls_internal", "/soa-infra", "/bea_wls_deployment_internal", "/empbs" ],
    "excludedServletClasses" : [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet", "oracle.webcenter.content.http.GetHandlerServlet" ],
    "excludedServletPackages" : [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig" : {
        "extensionGroup" : "default"
    },
    "frameworkConfigs": {
        "ADF_UI" : {
            "extensionGroup" : "framework"
        }
    },
    "deploymentConfigs": {
        "/simpleServlet" : {
            "extensionGroup" : "deployment"
        }
    },
    "urlConfigs": [{
        "patternString" : ".*/specialCase/.*",
        "config" : {
            "extensionGroup" : "url"
        }
    }]
}

Here are some example URLs and the result of the above configuration:

  1. http://localhost:7654/simpleServlet/test (context-root: /simpleServlet, framework: none)

    • /simpleServlet/test does not fit the .*/specialCase/.* pattern, so that is skipped.

    • The deploymentConfig settings are specified for /simpleServlet. For this request, the deployment extensionGroup will be used.

    • Request is not excluded because it doesn't end with .docx.

  2. http://localhost:7654/a/faces/specialCase/test.fake (context-root: /a, framework: ADF-UI)

    • /a/b/c/specialCase/test.fake fits the .*/specialCase/.* pattern. For this request, the url extensionGroup will be used.

    • Even though the framework of the request is ADF-UI (which has a frameworkConfig), urlConfig was matched first, so it takes priority.

    • Request ends up getting excluded because .fake is in the url extensionGroup.

  3. http://localhost:7654/b/faces/another/case.fake (context-root: /b, framework: ADF-UI)

    • /b/faces/another/case.fake doesn't match the urlConfig pattern.

    • It also doesn't have the context-root /simpleServlet.

    • It does, however, use the ADF-UI framework.  For this request, the framework extensionGroup will be used.

    • Request is not excluded because it doesn't end with .json.

  4. http://localhost:1234/simpleServlet/test (context-root: /, framework: none)

    • /simpleServlet/test doesn't match the urlConfig's pattern.

    • This is an important step - While the URL does start with the /simpleServlet, it is not the context-root. In this scenario, the deployment is using a blank context-root ("/"). As a result, it doesn't match the deploymentConfig.

    • It also doesn't match the frameworkConfig.

    • Since it did not match other configurations, the defaultConfig is used.  For this request, the "default" extensionGroup will be used.

    • Request is not excluded because it doesn't end with any of the extensions listed in the default group.

Pattern Matching

Pattern matching helps filter out requests that you do not want to monitor.

{
    "type" : "servlet",
    "extensionGroups" : {
        "default" : [ ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur" ]
    },
    "excludedContextRoots" : [ "/bea_wls_management_internal2", "/bea_wls_cluster_internal", "/bea_wls_internal", "/soa-infra", "/bea_wls_deployment_internal" ],
    "excludedServletClasses" : [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet", "oracle.webcenter.content.http.GetHandlerServlet" ],
    "excludedServletPackages" : [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig" : {
        "extensionGroup" : "default",
        "patternMatching" : [ {
            "patternString" : ".*/patternMatching/discover/this",
            "excluded" : false
        }, {
            "patternString" : ".*/patternMatching/and/discover/this",
            "excluded" : false
        }, {
            "patternString" : ".*",
            "excluded" : true
        } ]
    }
}

Servlet Monitoring will step through each pattern in the order specified. It uses match-first logic. For example, if the request URL is http://localhost:7654/simpleServlet/patternMatching/and/discover/this and we use the configuration above:

  • /simpleServlet/patternMatching/and/discover/this would be applied to the first pattern, and fail.

  • It would then be applied to the next pattern. This time it matches. This particular pattern has excluded set to false (that is, included). This means that the request will be monitored.

  • Despite the third pattern excluding everything, it was already matched against the second pattern, so the process is complete.

With the way the three patterns are setup, only URLs that end with /patternMatching/discover/this and /patternMatching/and/discover/this would be monitored. Every other request would be excluded by the third pattern.

Note:

If a pattern fails to match any of the specified patterns, it will be considered included.

Pattern Mapping

Pattern mapping helps manipulate request URLs into more manageable Server Request names in Oracle Application Performance Monitoring. This is handy for handling things such as REST URLs, which commonly have parameters in the URL itself.

{
    "type" : "servlet",
    "extensionGroups" : {
        "default" : [ ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur" ]
    },
    "excludedContextRoots" : [ "/bea_wls_management_internal2", "/bea_wls_cluster_internal", "/bea_wls_internal", "/soa-infra", "/bea_wls_deployment_internal" ],
    "excludedServletClasses" : [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet", "oracle.webcenter.content.http.GetHandlerServlet" ],
    "excludedServletPackages" : [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig" : {
        "extensionGroup" : "default",
        "patternMappings" : [ {
            "patternString" : ".*/patternMapping/convertThis",
            "formatString" : "/patternMapping/intoThis",
            "formatType" : "BASIC"
        }, {
            "patternString" : ".*/patternMapping/this/is/a/path",
            "formatString" : "/{2}/{5}/{6}/{3}/{4}",
            "formatType" : "POSITION"
        }, {
            "patternString" : ".*/patternMapping/regexGroup/(.*)/blank/(.*)",
            "formatString" : "/patternMapping/{2}/{1}",
            "formatType" : "GROUP"
        } ]
    }
}

For example, let's say there is a REST service that accepts the following URL format: http://localhost:7654/calculator/add/{value1}/{value2}. By default all variations of value1 and value2 will be its own Server Request. A pattern mapping can be created to merge all of these into a single /calculator/add Server Request.

In the above example, there are three pattern mapping examples, which use different formatType values: BASIC, POSITION, and GROUP.

  • Example 1 (BASIC) is simple: any URLs that match the pattern will always use /patternMapping/intoThis as the Server Request name.

  • Example 2 (POSITION) is a bit more complicated. In the URL path /cr/patternMapping/this/is/a/path this is the URL position for each part of the URL:

    1. cr

    2. patternMapping

    3. this

    4. is

    5. a

    6. path

    When this is applied to the formatString, we get /patternMapping/a/path/this/is.

  • Example 3 (GROUP) uses Regex groups. In the URL path /cr/patternMapping/regexGroup/example/blank/test, group 1 will be example, and group 2 will be test. When applied to the format, this becomes /patternMapping/test/example.

Pattern Replacement

Pattern replacement helps manipulate request URLs into more manageable Server Request names in Oracle Application Performance Monitoring. This is handy for handling common patterns that may appear in URLs such as IDs (numbers, Hex, Base64), Dates, Times, etc.

 {
    "type" : "servlet",
    "extensionGroups" : {
        "default" : [ ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur", ".woff" ]
    },
    "excludedContextRoots" : [ "/bea_wls_management_internal2", "/bea_wls_cluster_internal", "/bea_wls_internal", "/soa-infra", "/bea_wls_deployment_internal", "/empbs" ],
    "excludedServletClasses" : [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet", "oracle.webcenter.content.http.GetHandlerServlet" ],
    "excludedServletPackages" : [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig" : {
        "extensionGroup" : "default",
        "patternReplacements" : [
            {"patternString" : "/[0-9]+/", "replaceString" : "/num/"},
            {"patternString" : "test([A-Z])", "replaceString" : "t$1"}
        ]
    }
}

For example, let's use the following URL: http://localhost:7654/testA/1234/testB/4321/testC

The above configuration specified two patternReplacements, which will be applied to the URL path in the order specified.

Start: /testA/1234/testB/4321/testC First replacement: /testA/num/testB/num/testC Second replacement: /tA/num/tB/num/tC

The Server Request name will end up being /tA/num/tB/num/tC for that URL.

Partition By Parameter/Header

Here are a few example request URLs, and how the configuration alters them:

{
    "type" : "servlet",
    "extensionGroups" : {
        "default" : [ ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur" ]
    },
    "excludedContextRoots" : [ "/bea_wls_management_internal2", "/bea_wls_cluster_internal", "/bea_wls_internal", "/soa-infra", "/bea_wls_deployment_internal" ],
    "excludedServletClasses" : [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet", "oracle.webcenter.content.http.GetHandlerServlet" ],
    "excludedServletPackages" : [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig" : {
        "extensionGroup" : "default",
        "parameterGroups" : [ [ "param5" ], [ "param1", "param4", "param2" ], [ "param3", "param1", "param2" ], ["param6"] ],
        "headerGroups" : [ [ "header5" ], [ "header1", "header4", "header2" ], [ "header3", "header1", "header2" ], ["header6"] ]
    }
}
  1. http://localhost:7654/simpleServlet/testingParams?param1=value1&param2=value2&param3=value3 (no headers)

    • The first parameter group is checked.  param5 is not set, so the group is skipped.

    • The second parameter group is checked.  param1 is set, but param4 is not, so the group is skipped (doesn't reach the check for param2).

    • The third parameter group is checked.  param3, param1, and param2 are all set, so this group will be used.

    • The values of all three parameters are acquired and placed in the final Server Request name (in the order specified): /simpleServlet/testingParams?param3=value3&param1=value1&param2=value2

  2. http://localhost:7654/simpleServlet/testingParams?param5=value5 (Headers: header6 = headerValue6)

    • The first parameter group is checked.  param5 is set, so this group will be used.

    • The first three header groups are skipped because none of them are set.

    • The final group is checked.  header6 is set, so this group will be used.

    • The values of both the parameter and header are acquired and place in the final Server Request name: /simpleServlet/testingParams?param5=value5 [header6=headerValue6]

  3. http://localhost:7654/simpleServlet/testingParams (Headers: header1=headerValue1, header2=headerValue2, header3=headerValue3, header4=headerValue4)

    • None of the parameter groups are used.

    • The first header group is checked. header5 is not set, so the group is skipped.

    • The second header group is checked. All three headers (1, 4, and 2) are present, so this group will be used.

    • Despite the third header group having three present headers (3, and 1, and 2), we already found a match, so it is not checked.

    • The values of all three headers are acquired and placed in the final Server Request name (in the order specified): /simpleSerlvet/testingParams [header1=headerValue1][header4=headerValue4][header2=headerValue2]

ADF-UI

Example:

{
    "type" : "servlet",
    "extensionGroups" : {
        "default" : [ ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur" ]
    },
    "excludedContextRoots" : [ "/bea_wls_management_internal2", "/bea_wls_cluster_internal", "/bea_wls_internal", "/soa-infra", "/bea_wls_deployment_internal" ],
    "excludedServletClasses" : [ "com.siebel.analytics.web.SAWBridge", "oracle.j2ee.ws.server.provider.ProviderServlet", "oracle.webcenter.content.http.GetHandlerServlet" ],
    "excludedServletPackages" : [ "weblogic.wsee.jaxws.", "weblogic.wsee.server.servlet." ],
    "defaultConfig" : {
        "extensionGroup" : "default",
        "frameworkOptions" : {
            "adf": {
                "appendRegionViewId": true,
                "removeActivityId": true,
                "appendAllComponentClientIds": true,
                "appendAllEventTypes": true
            }
        }
    }
}

Here is an example of the oracle.adf.view.rich.monitoring.UserActivityInfo parameter:

<m xmlns="http://oracle.com/richClient/comm">
  <k v="previous">
    <m>
      <k v="_contextId">
        <s>bf24897846148f26:7253b46:139c113330b:-8000-00000000000005a6</s>
      </k>
      <k v="_clientStartTime">
        <s>1347578879624</s>
      </k>
      <k v="_clientEndTime">
        <s>1347578898966</s>
      </k>
    </m>
  </k>
  <k v="secondary">
    <m>
      <k v="_contextId">
        <s>bf24897846148f26:7253b46:139c113330b:-8000-00000000000005a6:_adfStreaming</s>
      </k>
      <k v="_parentContextId">
        <s>bf24897846148f26:7253b46:139c113330b:-8000-00000000000005a6</s>
      </k>
    </m>
  </k>
  <k v="primary">
    <m>
      <k v="_clientStartTime">
        <s>1347578919325</s>
      </k>
      <k v="_eventInfo">
        <m>
          <k v="eventType">
            <s>action</s>
          </k>
          <k v="componentClientId">
            <s>ptemp:r1:1:tbb1:1:_afrButtonStopNavItem</s>
          </k>
          <k v="componentType">
            <s>oracle.adf.RichCommandTrainStop</s>
          </k>
          <k v="componentDisplayName"/>
          <k v="regionViewId">
        <a n="1">
              <s>/customer-registration-task-flow/defineAddresses</s>
            </a>
          </k>
          <k v="regionViewName">
            <a n="1">
              <s>ptemp:r1</s>
            </a>
          </k>
        </m>
      </k>
      <k v="_pprTargets">
        <s>ptemp:r1</s>
      </k>
    </m>
  </k>
</m>

Servlet Monitoring supports both the new and old formats of UserActivityInfo (newer format is more optimized, replacing longer strings with shorter versions. For example: regionViewId --> rvd, componentClientId --> cld, etc.) If the URL was http://localhost:7654/adfTest/faces/test.jspx with the above UserActivityInfo and servlet configuration, the following would occur:

  • appendRegionViewId is true, so the regionViewId value is used. In this case, it is /customer-registration-task-flow/defineAddresses.

  • removeActivityId is also true. The activity id in this case is the /defineAddresses part of the regionViewId. The result is now /customer-registration-task-flow.

  • Next, appendAllComponentClientIds is true, so the componentClientId value is used. In this case, it is ptemp:r1:1:tbb1:1:_afrButtonStopNavItem. The :{number}: sections of the componentClientId are removed, resulting in ptemp:r1:tbb1:_afrButtonStopNavItem.

  • Finally, appendAllEventTypes is true, so the eventType value is used. In this case, it is action.

  • The three values are now appended onto the end of the Server Request name (separated by "/"). The final Server Request name ends up being /adfTest/faces/test.jspx/customer-registration-task- flow/ptemp:r1:tbb1:_afrButtonStopNavItem/action.