The Fabasoft app.telemetry Software-Telemetry .NET API allows you to instrument any .NET application with instrumentation points to see what's going on in complex applications.
Since version 2023 the Software-Telemetry API supports .NET 6 whereas .NET Framework is no longer supported.
In order to use the Software-Telemetry API in your Microsoft Visual Studio .NET project you have to include app.telemetry API .NET library softwaretelemetry.dll which comes with the app.telemetry API developer resources.
Follow the described steps to include the required resources.
In the Solution Explorer you have to open the context-menu on the project which should be analyzed and click “Properties”. Choose the tab “Reference Paths”. Browse to the Folder where “softwaretelemetry.dll” is located (which is delivered with the app.telemetry Software-Telemetry SDK resources) and add this folder to the Reference paths list.
You also have to add the softwaretelemetry.dll library to the project references.
Select the References-folder in the Solution Explorer of your project and open the context menu and click “Add Reference ...“. Select the softwaretelemetry.dll library via the "Browse" tab from the same location as configured above.
After the references to the softwaretelemetry.dll library is configured correctly you can use the library like this:
using apm;
Here you can see an overview of the app.telemetry Software-Telemetry SDK APM classes inside Microsoft Visual Studio:
The .NET Software-Telemetry SDK is defined in the namespace “apm” which has to be imported by the statement “using apm;” in order to use any constants or methods from the classes defined in the SDK.
Since version 2023 the .NET Software-Telemetry SDK is published additionally as "softwaretelemetry" NuGet Package.
All the constants are static members of the APM class and can be accessed in a static way.
Flags are used to specify the type of an event and are passed as argument to every event call. They are predefined by the API on the base class APM with the data type Byte and have the following possible values:
For more details about the flags and there meaning see the general chapter “Flags”.
An event will only be logged if the event-level is lower or equal to the value selected in the session or log-definition. The log levels are predefined by the API on the base class APM with the data type Byte and have the following possible values:
For more details about the log levels and there meaning see the general chapter “Log Level”.
To use a predefined module create a new APMModule object (by means of calling the constructor) with the predefined module name. This object will be used later to fire events for that module.
For a list of available standard modules with a set of predefined events see chapter “Standard Modules”.
Usage Example |
---|
APMModule mod1 = new APMModule(APM.MODULE_NAME_OS); APMModule mod2 = new APMModule(APM.MODULE_NAME_XMLHTTP); |
The SDK already provides a set of predefined events used for general purpose. For a full listing of all available predefined events see the generic chapter "Predefined Events".
All predefined events are declared and available as global constants on the base class “APM”.
Error/Trace Events:
Use these standard events to mark error, warning or info conditions in your application:
View the language agnostic Application Properties section for an explanation of the properties listed below.
All predefined application property keys and names are available as public constants on the APM class.
View the language agnostic Application Values section for an explanation of the properties listed below.
All predefined application value keys and names are available as public constants on the APM class.
The Aggregation Function Names are static members of the APMCounterOptions class and can be accessed in a static way.
Name | Description |
---|---|
COUNTER_AGGREGATION_FUNCTION_SUM | Sum |
COUNTER_AGGREGATION_FUNCTION_AVG | Average |
COUNTER_AGGREGATION_FUNCTION_MAX | Maximum |
COUNTER_AGGREGATION_FUNCTION_MIN | Minimum |
The APM class is the base class of the Software-Telemetry SDK. It contains all global defined constants as described in chapter “Constants (.NET)”
Use the methods from the APM class in a static way (there is no new instance allocation required).
The APM class supports the following global static methods which do not require an application scope or status:
A detailed description of this class with all methods explained is described in chapter “APM Class and Methods (.NET)”.
APMApplication is the base class for own application implementation and handles the request scope and reporting functions.
After creating an instance with the class constructor passing the application registration information, it stores the application handle inside and provides all context-specific functions for your application.
The APMApplication class supports the following instance/class methods which require an application scope and have to be called on your object instance of APMApplication:
A detailed description of this class with all methods explained is described in chapter ”APMApplication Class and Methods (.NET)”.
APMModule is the base class for own module implementation and is used to fire instrumentation events.
After creating an instance with the class constructor passing the module name, it stores the module handle inside and provides all module-specific functions for your application.
The APMModule class supports the following instance/class methods which require a module scope and have to be called on your object instance of APMModule:
A detailed description of this class with all methods explained is described in chapter “APMModule Class and Methods (.NET)”.
APMParameter is used as data class for generic event parameters.
To define any parameters used in events you have to create a new APMParameter instance and add the typed parameters to that instance:
A detailed description of this class with all methods explained is described in chapter “APMParameter Class and Methods (.NET)”.
The enum APMCounterType specifies the type of counter registered using the method RegisterCounter of the APM class.
Name | Description |
---|---|
APMCounterTypeRaw | Raw counter without special interpretation. |
APMCounterTypeCounter | Per second values. |
APMCounterTypeFraction | Percent value. |
The counter value is provided to the app.telemetry library as return value of one of the following delegates:
Syntax |
---|
public delegate UInt32 ComputeCounterUInt32(); public delegate UInt64 ComputeCounterUInt64(); public delegate String ComputeCounterString(); |
These delegates are used as parameters in the method RegisterCounter of the APM class.
The APMCounterOptions class contains counter attributes as fields. Counter attributes define behavior, aggregation, measurement, representation and labels of registered counters. Some of the attributes can be changed but most must be defined during the initial counter registration in the method RegisterCounter of the APM class.
Name | Description | Type |
---|---|---|
GroupDisplayName | Group display name of the counter. | string |
DisplayName | Display name of the counter. | string |
InstanceName | Name of the counter instance. | string |
InstanceDisplayName | Instance display name of the counter. | string |
DisplaySuffix | Value suffix. | string |
AggregationFunctionName | Aggregation function, see "Aggregation Function Names (.NET)" | string |
WarningLimit | Warning limit for service check, related to the service check property “warning”. | string |
ErrorLimit | Critical limit for service check, related to the service check property “error”. | string |
FractionBase | Base for fractional counter values. | UInt64 |
Application | ApplicationHandle of the application that owns the counter. | UInt32 |
MeasurementInterval | Interval (in seconds) of automatic counter recording. | uint |
The APMUpdateCounterOptions class is similar to the APMCounterOptions class, but it contains only the counter attributes that may be updated for a registered counter.
Name | Description | Type |
---|---|---|
GroupDisplayName | Group display name of the counter. | string |
DisplayName | Display name of the counter. | string |
InstanceDisplayName | Instance display name of the counter. | string |
The APM class is the base class of the Software-Telemetry SDK. It contains all global defined constants as described in chapter “Constants (.NET)”. Use the methods from the APM class in a static way (there is no new instance allocation required).
Remarks:
With version 2010 Fall Release the application-specific functions (CreateContext, ..., Report, ...) of the .Net API where moved to the APMApplication class (see chapter “APMApplication Class and Methods (.NET)”) and have to be called on an object instance of this class!
The Methods Connect/Disconnect and all counter functionality (RegisterCounter/UpdateCounter/UnregisterCounter) is available since version 2023.
Call Connect to establish a connection to the app.telemetry agent.
Syntax |
---|
public static void Connect(); |
Parameters:
This function does not take any arguments.
Return Value:
This function does not return any value.
Call Disconnect to disconnect from the app.telemetry agent, this will also cleanup the app.telemetry communication thread and will disable automatic reconnection. To reestablish the connection to the app.telemetry agent call Connect.
Syntax |
---|
public static void Disconnect(); |
Parameters:
This function does not take any arguments.
Return Value:
This function does not return any value.
The API method IsConnected will tell you if the application (the one that is instrumented with the APM SDK) has successfully registered to an app.telemetry agent and is currently connected to the agent process.
Only when an application is successfully connected to an app.telemetry agent, Software-Telemetry data will be processed and sent to and collected by the app.telemetry server
Syntax |
---|
public static Boolean IsConnected(); |
Parameters:
This function does not take any arguments.
Return Value:
Usage Example |
---|
private void isConnected_Click(object sender, EventArgs e) { isConnectedResult.Text = (APM.IsConnected()) ? "yes" : "no"; } |
Call IsCompatible to test, if the application was linked with a version that is compatible with the dynamically loaded library.
Syntax |
---|
public static Boolean IsCompatible(ref String message); |
Parameters:
Return Value:
Usage Example |
---|
String message = ""; if (!APM.IsCompatible(ref message)) { //incompatible } |
Call the DetachThread-method when processing of a particular request is suspended and will be resumed later in this or another thread in the same process. Pass the handle returned by this method to the AttachThread-method to resume processing (see “Method AttachThread (.NET)”).
This functionality is in particular useful in queuing systems, where a large number of requests will be queued and processed by a small number of worker threads asynchronous to the initial request. Using the Detach-/AttachThread methods you can follow the request through the process and even measure the time spent in the queue, even if a different thread continues processing.
Syntax |
---|
public static Boolean DetachThread(out UInt64 transaction) |
Parameters:
Return Value:
Usage Example |
---|
public class Task { //... public void Initialize(/* ... */) app.CreateContext("filterstring"); } public void process() APM.AttachThread(tx); // process work app.ReleaseContext(); |
Remarks:
Be careful to use DetachThread and AttachThread in a balanced way. DetachThread will store the current state of the request in memory and AttachThread will remove the information from memory while restoring the request state. So calls to DetachThread lacking a continuation will leak memory and will leave the request in a "running" state. Multiple calls to AttachThread will not have an effect, because the request state is only available to the first call to AttachThread.
Call the AttachThread-method when processing of a particular request is resumed after being suspended in this or another thread of the same process. Pass the handle returned by DetachThread-method to restore the recorded state of the request.
For more details see “Method DetachThread (.NET)”.
Syntax |
---|
public static void AttachThread(UInt64 transaction); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
Call RegisterCounter once for every counter or counter instance to make the counter known to the app.telemetry library for collection. There exist three overloaded methods of RegisterCounter corresponding to the three possible data types for counter, UInt32, UInt64 and String.
Syntax |
---|
public static UInt32 RegisterCounter(String group, String name, APMCounterType type, ComputeCounterUInt32 fn, APMCounterOptions? options = null) public static UInt32 RegisterCounter(String group, String name, APMCounterType type, ComputeCounterUInt64 fn, APMCounterOptions? options = null) public static UInt32 RegisterCounter(String group, String name, APMCounterType type, ComputeCounterString fn, APMCounterOptions? options = null) |
Parameters:
Usage Example |
---|
class Counter public void RegisterCounter() { |
Call UpdateCounter to update some of the attributes of a registered counter. The attributes that can be updated are defined as fields of the APMUpdateCounterOptions (see "APMUpdateCounterOptions (.NET)") class:
Syntax |
---|
public static void UpdateCounter(Uint32 counterHandle, APMUpdateCounterOptions options) |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
class Counter public void UpdateCounter() { |
Call UnregisterCounter to unregister a previously registered counter to free it's associated resources and stop any collection.
Syntax |
---|
public static void UnregisterCounter(Uint32 counterHandle) |
Parameters:
This function does not return any value.
Usage Example |
---|
class Counter public void UnregisterCounter() { |
The APMApplication class is the base class for your application registration, the context- and report-functions and the filter registration (callback or directly). It stores the application handle inside and provides all application-specific functions for your application to be called on your APMApplication object instance.
Your own application implementation may override the callback function EnumFilterValuesCallback (default implementation is empty) to provide the filters values via the callback function. Alternatively the filters may also be registered directly.
The application is registered when a new instance of the APMApplication class is being created.
Syntax |
---|
public APMApplication(string appName, string appId, |
Parameters:
ApplicationHandle lets you obtain the corresponding UInt32 handle of the application, it is read-only.
Call RegisterApplicationProperty to register additional application registration properties immediately after you call to the APMApplication class constructor to ensure proper operation.
Syntax |
---|
public void RegisterApplicationProperty(string propertyKey, string propertyName, string propertyValue); |
Parameters:
Remarks:
Application registration Properties cannot be changed after they have been set.
Syntax |
---|
public void RegisterApplicationValue(string valueKey, string valueName, string value); |
Parameters:
Remarks:
Application values may be changed at runtime but must not have a high change frequency and do not have any history of previous values.
The method Unregister will unregister the application and will tell the app.telemetry Library to disconnect from the app.telemetry agent. It is not valid to call further methods on that object after unregistering.
Syntax |
---|
public void Unregister(); |
RegisterFilterValue registers application specific filter item, which may be used as filter strings in the CreateContext function. Registering the filter values helps the user selecting filters when starting Software-Telemetry sessions in the client interface.
To improve the registration process enumerating the possible filter values, instead of registering the filter values by calling RegisterFilterValues right after application registration, you may create a subclass of APMApplication implementing the callback function EnumAppFilterValuesCallback. This callback method will be invoked only if no application with same application name, application id and application tier has already registered filter values. Enumerate and register the filter values in the callback function. This mechanism is designed e.g. for web service farms, where the enumeration of the filters will register all users. So it is sufficient to register the filter values once on one web service instance.
Syntax |
---|
public void RegisterFilterValue(String filterValue, |
Parameters:
Return Value:
This function does not return any value.
Remarks:
You should register all filters that are available in your application so that the user can choose in the client interface from a list box.
Usage Example |
---|
class TestApplication : APMApplication { public TestApplication (String appTierId) // ... public override void EnumAppFilterValuesCallback() RegisterFilterValue("user1", "displayname1"); } |
Call CreateContext to start a new request in the Software-Telemetry context.
If the filter value matches a currently started session filter, logging is started for the current execution thread and the request will be associated with the session. You may call CreateContext more than once in one request in order to pass additional filter values. The request will start at the first CreateContext and will be finished by the first ReleaseContext. Make sure to call ReleaseContext (see “Method ReleaseContext (.NET)”) when exiting the request.
A context can be regarded as a complete request that is traced through several involved threads or modules. And the full context request has a duration that spans the interval from CreateContext to ReleaseContext.
Syntax |
---|
public void CreateContext(String filtervalue); |
Parameters:
Return Value:
This function does not return any value.
See chapter “Application Properties” for more information on the app.telemetry request concept.
Usage Example |
---|
public static void doRequest(APMApplication app, string sequenceId) /* place you request processing code here ... */ app.ReleaseContext(); |
Call ReleaseContext to indicate the end of the processing of one request. One ReleaseContext will close the request no matter how many CreateContext or AttachContext calls have been called.
Syntax |
---|
public void ReleaseContext(); |
Remarks:
If you don't call ReleaseContext the request keeps the running status until the request-timeout has been reached.
Usage Example |
---|
public static void doRequest(APMApplication app, string sequenceId) /* place you request processing code here ... */ app.ReleaseContext(); |
Call the GetContext-method to get a new context handle from the SDK.
This context handle is used to synchronize different threads/processes/modules - this helps you track the control flow through a distributed environment. The acquired context handle has to be submitted (either by transmitting over the network or in another way) to the other thread/process/module which has to call the AttachContext-method with the same context.
For more information see also “Passing Context” and “Method AttachContext (.NET)”.
Syntax |
---|
public Boolean GetContext(out byte[] requestinfo); |
Parameters:
Return Value:
Usage Example |
---|
public void GetRepositoryInfo() byte[] context; request.Headers.Add("x-apm-telemetry-context", // ... HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if (syncMark != null) { // ... |
Call AttachContext to restore the context acquired through GetContext in another thread or process.
For more information see also “Passing Context” and “Method GetContext (.NET)”.
Syntax |
---|
public void AttachContext(byte[] requestinfo); |
Parameters:
Usage Example |
---|
void ContinueRequest(byte[] requestinfo) { |
Call the GetSyncMark-method to get a synchronization handle that can be passed to another thread/process/module to synchronize control flow.
The difference between a sync-marks and a context is:
For more information see also “Synchronizing Timeline with SyncMarks”.
Syntax |
---|
public Boolean GetSyncMark(out byte[] syncMark); |
Parameters:
Return Value:
Usage Example |
---|
void continueRequest(APMApplication appl) |
Call the SetSyncMark-method to pass and submit a synchronization handle that you got from the GetSyncMark-call to synchronize the sequence of events.
For more information see also “Synchronizing Timeline with SyncMarks”, “Method GetSyncMark (.NET)” and “Method GetContext (.NET)”.
Syntax |
---|
public void SetSyncMark(byte[] syncMark); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
See “Method GetContext (.NET)”. |
The API method HasActiveContext defined in the APMApplication class will tell you if there is currently a Software-Telemetry session for the given log level for the application (the one that is instrumented with the APM SDK) running.
This information should be used to avoid costly operations preparing parameters for events that are currently not logged.
Syntax |
---|
public Boolean HasActiveContext(Byte level); |
Parameters:
Return Value:
Usage Example |
---|
private void hasContext_Click(object sender, EventArgs e) { |
Call the Report-method from the APMApplication class to create a new feedback report.
The filter value will be matched to the description using the registered filter values.
Use the textual description of the feedback entered by the user or generated by the application to identify the report session later again.
Syntax |
---|
public void Report(String filtervalue, String keyvalue, String description); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
public APMApplication app; public void RegisterTelemetry { public void generateReport(String username, String description) { app.ReportValue("repkey_1", "username", "John Doe"); System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); Stream stream = File.OpenRead(reportFilePath); |
Call ReportValue to add a key/value pair to an existing report.
For more information see “Method Report (.NET)”.
Syntax |
---|
public void ReportValue(string reportkey, string key, string value); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
See “Method Report (.NET)” |
Call ReportContent to add content to an existing report.
For more information see “Method Report (.NET)”.
Syntax |
---|
public void ReportContent(string reportkey, string filename, string mimetype, ref byte[] data); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
See “Method Report (.NET)” |
Call ReportFile to add content to an existing report.
For more information see “Method Report (.NET)”.
Syntax |
---|
public void ReportFile(string reportkey, string filename, string mimetype, System.IO.Stream stream); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
See “Method Report (.NET)” |
The APMModule-class represents a registered Module. You have to register a module to set telemetry points. You may register a module multiple times with the same name. Events of equally named modules will show up in the same column.
The constructor registers the module with the given name.
Syntax |
---|
public APMModule(string name); |
It is required and important to register the events used in your application in order to get the correct event names and parameter descriptions as provided. The RegisterEvent-method will tell the app.telemetry server a name for every event-ID and optionally parameter descriptions for the parameters used in the event calls.
Syntax |
---|
public void RegisterEvent(UInt64 eventid, String eventDescription, String parameterDescription); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
public void ModuleEvents() |
Call the simple Event-method to log events without parameters.
Only the event-ID and the flags define the representation of the event that will be displayed with the registered event name for the used id.
This method is part of the APMModule class and has to be called on your own module implementation class.
Syntax |
---|
public void Event(UInt64 eventid, Byte level, Bytes flags); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
public void WebShopWebMethod(object sender, EventArgs e) { m_module.Event(SampleModule.EVENT_PROCESS_REQUEST, GetRepositoryInfo(); m_module.Event(SampleModule.EVENT_PROCESS_REQUEST, // ... |
Call the EventStr-method to log events with a single textual (string) parameter.
In addition to the event-ID (with the registered event name) and the flags a single string parameter value will be logged.
For more information see “Method Event (.NET)”.
Syntax |
---|
public void EventStr(UInt64 eventid, Byte level, Bytes flags, String param); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
public void WebShopWebMethod(object sender, EventArgs e) { m_module.EventStr(SampleModule.EVENT_PROCESS_REQUEST, GetRepositoryInfo(); m_module.EventStr(SampleModule.EVENT_PROCESS_REQUEST, // ... |
Call the EventParam-method to log events with a generic parameter structure - with any number and combination of textual (string) values and integer values (32- and 64-bit).
To use the EventParam-method you have to allocate a new APMParameter. With a few helper methods you can add values to this parameter object and finally you can use the parameter object in the event function to be logged. For details how to allocate and fill the APMParameter object see chapter “APMParameter Class and Methods (.NET)”.
Syntax |
---|
public void EventParam(UInt64 eventid, Byte level, Byte flags, APMParameter param); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
public void WebShopWebMethod(object sender, EventArgs e) { APMParameter param = new APMParameter(); param.AddInt32(75); module.EventParam(SampleModule.EVENT_PROCESS_REQUEST, // ... |
The APMParameter-class is an object structure for storing and managing parameter values that can be used for logging complex value structures with more than one or different type of values.
See also “Method EventParam (.NET)”.
Call the APMParameter-constructor to allocate a new parameter object where you can add any number of textual (string) values and integer values (32- and 64-bit).
Syntax |
---|
public APMParameter(); |
Call the method AddInt32 on your APMParameter-instance to add a simple integer value (32-bit) to that object.
Syntax |
---|
public void AddInt32(UInt32 value); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
See “Method EventParam (.NET)”. |
Call the method AddInt64 on your APMParameter-instance to add a simple integer value (64-bit) to that object.
Syntax |
---|
public void AddInt64(UInt64 value); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
See “Method EventParam (.NET)”. |
Call the method AddString on your APMParameter-instance to add a textual (string) value to that object.
Syntax |
---|
public void AddString(String value); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
See “Method EventParam (.NET)”. |
The functions specified so far all are executed within the context of the current thread. In some cases, it is necessary to explicitly define the current transaction context to the context handling functions, for example if your application's processes aren't based on operating system threads.
These functions are available in the .NET API Version 24.0.4 and later.
Call TxCreateContext to create a new Software-Telemetry context analogously to CreateContext. You use the APMTransactionHandle returned by this function to pass to other explicit transaction functions for the definition of the current transaction context. You have to call TxReleaseContext with the returned transaction handle when exiting the context.
Syntax |
---|
UInt64 TxCreateContext(UInt64 tx, string filterValue) |
Parameters:
Return Value:
This function returns the transaction handle for the current or currently created transaction context.
Usage Example |
---|
void beginRequestProcessing(/* ... */) |
Call TxAttachContext to restore the context acquired through GetContext or TxGetContext in another thread or process (see “Passing Context”). You can attach to an already existing transaction context or create a new transaction context which is returned by TxAttachContext to pass to other explicit transaction functions.
Syntax |
---|
UInt64 TxAttachContext(UInt64 tx, byte[] contextToken) |
Parameters:
Return Value:
This function returns the transaction handle for the current or currently created transaction context.
Usage Example |
---|
void ContinueRequest(/* ... */, byte[] context, out byte[] syncMark) |
Call the TxGetContext-method to get a new context handle for the current transaction context, analogously to APMGetContext.
Syntax |
---|
public Boolean TxGetContext(UInt64 tx, out byte[] contextToken) |
Parameters:
Return Value:
Usage Example |
---|
void initiateProcessing(/* ... */) //pass context to another thread, process on the same or a remote machine } doRemote(/* data */, context); //do some local processing / wait for the remote processing to complete byte[] syncMark; |
Call the TxGetSyncMark-method to get a synchronization handle that can be passed to another thread/process/module to synchronize control flow, same as GetSyncMark, for the current transaction context.
Syntax |
---|
Boolean TxGetSyncMark(UInt64 tx, out byte[] syncMark) |
Parameters:
Return Value:
Usage Example |
---|
void doRemote(/* ... */, byte[] context) //application logic, events, ... Byte[] syncMark; |
Call TxSetSyncMark to pass a sync mark you got from GetSyncMark or TxGetSyncMark for synchronizing the sequence of events (see “Synchronizing Timeline with SyncMarks”).
Syntax |
---|
void TxSetSyncMark(UInt64 tx, byte[] syncMark) |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
void initiateProcessing(/* ... */) //pass context to another thread, process or a remote server doRemote(/* data */, context); //do some local processing/wait for the remote processing to complete |
Call TxReleaseContext with the current transaction handle to finish logging and exit the context, analogously to ReleaseContext.
Syntax |
---|
void ReleaseContext() |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
void doRemote(/* ... */, APMContext *context) |
Call TxHasActiveContext to test if a software-telemetry session is active for some logging level for the current transaction context, analogously to HasActiveContext.
Syntax |
---|
Boolean TxHasActiveContext(UInt64 tx, Byte level) |
Parameters:
Return Value:
Usage Example |
---|
void processRequest() //application logic if (app.TxHasActiveContext(tx, APM_EVENT_LEVEL_DEBUG)) |
Call the TxEvent function to log an event without parameters for the current transaction context.
Syntax |
---|
void TxEvent(UInt64 tx, UInt64 eventId, Byte level, Byte flags) |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
//steps required before logging events: |
Call the TxEventParam-method to log events with a generic parameter structure analogously to EventParam for the current transaction context.
Syntax |
---|
public void TxEventParam(UInt64 tx, UInt64 eventId, Byte level, Byte flags, APMParameter param); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
public void WebShopWebMethod(UInt64 tx, object sender, EventArgs e) { APMParameter param = new APMParameter(); param.AddInt32(75); module.TxEventParam(tx, SampleModule.EVENT_PROCESS_REQUEST, // ... |
Use TxEventStr to log an event with an additional string value as parameter.
Syntax |
---|
public void TxEventStr(UInt64 tx, UInt64 eventId, Byte level, Byte flags, string param); |
Parameters:
Return Value:
This function does not return any value.
Usage Example |
---|
public void WebShopWebMethod(UInt64 tx, object sender, EventArgs e) { m_module.TxEventStr(tx, SampleModule.EVENT_PROCESS_REQUEST, GetRepositoryInfo(); m_module.TxEventStr(tx, SampleModule.EVENT_PROCESS_REQUEST, // ... |
Since Version 24.0.4 you can attach a ILogger<APMApplication> object to the Library to get detailed Information about the communication of the native library with the Fabasoft app.telemetry agent.
Syntax |
---|
public static void SetLogger(ILogger<APMApplication>? _logger); |
To create a logger, which passes the output to the console, use the following code during initialization.
Usage Example |
---|
public void InitLogger() |