// pcp_trans is a pointer of transaction that gather all information
appd_bt_handle lc_btHandle = appd_bt_begin( "MY_BT", NULL);
appd_bt_override_start_time_ms(lc_btHandle, pcp_trans->startTime);
appd_bt_override_time_ms(lc_btHandle, pcp_trans->procTime);
for (auto& lcr_extCall: pcp_trans->exitCall) // vector of exit calls
{
appd_exitcall_handle lc_ecHandle = appd_exitcall_begin(lc_btHandle, lcr_extCall.name); // name is the Tier name
appd_exitcall_override_start_time_ms(lc_ecHandle, lcr_extCall.startTime);
appd_exitcall_override_time_ms(lc_ecHandle, lcr_extCall.procTime);
/*
* Here I add the appd context for the service if the context does not exist
*/
const char* lz_corhdr = appd_exitcall_get_correlation_header(lc_ecHandle);
appd_bt_handle lc_corrbtHandle = appd_bt_begin_with_app_context(lcr_extCall.context, "MY_BT", lz_corhdr);
appd_bt_override_start_time_ms(lc_corrbtHandle, lcr_extCall.startTime);
appd_bt_override_time_ms(lc_corrbtHandle, lcr_extCall.procTime);
appd_bt_end(lc_corrbtHandle);
appd_exitcall_end(lc_ecHandle);
}
appd_bt_end(lc_btHandle);
}
Can someone tell me what's wrong ?
Thanks.
Hi @Freddy.Chung,
I tried finding some hopefully helpful AppD documentation. https://docs.appdynamics.com/appd/22.x/latest/en/application-monitoring/install-app-server-agents/ag...
Let me know if that helps out or not.
Hi @Ryan.Paredez ,
Thank you for the reply !
Unfortunately, the documentation you sent to me does not help me to solve the issue.
In the first place, I thought that my Tier names were wrongly valued because of the '-' symbol. But after renaming the Tier without any '-' symbol, I still get the error.
In the notification section, I have a lot of Unknown Events. Is there any way to get more details of those unknown events ?
After using AppDynamics C++ context for each tier (and calling appd_bt_begin_with_app_context), it seems that the AppDynamics controller is not able to identify the business transaction.
If I remove all appd_bt_begin_with_app_context calls, I get a result with all backend grouping under the same remote icon in the dashboard flow map and the business transaction is correctly recognized by the controller. This seems to work pretty well and I am not getting any errors.
However, I am not very satisfied with the flow map because I don't want all of my tiers to be displayed as a remote backend server under one icon.
I add here the code I use to add appd context for each tier. The context name is just a concatenation of application, tier and node name.
if (ms_appdContexts.count(contextName)) // ms_appdContexts is a set of string
return;
appd_context_config* lcp_cfg = appd_context_config_init(contextName);
appd_context_config_set_app_name(lcp_cfg, applicationName);
appd_context_config_set_tier_name(lcp_cfg, tierName);
appd_context_config_set_node_name(lcp_cfg, nodeName);
appd_context_config_set_controller_host(lcp_cfg, cfg->appdControllerHost());
appd_context_config_set_controller_port(lcp_cfg, cfg->appdControllerPort());
appd_context_config_set_controller_account(lcp_cfg, cfg->appdControllerAccount());
appd_context_config_set_controller_access_key(lcp_cfg, cfg->appdControllerAccessKey());
if (cfg->appdControllerUseSsl())
appd_context_config_set_controller_use_ssl(lcp_cfg, 1);
appd_sdk_add_app_context(lcp_cfg);
ms_appdContexts.insert(contextName);
I do not think that this part of the code is the problem as it is pretty much a copy-paste of the AppD C++ SDK example.
In the log file of each agent being launched, I don't see any specific error. The tier name is what I expected and the connection is established.
So I am a little bit lost. I don't know which part of my code produced the error.
Is it allowed to call the appd_bt_begin_with_app_context right after appd_exitcall_begin in the same code ? Is the method appd_sdk_add_app_context a synchronous call ?
Best regards,
Freddy CHUNG
After some tries, it seems that the C++ SDK does not support defining multiple contexts inside the same thread for the same application and node but different tiers.
In my test, I removed all the business transaction parts so the agent is not sending anything. The only thing the code does is to add new contexts with the same application and node name but a different tier name. And the controller still produces the same error.
Is there anyway to display each backend as a tier in the flow map without the need to create a new thread for each tier ?
Freddy CHUNG.