Skip to main content

WCF and Web Service monitoring configuration

Note

This page applies only to WhaTap .NET agent version 2.4.4 or earlier.

To monitor libraries that are not officially supported by the WhaTap .NET agent, such as WCF (Windows Communication Foundation), follow the guidance below.

Caution

Extensive configuration may cause excessive traffic.

Configuration guide

The following are agent configuration options for tracing WCF and Web services.

  • webservice_method_enabled Boolean

    Default false

    If the value has been set to true, web services can be traced.

    Note

    To apply the set values, restart IIS.

  • webservice_method_prefix String

    Enter the namespace and class name that define the methods you want to trace.

    • If you specify up to the class name that contains the methods, all public methods within that class become trace targets.

    • Methods that meet the conditions are traced even if they do not use web services. Although this option was designed for monitoring WCF and web services, it can be used for various other purposes.

    Note

    Restart IIS to apply the configured values.

    See the following example:

    whatap.conf
    webservice_method_prefix=Test.Demo, WebServiceDemo.WebService.
  • webservice_method_prefix_realtime Boolean .NET Agent v2.3.6 or later

    Default false

    If you set the value to true, the target of webservice_method_prefix is processed in real time as the previous.

  • webservice_method_timeout Integer

    Default 5000 (Millisecond, ms)

    If exception handling is not performed in the method to be monitored, it is impossible to know the time when the transaction will end. For such cases, the timeout of web service monitoring occurs by default after 5 seconds. You can adjust the timeout by changing this option value.

Usage examples

Modifying the agent configuration file

See the example for the agent configuration file (whatap.conf) for the WCF and Web service tracing.

whatap.conf
license=...
whatap.server.host=15.165.146.117
whatap.server.port=6600
app_process_name=w3wp.exe
tag_counter_enabled=true
perfcounter.enabled=true
app_name=...
OID=...

webservice_method_enabled=true
webservice_method_prefix=Whatap.Service.Controller, Whatap.DotNet.Examples.Service1
webservice_method_timeout=10000
  • The start and end of a function can be handled as a transaction, if the call path of the method containing the namespace is one of the following:

    Whatap.Service.Controller, Whatap.DotNet.Examples.Service1
  • Because the webservice_method_timeout option has been set to 10,000 (ms), transactions that take more than 10 seconds are automatically terminated.

Tip

In Management > Agent CONF., some options can be added. For more information about Agent CONF., see the following.

Trace analysis

Example of WCF source code to be monitored

The following WCF source code example guides you to a case to be monitored.

namespace Whatap.DotNet.Examples
{
public class Service1 : IService1
{
public string GetData(int value)
{
...
}

public CompositeType GetDataUsingDataContract(CompositeType composite)
{
...
}

private string getFromDB()
{
...
}

private string getFromHttp()
{
...
}
}

public class Service2 : IService1
{
...
}

public class Service3 : IService1
{
public string IwantToSeeOnlyThis(int value)
{
...
}
}
}

The GetData() method to be monitored belongs to the Service1 class of the Whatap.DotNet.Examples namespace. Therefore, the call path for the method is:

Whatap.DotNet.Examples.Service1.GetData

This is treated as a transaction because it starts from the value (Whatap.DotNet.Examples.Service1) of the webservice_method_prefix specified in the agent configuration file (whatap.conf).

  • The GetDataUsingDataContract() method is to be monitored because it is a public method.

  • The getFromDB() and getFromHttp() methods are excluded from monitoring because they are private methods.

For Web Service

For Web Service applications, locate the .asmx file in the deployment folder. Open the file in a text editor and check the value specified in the Class attribute. This value is the information that must be added to webservice_method_prefix.

Web Service