Dynatrace OneAgent SDK for C/C++  1.7.1.1
Functions
In-Process Link Functions

Associate asynchronous tasks in the same process with the current operation. More...

Functions

onesdk_size_t onesdk_inprocesslink_create (unsigned char *buffer, onesdk_size_t buffer_size, onesdk_size_t *required_buffer_size)
 Creates an in-process link. More...
 
onesdk_tracer_handle_t onesdk_inprocesslinktracer_create (unsigned char const *in_process_link, onesdk_size_t in_process_link_size)
 Creates a tracer for tracing asynchronous related processing in the same process. More...
 

Detailed Description

Associate asynchronous tasks in the same process with the current operation.

In-process links allow an application to associate (link) tasks, that will be executed asynchronously in the same process, with the currently running task/operation. The linked tasks may be started and completed at arbitrary times - it's not necessary for them to complete (or even start) before the "parent" operation to which they are linked completes.

For further information, see the high level SDK documentation at https://github.com/Dynatrace/OneAgent-SDK/#in-process-linking

Since
In-process links were added in version 1.2.0.

Function Documentation

◆ onesdk_inprocesslink_create()

onesdk_size_t onesdk_inprocesslink_create ( unsigned char *  buffer,
onesdk_size_t  buffer_size,
onesdk_size_t required_buffer_size 
)

Creates an in-process link.

Parameters
[out]buffer[optional] Pointer to a buffer into which the in-process link shall be copied.
buffer_sizeSize of the buffer pointed to by buffer in bytes. Must be zero if buffer is NULL.
[out]required_buffer_size[optional] Pointer to a onesdk_size_t variable where the required buffer size will be stored.
Returns
The number of bytes copied into buffer.

An application can call this function to retrieve an in-process link, which can then be used to trace related processing at a later time and/or in a different thread.

If required_buffer_size is not NULL, the number of bytes required to store the in-process link is stored in *required_buffer_size.

If buffer is not NULL and buffer_size is big enough, this function will copy the in-process link into the provided buffer.

Note
If no tracer is active on the current thread, the retrieved link will be empty (have zero length).
Links returned by this function are not compatible with dynatrace string or byte tags, they can only be used with onesdk_inprocesslinktracer_create.
Links returned by this function can only be used in the process in which they were created.

For more information see In-Process Link Functions.

Since
This function was added in version 1.2.0.

◆ onesdk_inprocesslinktracer_create()

onesdk_tracer_handle_t onesdk_inprocesslinktracer_create ( unsigned char const *  in_process_link,
onesdk_size_t  in_process_link_size 
)

Creates a tracer for tracing asynchronous related processing in the same process.

Parameters
in_process_linkPointer to an array that holds the in-process link.
in_process_link_sizeSize of the in-process link.
Returns
A handle for the newly created in-process link tracer or ONESDK_INVALID_HANDLE.
Note
If the provided in-process link is empty or invalid, no tracer will be created and this function will return ONESDK_INVALID_HANDLE.

For more information see In-Process Link Functions.

Since
This function was added in version 1.2.0.