<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can't trace database requests with oneagent SDK for C/C++ in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111004#M7521</link>
    <description>&lt;P&gt;Thank you. I already checked the post on github and learned that we need to use database tracer with remote call APIs. &lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 08 Jan 2019 05:19:10 GMT</pubDate>
    <dc:creator>hiroshi_aoki</dc:creator>
    <dc:date>2019-01-08T05:19:10Z</dc:date>
    <item>
      <title>Can't trace database requests with oneagent SDK for C/C++</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111000#M7517</link>
      <description>&lt;P&gt;To trace database requests(SQL) from C language program by&lt;BR /&gt;Dynatrace, we are evaluating oneagent SDK.&lt;/P&gt;&lt;P&gt;According to help and github information, we embedded all&lt;BR /&gt;necessary APIs and confirmed that the program successfully retrieves database&lt;BR /&gt;data as expected. On the other hand, while we can only see the connection&lt;BR /&gt;between the C language program(process) and a database process in smartcape and&lt;BR /&gt;infograph of C language program(process), we can’t see any database requests&lt;BR /&gt;executed by the C language program in Dynatrace.&lt;/P&gt;&lt;P&gt;Is there anything we are missing to capture database&lt;BR /&gt;requests(SQL) executed by C language program or our understanding of oneagent&lt;BR /&gt;SDK is wrong? &lt;/P&gt;&lt;P&gt;The below is a sample program with oneagent SDK we are using&lt;BR /&gt; to trace database requests to mysql. The mysql is only accessed by this&lt;BR /&gt;sample program.&lt;/P&gt;&lt;P&gt;----------------------------------------&lt;/P&gt;&lt;P&gt;int main(intargc, char **argv) {&lt;/P&gt;&lt;P&gt;int i = 0;&lt;/P&gt;&lt;P&gt;onesdk_databaseinfo_handle_t db_info_handle = ONESDK_INVALID_HANDLE;&lt;/P&gt;&lt;P&gt;onesdk_tracer_handle_t tracer;&lt;/P&gt;&lt;P&gt;int c;&lt;/P&gt;&lt;P&gt;MYSQL *conn;&lt;/P&gt;&lt;P&gt;MYSQL_RES *res;&lt;/P&gt;&lt;P&gt;MYSQL_ROW row;&lt;/P&gt;&lt;P&gt;constchar query[256] = "SELECT * FROM&lt;BR /&gt;AOKI_DATABASE.personal";&lt;/P&gt;&lt;P&gt;constchar *SERV = "localhost";&lt;/P&gt;&lt;P&gt;constchar *USER = "root";&lt;/P&gt;&lt;P&gt;constchar *PASSWORD = "admin";&lt;/P&gt;&lt;P&gt;constchar *DB_NAME = "AOKI_DATABASE";&lt;/P&gt;&lt;P&gt;constunsignedint PORT = 3306; &lt;/P&gt;&lt;P&gt;  conn =&lt;BR /&gt;mysql_init(NULL);&lt;/P&gt;&lt;P&gt;/* Initialize SDK */&lt;/P&gt;&lt;P&gt;onesdk_result_tconst onesdk_init_result =&lt;BR /&gt;onesdk_initialize();&lt;/P&gt;&lt;P&gt;if (onesdk_init_result&lt;BR /&gt;!= ONESDK_SUCCESS) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_shutdown();&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;printf("SDK&lt;BR /&gt;initialization error ....\n");&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;exit(1);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;/* Create Database&lt;BR /&gt;Object */&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;db_info_handle = onesdk_databaseinfo_create(&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_asciistr("AOKI_DATABASE"),  /* the name of the&lt;BR /&gt;database that you connect to */&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_asciistr(ONESDK_DATABASE_VENDOR_MYSQL),  /* the type of the&lt;BR /&gt;database  */&lt;/P&gt;&lt;P&gt;ONESDK_CHANNEL_TYPE_TCP_IP, &lt;BR /&gt;/*&lt;BR /&gt;channel type  */&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_asciistr("localhost:3306")  /* channel endpoint */);&lt;/P&gt;&lt;P&gt;if (db_info_handle == ONESDK_INVALID_HANDLE) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;printf("onesdk_databaseinfo_create()&lt;BR /&gt;error...\n");&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_shutdown();&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;exit(1);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;/* ... perform the&lt;BR /&gt;database request, consume results ... */&lt;/P&gt;&lt;P&gt;/* database -&lt;BR /&gt;AOKI_DATABASE, table - personal(id, name) */&lt;/P&gt;&lt;P&gt;if&lt;BR /&gt;(!mysql_real_connect(conn, SERV, USER, PASSWORD, DB_NAME, PORT, NULL, 0)) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;fprintf(stderr, "%s\r\n", mysql_error(conn));&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;exit(-1);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;for (i = 1; i &amp;lt; 8;&lt;BR /&gt;i++) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;tracer = onesdk_databaserequesttracer_create_sql(  &lt;/P&gt;&lt;P&gt; &lt;BR /&gt;db_info_handle,&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_asciistr("SELECT * FROM AOKI_DATABASE.personal"));&lt;/P&gt;&lt;P&gt;if (tracer == ONESDK_INVALID_HANDLE) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;printf("onesdk_databaserequesttracer_create_sql()&lt;BR /&gt;eror...\n");&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;c = getchar();&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_databaseinfo_delete(db_info_handle);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_shutdown();&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;exit(1);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;  printf("onesdk_databaserequesttracer_create_sql()...sucess\n");&lt;/P&gt;&lt;P&gt;/* start&lt;BR /&gt;tracer */&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_tracer_start(tracer);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;printf("onesdk_trace_start()...\n");&lt;/P&gt;&lt;P&gt;if (mysql_query(conn,&lt;BR /&gt;query)) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;fprintf(stderr, "%s\r\n", mysql_error(conn));&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;exit(-1);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;res = mysql_use_result(conn);&lt;/P&gt;&lt;P&gt;while (NULL != (row =&lt;BR /&gt;mysql_fetch_row(res))) {&lt;/P&gt;&lt;P&gt;unsignedint col;&lt;/P&gt;&lt;P&gt;for (col = 0; col &amp;lt;&lt;BR /&gt;mysql_num_fields(res); col++) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;printf("%s&lt;BR /&gt;",&lt;BR /&gt;row[col]);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;printf("\r\n");&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (NULL != res) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;mysql_free_result(res);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_tracer_end(tracer);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;Sleep(12000);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;if (NULL != conn) {&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;mysql_close(conn);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_databaseinfo_delete(db_info_handle);&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;onesdk_shutdown();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;-------------------------------------&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 29 Dec 2018 08:54:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111000#M7517</guid>
      <dc:creator>hiroshi_aoki</dc:creator>
      <dc:date>2018-12-29T08:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can't trace database requests with oneagent SDK for C/C++</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111001#M7518</link>
      <description>&lt;P&gt;Hello, did you checked OneAgent Logs? There is possibility that potential root cause will show up there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;&lt;P&gt;Sebastian &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 29 Dec 2018 16:43:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111001#M7518</guid>
      <dc:creator>skrystosik</dc:creator>
      <dc:date>2018-12-29T16:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can't trace database requests with oneagent SDK for C/C++</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111002#M7519</link>
      <description>&lt;P&gt;Hi - just for reference, the question has already been answered by our team on GitHub: &lt;A href="https://github.com/Dynatrace/OneAgent-SDK-for-C/issues/4"&gt;https://github.com/Dynatrace/OneAgent-SDK-for-C/is...&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Jan 2019 10:26:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111002#M7519</guid>
      <dc:creator>sonja</dc:creator>
      <dc:date>2019-01-07T10:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can't trace database requests with oneagent SDK for C/C++</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111003#M7520</link>
      <description>&lt;P&gt;Great answer!&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Jan 2019 10:29:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111003#M7520</guid>
      <dc:creator>radek_jasinski</dc:creator>
      <dc:date>2019-01-07T10:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can't trace database requests with oneagent SDK for C/C++</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111004#M7521</link>
      <description>&lt;P&gt;Thank you. I already checked the post on github and learned that we need to use database tracer with remote call APIs. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Jan 2019 05:19:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Can-t-trace-database-requests-with-oneagent-SDK-for-C-C/m-p/111004#M7521</guid>
      <dc:creator>hiroshi_aoki</dc:creator>
      <dc:date>2019-01-08T05:19:10Z</dc:date>
    </item>
  </channel>
</rss>

