cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C++ native client monitoring does not work

Vishal
New Poster

Hi,

 

I am evaluating AppDynamcis. I am trying to connect to a SaaS controller from C++ native application. Followed all the instructions as mentioned here 

https://docs.appdynamics.com/pages/viewpage.action?pageId=42583437#UsingtheC/C++AgentSDK-addheaderto...

 

Added header

Added code to initialize sdk

Performed multiple BT 

but i can't see anything in the UI dashboard. Can someone please tell me what am I doing wrong??

 

const char APP_NAME[] = "Test1";
const char TIER_NAME[] = "T1";
const char NODE_NAME[] = "Node1";
const char CONTROLLER_HOST[] = "my.saas.appdynamics.com";
const int CONTROLLER_PORT = 443;
const char CONTROLLER_ACCOUNT[] = "myaccount";
const char CONTROLLER_ACCESS_KEY[] = "myaccesskey";
const int CONTROLLER_USE_SSL = 1;

int main()
{
    appd_config* cfg = appd_config_init(); // appd_config_init() resets the configuration object and pass back an handle/pointer
    appd_config_set_app_name(cfg, APP_NAME);
    appd_config_set_tier_name(cfg, TIER_NAME);
    appd_config_set_node_name(cfg, NODE_NAME);
    appd_config_set_controller_host(cfg, CONTROLLER_HOST);
    appd_config_set_controller_port(cfg, CONTROLLER_PORT);
    appd_config_set_controller_account(cfg, CONTROLLER_ACCOUNT);
    appd_config_set_controller_access_key(cfg, CONTROLLER_ACCESS_KEY);
    appd_config_set_controller_use_ssl(cfg, CONTROLLER_USE_SSL);    
    const int initRC = appd_sdk_init(cfg);

    if (initRC) {
        std::cerr << "Error: sdk init: " << initRC;
        return -1;
    }

    for (int i = 0; i < 10; ++i)
    {
        // start the "Checkout" transaction
        const appd_bt_handle btHandle = appd_bt_begin("Checkout", nullptr);

        Sleep(1000);

        appd_bt_add_error(btHandle, APPD_LEVEL_ERROR, "Failed", true);

        // end the transaction
        appd_bt_end(btHandle);
    }
    
    appd_sdk_term();

    return 0;
}
2 REPLIES 2

Matej.Beharka
Adventurer

Hi,

 

The same for me, what is really weird, that appd inint method returns success. BTW were you able in the meantime resolve the issue.

 

Best Regards

Matej

Hi,
The issue was license :). You need additional license for C++ SDK even for Python. I somehow traced it in the error log file.
So yeah, init will return success but nothing will work.