Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit bbf3078

Browse files
authored
Merge pull request #95 from bostin/fixbug/bostin_mysqli_db_port_to_string
fixbug for go_agent span.tags map[string]string
2 parents d599215 + ad8e0e4 commit bbf3078

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

skywalking.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,16 @@ ZEND_API void sky_execute_internal(zend_execute_data *execute_data, zval *return
414414
#else
415415
char *host = mysql->mysql->data->host;
416416
#endif
417+
char port[6];
418+
sprintf(port, "%d", mysql->mysql->data->port);
417419
add_assoc_string(&tags, "db.host", host);
418-
add_assoc_long(&tags, "db.port", mysql->mysql->data->port);
420+
add_assoc_string(&tags, "db.port", port);
419421
peer = (char *) emalloc(strlen(host) + 10);
420422
bzero(peer, strlen(host) + 10);
421423
sprintf(peer, "%s:%d", host, mysql->mysql->data->port);
422424
}
423425
}
424426

425-
426427
add_assoc_string(&tags, "db.type", "mysql");
427428
// params
428429
uint32_t arg_count = ZEND_CALL_NUM_ARGS(execute_data);

0 commit comments

Comments
 (0)