Dynatrace OneAgent SDK for C/C++  1.7.1.1
Functions
Miscellaneous

Functions

onesdk_xchar_t const * onesdk_agent_get_version_string (void)
 Returns the version string of the loaded SDK agent module. More...
 
onesdk_int32_t onesdk_agent_get_current_state (void)
 Returns the current agent state. More...
 
void onesdk_agent_set_logging_callback (onesdk_agent_logging_callback_t *agent_logging_callback)
 DEPRECATED. Sets the agent warning callback function. More...
 
onesdk_result_t onesdk_agent_set_warning_callback (onesdk_agent_logging_callback_t *agent_logging_callback)
 Sets the agent warning callback function. More...
 
onesdk_result_t onesdk_agent_set_verbose_callback (onesdk_agent_logging_callback_t *agent_logging_callback)
 Sets the verbose agent logging callback function. More...
 
onesdk_int32_t onesdk_agent_get_fork_state (void)
 Returns the current agent fork state. Only relevant if you used ONESDK_INIT_FLAG_FORKABLE. See Agent forking state constants. More...
 

Detailed Description

Function Documentation

◆ onesdk_agent_get_current_state()

onesdk_int32_t onesdk_agent_get_current_state ( void  )

Returns the current agent state.

Returns
The current agent state.
See also
Agent state constants

◆ onesdk_agent_get_fork_state()

onesdk_int32_t onesdk_agent_get_fork_state ( void  )

Returns the current agent fork state. Only relevant if you used ONESDK_INIT_FLAG_FORKABLE. See Agent forking state constants.

Calling this function only has a defined result when onesdk_agent_get_current_state returns ONESDK_AGENT_STATE_ACTIVE or ONESDK_AGENT_STATE_TEMPORARILY_INACTIVE.

Returns
The current agent fork state, i.e., one of the agent_fork_state_constants.
See also
Agent forking state constants

◆ onesdk_agent_get_version_string()

onesdk_xchar_t const* onesdk_agent_get_version_string ( void  )

Returns the version string of the loaded SDK agent module.

Returns
A pointer to a null-terminated onesdk_xchar_t string constant that indicates the version of the loaded SDK agent module. May also contain the version of the module that was last attempted to load if the last SDK initialization failed but the agent version could still be determined. If the agent has not been initialized yet or its version could not be determined, this function will return an empty string.

Your application should not try to parse the version string or make any assumptions about its format.

See also
onesdk_stub_get_agent_load_info can be used to query if a compatible agent was found.

◆ onesdk_agent_set_logging_callback()

void onesdk_agent_set_logging_callback ( onesdk_agent_logging_callback_t agent_logging_callback)

DEPRECATED. Sets the agent warning callback function.

Parameters
agent_logging_callbackThe new agent warning callback function.
Deprecated:
From 1.5 on, use onesdk_agent_set_warning_callback instead, which has a return code but is otherwise the same (onesdk_agent_set_logging_callback, like onesdk_agent_set_warning_callback, can fail but it has no way to report errors).

◆ onesdk_agent_set_verbose_callback()

onesdk_result_t onesdk_agent_set_verbose_callback ( onesdk_agent_logging_callback_t agent_logging_callback)

Sets the verbose agent logging callback function.

Parameters
agent_logging_callbackThe new verbose agent logging callback function.
Returns
ONESDK_SUCCESS if successful, an SDK stub error code otherwise.

Similar to onesdk_agent_set_warning_callback but the callback supplied here will not be called with warning messages but with additional messages that may e.g. explain why a PurePath was not created even if the reason is (usually) benign.

Note
Warning
This callback can receive lots and lots of messages. You should not usually use it in production.
Since
This function was added in version 1.5.0.

◆ onesdk_agent_set_warning_callback()

onesdk_result_t onesdk_agent_set_warning_callback ( onesdk_agent_logging_callback_t agent_logging_callback)

Sets the agent warning callback function.

Parameters
agent_logging_callbackThe new agent warning callback function.
Returns
ONESDK_SUCCESS if successful, an SDK stub error code otherwise.

The agent warning callback is called whenever one of the following happens while executing an SDK function:

  • An SDK usage error is detected or
  • An unexpected or unusual event (e.g. out of memory) prevented an operation from completing successfully.

The agent warning callback is only ever called from SDK functions (i.e., it can only be invoked on threads that call SDK functions, while the SDK function is executing). The application must not call any SDK functions from the callback.

This mechanism is provided primarily as a development and debugging aid. Typically, you should set it once, right after initializing the SDK and never change it (though changing the callback is supported, it rarely makes sense).

There is no default logging function.

Note
This function requires that the SDK is initialized (using onesdk_initialize or onesdk_initialize_2).
See also
onesdk_agent_logging_callback_t
onesdk_stub_set_logging_callback sets the callback that is used for logging before and while the agent is loaded.
Since
This function was added in version 1.5.0, as a replacement for onesdk_agent_set_logging_callback.