Dynatrace OneAgent SDK for C/C++
1.7.1.1
|
Basic functions that can be used with all or multiple tracer types. More...
Functions | |
void | onesdk_tracer_start (onesdk_tracer_handle_t tracer_handle) |
Starts a tracer. More... | |
void | onesdk_tracer_end (onesdk_tracer_handle_t tracer_handle) |
Ends and releases a tracer. More... | |
void | onesdk_tracer_error (onesdk_tracer_handle_t tracer_handle, onesdk_string_t error_class, onesdk_string_t error_message) |
Sets error information for a tracer. More... | |
onesdk_size_t | onesdk_tracer_get_outgoing_dynatrace_string_tag (onesdk_tracer_handle_t tracer_handle, char *buffer, onesdk_size_t buffer_size, onesdk_size_t *required_buffer_size) |
Retrieves the string representation of the tag from an "outgoing taggable" tracer. More... | |
onesdk_size_t | onesdk_tracer_get_outgoing_dynatrace_byte_tag (onesdk_tracer_handle_t tracer_handle, unsigned char *buffer, onesdk_size_t buffer_size, onesdk_size_t *required_buffer_size) |
Retrieves the binary representation of the tag from an "outgoing taggable" tracer. More... | |
void | onesdk_tracer_set_incoming_dynatrace_string_tag (onesdk_tracer_handle_t tracer_handle, onesdk_string_t string_tag) |
Sets the tag of an "incoming taggable" tracer using the string representation. More... | |
void | onesdk_tracer_set_incoming_dynatrace_byte_tag (onesdk_tracer_handle_t tracer_handle, unsigned char const *byte_tag, onesdk_size_t byte_tag_size) |
Sets the tag of an "incoming taggable" tracer using the binary representation. More... | |
Basic functions that can be used with all or multiple tracer types.
Tracers are the objects used to capture information about "operations" (e.g. remote calls or database requests) that your application performs.
Tracers are created by different factory functions, depending on the type of the tracer, and destroyed/released by onesdk_tracer_end.
Tracers are automatically linked to other active tracers on the same thread. To link to an operation that's running in another thread, processes or on another system you have to use the tagging or in-process linking functions.
For further information, see the high level SDK documentation at https://github.com/Dynatrace/OneAgent-SDK/#tracers
void onesdk_tracer_end | ( | onesdk_tracer_handle_t | tracer_handle | ) |
Ends and releases a tracer.
tracer_handle | A valid tracer handle. |
This function releases the specified tracer. Allocated resources are freed and the handle is invalidated.
An application should call onesdk_tracer_start exactly once for each tracer that it has created.
If the tracer has been started, the time measurement will be stopped and its exit fields will be captured before releasing the tracer.
|
inline |
Sets error information for a tracer.
tracer_handle | A valid tracer handle. |
error_class | [optional] Pointer to a string denoting the error class/type/category. |
error_message | [optional] Pointer to a string with the error message. |
An application should call this function to notify a tracer that the traced operations has failed.
onesdk_size_t onesdk_tracer_get_outgoing_dynatrace_byte_tag | ( | onesdk_tracer_handle_t | tracer_handle, |
unsigned char * | buffer, | ||
onesdk_size_t | buffer_size, | ||
onesdk_size_t * | required_buffer_size | ||
) |
Retrieves the binary representation of the tag from an "outgoing taggable" tracer.
tracer_handle | A valid tracer handle. | |
[out] | buffer | [optional] Pointer to a buffer into which the binary representation shall be copied. |
buffer_size | Size 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. |
buffer
.An application can call this function to retrieve the binary representation of the outgoing tag for a tracer. The tracer handle must refer to an "outgoing taggable" tracer that has already been started.
If required_buffer_size
is not NULL
, the number of bytes required to store the binary representation is stored in *required_buffer_size
.
If buffer
is not NULL
and buffer_size
is big enough, this function will copy the binary representation into the provided buffer.
onesdk_size_t onesdk_tracer_get_outgoing_dynatrace_string_tag | ( | onesdk_tracer_handle_t | tracer_handle, |
char * | buffer, | ||
onesdk_size_t | buffer_size, | ||
onesdk_size_t * | required_buffer_size | ||
) |
Retrieves the string representation of the tag from an "outgoing taggable" tracer.
tracer_handle | A valid tracer handle. | |
[out] | buffer | [optional] Pointer to a buffer into which the string representation shall be copied. |
buffer_size | Size 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. |
buffer
, not including the terminating null character.An application can call this function to retrieve the string representation of the outgoing tag for a tracer. The tracer handle must refer to an "outgoing taggable" tracer that has already been started.
If required_buffer_size
is not NULL
, the number of bytes required to store the string representation is stored in *required_buffer_size
.
If buffer
is not NULL
and buffer_size
is big enough, this function will copy the string representation into the provided buffer.
This function will always make sure that, if the application provides a non-NULL
buffer
with a buffer_size
>= 1, buffer
will always be null-terminated. I.e. if the string representation cannot be stored because buffer_size
is too small, a null character will be written into buffer
[0].
The string copied into buffer
uses ASCII encoding.
void onesdk_tracer_set_incoming_dynatrace_byte_tag | ( | onesdk_tracer_handle_t | tracer_handle, |
unsigned char const * | byte_tag, | ||
onesdk_size_t | byte_tag_size | ||
) |
Sets the tag of an "incoming taggable" tracer using the binary representation.
tracer_handle | A valid tracer handle. |
byte_tag | Pointer to an array that holds the binary representation of the incoming tag. |
byte_tag_size | Size of the binary representation of the incoming tag. |
An application can call this function to set the incoming tag of an "incoming taggable" tracer using the binary representation. The tracer handle must refer to an "incoming taggable" tracer that has not been started yet.
If byte_tag_size
is zero, the incoming tag will be reset (cleared).
|
inline |
Sets the tag of an "incoming taggable" tracer using the string representation.
tracer_handle | A valid tracer handle. |
string_tag | The string representation of the incoming tag. |
An application can call this function to set the incoming tag of an "incoming taggable" tracer using the string representation. The tracer handle must refer to an "incoming taggable" tracer that has not been started yet.
If string_tag
is a "null string" or an empty string, the incoming tag will be reset (cleared).
void onesdk_tracer_start | ( | onesdk_tracer_handle_t | tracer_handle | ) |
Starts a tracer.
tracer_handle | A valid tracer handle. |
Starts the specified tracer. This will capture all entry fields of the tracer and start the time measurement.