Fabasoft app.telemetry provides a Software-Telemetry SDK that enables applications to integrate into Fabasoft app.telemetry. Applications can integrate by registering themselves into Software-Telemetry and by providing information (events) used within Software-Telemetry log pools and sessions. These events help you to track the control flow through a distributed environment of your application.
To register your application and the modules in an accurate way you have four standard layers of registration information:
Use the four standard layers of registration information to structure your services in an adequate way, so your application is represented meaningful in the infrastructure view of the Fabasoft app.telemetry client. The appName and appId represent the id of a top level service group. Inside you may group services (appTierName) by service-type (e.g. web-service vs. database-service) or service-context (e.g. put services for sales and accounting in different groups) and use the appTierId to distinguish between the particular services.
As of Fabasoft app.telemetry version 18.3 it is possible to register additional properties to allow greater flexibility of application registrations.
You can see each of these registered applications in a separate process column in the Software-Telemetry analysis view. Put the registration on a position in the source code of your application that runs once at startup of the application. The combination of all four parameters should be unique per Server/virtual Server (Cluster).
Note: Do not use random information or unpredictable information like process id or start time for registration parameters as this information is used to register services in the infrastructure and random information will result in multiple registered services.
For each module inside your application you may register a separate module. Each of these modules is drawn in a separate column inside the Software-Telemetry analysis view. For these modules you can register event descriptions. Put the registration on a position in the source code of your module that runs once at creation of the module.
This figure shows the overview of a selected request of the Fabasoft app.telemetry Client where you can navigate into the event details.
This figure shows the event details of a selected request of the Fabasoft app.telemetry Client where you can see time usage of any single event, parameter values and context handling. To navigate deeper into the details use the "plus"-icon. You can see the current position in your request in the call stack view on the right side where you can also navigate to other positions.
As of Fabasoft app.telemetry Version 2018 UR 3 (18.3) applications can also register counters of various types to provide additional performance and status information that is independent of requests.
With SDK version 2009 Summer Release two standard module definitions and some general predefined events have been introduced. These modules define common instrumentation points for areas that are common to many projects.
Note: Do not use those predefined event-IDs listed below for your own events!
The Operating System Module defines standard events for file system access, process execution and wait operations. These events should be used to instrument applications in a consistent way.
To use this module, call the RegisterModule-function or create an object of class APMModule with a module name equal to “Operating System” using the constant APM_MODULE_NAME_OS. The event descriptions are statically defined in the app.telemetry server process and may therefore not be registered within the application.
Code Example |
---|
// register the module once // open a file |
The constant names are prefixed with “APM_” for the C/C++ API (APM_<constant>) and in the other object-oriented languages they are members of the APM base class (APM.<constant>).
Name | Value | Eventname | Parameters | Description |
---|---|---|---|---|
APM_MODULE_NAME_OS APM.MODULE_NAME_OS | "Operating System" | |||
APM_EVENT_OS_CREATE APM.EVENT_OS_CREATE | 0x0000 | "Create" | "Name" | Create a file, stream or system object. Pass the resource name as parameter 1. |
APM_EVENT_OS_OPEN APM.EVENT_OS_OPEN | 0x0001 | "Open" | "Name" | Open a file, stream or other system object. Pass the resource name as parameter 1. |
APM_EVENT_OS_DELETE APM.EVENT_OS_DELETE | 0x0002 | "Delete" | "Name" | Delete a file, stream or other system object. Pass the resource name as parameter 1. |
APM_EVENT_OS_READ APM.EVENT_OS_READ | 0x0003 | "Read" | "Name" | Read from a file or stream. Optionally pass the resource name or identifier as parameter 1. |
APM_EVENT_OS_WRITE APM.EVENT_OS_WRITE | 0x0004 | "Write" | "Name" | Write to a file or stream. Optionally pass the resource name or identifier as parameter 1. |
APM_EVENT_OS_CLOSE APM.EVENT_OS_CLOSE | 0x0005 | "Close" | "Name" | Close a file or stream. Optionally pass the resource name or identifier as parameter 1. |
APM_EVENT_OS_FLUSH APM.EVENT_OS_FLUSH | 0x0006 | "Flush" | "Name" | Flush a file or disk. Pass the resource name as parameter 1. |
APM_EVENT_OS_RENAME APM.EVENT_OS_RENAME | 0x0007 | "Rename" | "Source;Target" | Rename a file. Pass the source name as parameter 1 and the target name as parameter 2. |
APM_EVENT_OS_COPY APM.EVENT_OS_COPY | 0x0008 | "Copy" | "Source;Target" | Copy a file. Pass the source name as parameter 1 and the target name as parameter 2. |
APM_EVENT_OS_MOVE APM.EVENT_OS_MOVE | 0x0009 | "Move" | "Source;Target" | Move a file. Pass the source name as parameter 1 and the target name as parameter 2. |
APM_EVENT_OS_EXECUTE APM.EVENT_OS_EXECUTE | 0x0100 | "Execute | "Command" | Execute a process. Pass the command line as parameter 1. |
APM_EVENT_OS_WAIT APM.EVENT_OS_WAIT | 0x0200 | "Wait" | "Object" | Wait for a system object (e.g. semaphore). Optionally pass an object name identifying the system object. |
APM_EVENT_OS_SLEEP APM.EVENT_OS_SLEEP | 0x0201 | "Sleep" | Suspend current process. | |
APM_EVENT_OS_CRITICALSECTION_WAIT APM.EVENT_OS_CRITICALSECTION_WAIT | 0x0300 | "CriticalSection::Wait" | "Name" | Wait inside a critical section. |
APM_EVENT_OS_CRITICALSECTION_ENTER APM.EVENT_OS_CRITICALSECTION_ENTER | 0x0301 | "CriticalSection::Enter" | "Name" | Enter a critical section. |
APM_EVENT_OS_CRITICALSECTION_LEAVE APM.EVENT_OS_CRITICALSECTION_LEAVE | 0x0302 | "CriticalSection::Leave" | "Name" | Leave a critical section. |
The XMLHttpRequest is defined to be used in an http client application to trace the synchronous or asynchronous events of a request.
The module has been used in the implementation of the SendXMLHttpRequest function in the JavaScript version of the SDK but may as well be used in your own application instrumentation.
The constant names are prefixed with “APM_” for the C/C++ API (APM_<constant>) and in the other object-oriented languages they are members of the APM base class (APM.<constant>).
Name | Value | Eventname | Parameters |
---|---|---|---|
APM_MODULE_NAME_XMLHTTP APM.MODULE_NAME_XMLHTTP | "XMLHttpRequest" | ||
APM_EVENT_XMLHTTP_SEND APM.EVENT_XMLHTTP_SEND | 0 | "Send" | |
APM_EVENT_XMLHTTP_LOADING APM.EVENT_XMLHTTP_LOADING | 1 | "Loading" | |
APM_EVENT_XMLHTTP_LOADED APM.EVENT_XMLHTTP_LOADED | 2 | "Loaded" | |
APM_EVENT_XMLHTTP_INTERACTIVE APM.EVENT_XMLHTTP_INTERACTIVE | 3 | "Interactive" | |
APM_EVENT_XMLHTTP_COMPLETE APM.EVENT_XMLHTTP_COMPLETE | 4 | "Completed" | "Status;Status Text" |
APM_EVENT_XMLHTTP_PROCESSING APM.EVENT_XMLHTTP_PROCESSING | 10 | "Processing" | |
APM_EVENT_XMLHTTP_PROCESSED APM.EVENT_XMLHTTP_PROCESSED | 11 | "Processed" |
The HttpRequest Module is used to trace the parameters of http requests such as URL, method, status, header fields and message bodies.
The constant names are prefixed with “APM_” for the C/C++ API (APM_<constant>) and in the other object-oriented languages they are members of the APM base class (APM.<constant>).
Name | Value | Eventname | Parameters |
---|---|---|---|
APM_MODULE_NAME_HTTP APM.MODULE_NAME_HTTP | "HttpRequest" | ||
APM_EVENT_HTTP_URL APM.EVENT_HTTP_URL | 2000 | "URL" | “scheme;host;path;extra” |
APM_EVENT_HTTP_METHOD APM.EVENT_HTTP_METHOD | 2001 | "Method" | “method” |
APM_EVENT_HTTP_STATUS APM.EVENT_HTTP_STATUS | 2002 | "Status" | “code;message” |
APM_EVENT_HTTP_AUTHENTICATION APM.EVENT_HTTP_AUTHENTICATION | 2003 | "Authentication" | “type;credential” |
APM_EVENT_HTTP_PROXY APM.EVENT_HTTP_PROXY | 2004 | "Proxy" | “server;username” |
APM_EVENT_HTTP_REQUEST_HEADER APM.EVENT_HTTP_REQUEST_HEADER | 2010 | "Request Header" | “header;value” |
APM_EVENT_HTTP_REQUEST_CONTENTTYPE APM.EVENT_HTTP_REQUEST_CONTENTTYPE | 2011 | "Request Content Type" | “media-type;charset;boundary” |
APM_EVENT_HTTP_REQUEST_CONTENTBODY APM.EVENT_HTTP_REQUEST_CONTENTBODY | 2012 | "Request Body Part" | |
APM_EVENT_HTTP_RESPONSE_HEADER APM.EVENT_HTTP_RESPONSE_HEADER | 2020 | “Response Header” | “header;value” |
APM_EVENT_HTTP_RESPONSE_CONTENTTYPE APM.EVENT_HTTP_RESPONSE_CONTENTTYPE | 2021 | "Response Content Type" | “media-type;charset;boundary” |
APM_EVENT_HTTP_RESPONSE _CONTENTBODY APM.EVENT_HTTP_RESPONSE _CONTENTBODY | 2022 | "Response Body Part" |
The SDK already provides a set of predefined events used for general purpose.
Note: Do not use any of these predefined event-IDs for your own event declarations!
The constant names are prefixed with “APM_” for the C/C++ API (APM_<constant>) and in the other object-oriented languages they are members of the APM base class (APM.<constant>).
Constant Name | Value |
---|---|
APM_EVENT_ERROR APM.EVENT_ERROR | 0x10001000 |
APM_EVENT_WARNING APM.EVENT_WARNING | 0x10001001 |
APM_EVENT_INFO APM.EVENT_INFO | 0x10001002 |
APM_EVENT_TRACE APM.EVENT_TRACE | 0x10001003 |
Use these standard events to mark error, warning or info conditions in your application like in the following example:
Code Example |
---|
APMEventStr(anymodule, APM_EVENT_ERROR, APM_EVENT_LEVEL_NORMAL, APM_FLAG_ERROR, "My error message”); |
The Sequence functionality has been deprecated and has been removed in Version 2015. Register your own events and log columns instead.
Flags are used to specify the type of an event and are passed as argument to every event call.
The constant names are prefixed with “APM_” for the C/C++ API (APM_<constant>) and in the other object-oriented languages they are members of the APM base class (APM.<constant>).
Name | Value | Description |
---|---|---|
APM_FLAG_NONE APM.FLAG_NONE | 0x00 | normal event |
APM_FLAG_ENTER APM.FLAG_ENTER | 0x01 | indicates a starting point |
APM_FLAG_LEAVE APM.FLAG_LEAVE | 0x02 | indicates an ending point |
APM_FLAG_WAIT APM.FLAG_WAIT | 0x04 | indicates a wait condition |
APM_FLAG_WARNING APM.FLAG_WARNING | 0x08 | mark event as warning |
APM_FLAG_ERROR APM.FLAG_ERROR | 0x10 | mark event as error |
APM_FLAG_PROCESS_INFO APM.FLAG_PROCESS_INFO | 0x20 | force writing SessionInfo just before the event |
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 constant names are prefixed with “APM_” for the C/C++ API (APM_<constant>) and in the other object-oriented languages they are members of the APM base class (APM.<constant>).
Name | Value | Description |
---|---|---|
APM_EVENT_LEVEL_LOG APM.EVENT_LEVEL_LOG | 00 | for events that should always be included and for logging parameters for the request overview |
APM_EVENT_LEVEL_IPC APM.EVENT_LEVEL_IPC | 10 | INTERNAL value |
APM_EVENT_LEVEL_NORMAL APM.EVENT_LEVEL_NORMAL | 50 | for general events for normal recording sessions |
APM_EVENT_LEVEL_DETAIL APM.EVENT_LEVEL_DETAIL | 60 | for detail level events for detailed session analysis |
APM_EVENT_LEVEL_DEBUG APM.EVENT_LEVEL_DEBUG | 70 | event with debugging information - highest level of precision with huge data amount and performance impact |
Application Properties are static and unchanging properties used in addition to the four standard registration parameters when creating service objects in the app.telemetry infrastructure.
The constant names are prefixed with “APM_” for the C/C++ API (APM_<constant>) and in the other object-oriented languages they are members of the APM base class (APM.<constant>).
Name | Description |
---|---|
APM_APP_PROPERTY_INSTANCE_GUID_KEY APM.PROPERTY_INSTANCE_GUID_KEY | Setting the GUID (Globally Unique Identifier) of an application enables app.telemetry to track the same application instance among agents without creating a new service on every agent the application is ever launched on. This can be used as an alternative for the built in clustering support. |
APM_APP_PROPERTY_INSTANCE_GUID_NAME APM.PROPERTY_INSTANCE_GUID_NAME | Display name for the instance GUID property. (Setting a custom name for this property is not supported). |
Application values can provide additional, changeable (very low change frequency) information about an application or it’s runtime environment.
The constant names are prefixed with “APM_” for the C/C++ API (APM_<constant>) and in the other object-oriented languages they are members of the APM base class (APM.<constant>).
Name | Description |
---|---|
APM_APP_VALUE_VERSION_KEY APM.VALUE_VERSION_KEY | Key for the application version value. |
APM_APP_VALUE_VERSION_NAME APM.VALUE_VERSION_NAME | Display name for the application version value. (Setting a custom name for this value is not supported). |
APM_APP_VALUE_INSTANCE_NAME_KEY APM.VALUE_INSTANCE_NAME_KEY | Key for the instance name property used to provide a nice display name for services identified via the instance GUID property. |
APM_APP_VALUE_INSTANCE_NAME_NAME APM.VALUE_INSTANCE_NAME_NAME | Display name for the instance name value. (Setting a custom name for this value is not supported). |
After your application and all defined modules are registered you can start with the instrumentation of your program sequence.
When the request enters your application you have to create a Software-Telemetry context with a specific filter value. This filter value should be one of those you have registered for any module of this process with the RegisterFilterValue-method. By calling the CreateContext function with a filter value matching the filter value of a started Software-Telemetry session recording is enabled.
This context information is used by the analysis components to track the control flow through the distributed environment. Then you can subsequently fire events which are tracked by the Software-Telemetry. After firing the last event you have to call the method ReleaseContext to finish recording events and to tell app.telemetry that processing has finished.
If processing in your application involves other services (thread/process/module) you may track control and data flow between services by passing the Software-Telemetry context between the services.
With the GetContext-method you acquire a context token. Then you pass the token with your request data to the other service being invoked (for example by transmitting the context token over the network stream).
In the second service you use the token to attach to this context using the AttachContext-method. By doing this Software-Telemetry recording is being enabled in the called service and data will be displayed accordingly in the analysis view.
To pass the context token to an HTTP endpoint it must be set as a header with the name “x-apm-telemetry-context” and the value must be encoded using base64, this allows intermediaries such as load-balancers or reverse proxies to insert themselves in between the communicating parties to provide a more complete picture of the request flow. Instrumented HTTP endpoints must respond with a sync mark token as an http header with the name “x-apm-telemetry-syncmark” that is also base64 encoded for the same reason.
To get a correct timeline if the first service depends on the output of the second you have to use synchronization markers. Inside the second service you have to acquire a synchronization marker using the function GetSyncMark. After doing this you have to pass the synchronization marker together with the response back to the first service. Then you call the method SetSyncMark inside the first service. In the following figure you can see an illustration of the program flow.
Each event that is recorded by any Fabasoft app.telemetry agent (when the instrumented application fires these events) is sent to the Fabasoft app.telemetry server, which is the responsible service to process and analyze these events.
The Fabasoft app.telemetry server requires a definition (analyzer structure) for interpreting and analyzing the Software-Telemetry events.
The developer who instruments the application is responsible to provide a log definition for his instrumentation points. A log definition is an XML file containing a description of events, their parameters with the data type and settings how to persist these events in a database for statistical analysis.
The app.telemetry Software-Telemetry analyzer module on the Fabasoft app.telemetry server requires at least one valid log definition to be defined. Otherwise no telemetry data will be processed.
The log definitions are normally delivered by the application vendor (by the developer who instrumented the application by means of Software-Telemetry SDK). These log definitions must be imported into the infrastructure model via the Fabasoft app.telemetry client by means of importing an XML file in the client interface in the edit mode.
Log definitions must have the following XML format:
Code Example |
---|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
The attributes of an entry are defined as follows:
Example: Log Definition |
---|
<?xml version=”1.0” encoding=”UTF-8” standalone=”no” ?> <APMLogAnalyzer> <APMLogAnalyzerEntry eventid=”1105” module=”HTTP Server” paramid=”1” <APMLogAnalyzerEntry eventid=”1109” module=”HTTP Server” paramid=”1” <APMLogAnalyzerEntry eventid=”1100” module=”Virtual Application” <APMLogAnalyzerEntry eventid=”1101” module=”Virtual Application” <APMLogAnalyzerEntry eventid=”1106” module=”Virtual Application” <APMLogAnalyzerEntry eventid=”2003” module=”Fabasoft Components Kernel” <APMLogAnalyzerEntry eventid=”352” module=”WebDAV” paramid=”1” <APMLogAnalyzerEntry eventid=”104” module=”Virtual Application” <APMLogAnalyzerEntry eventid=”104” module=”Virtual Application” </APMLogAnalyzer> |
Explanation of example (above): this definition defines several different events of different types.
The Sequence column functionality has been deprecated and has been removed in Version 2015. Register your own events and log columns instead.
Since Fabasoft app.telemetry 2014 Summer Release it is possible to extend the module and event registration information done during instrumenting an application in the code by means of providing a custom “wizard” package containing special registration information:
Package.xml |
---|
<?xml version="1.0" encoding="utf-8" standalone="no"?> <Package name="Fabasoft Folio Integration Package" description="Fabasoft Folio Integration Package" packageid="foliocfg" version="14.2.0.6" author="Fabasoft R&D GmbH" icon=""> </Package> |
module_registration.xml |
---|
<?xml version="1.0" encoding="utf-8" standalone="no"?> <Follower name="Operating System"/> <Application applname="Fabasoft Folio" appltiername="Webservice"/>
<Event id="2002" name="Method::Call" displayname="{action}" format="object{fsc:name};objclass{fsc:reference};action{fsc:reference}"/> </Module> <Module name="Virtual Application" color="rgb(211,95,0)"> <Follower name="WebDAV"/> <Application applname="Fabasoft Folio" appltiername="Webservice"/> <Event id="106" name="ProcessUseCase" displayname="{usecase}" format="usecase{fsc:reference};entertype"/> </Module> |
The module name must match with the registered application module in the telemetry module registration and you can define a specific color that should be used for that module everywhere in the app.telemetry client.
The rule set can be applied for multiple application instances running with different application names or ids just by specifying a list of valid application registration mapping (e.g. the application can register as “Fabasoft Folio” or “Fabasoft Cloud” and the above example will apply for requests from both applications.
You can now assign improved display names for any of your telemetry events identified inside the defined module with the event id. Note: every listed event in this package file will overwrite the original event registration. The following properties can be defined/overwritten with an improved value:
The new displayname for telemetry events is on the one hand available as additional table column in the request details table and on the other hand it is used as default name in the request call stack (the tooltip will show the name and the displayname property as well as some additional information).
Additional to the event definitions the modules can also define a specific ordering of the modules in the request overview chart by means of listing all possible followers of every module.