提交 d0927d4f 编写于 作者: H heyanlong

report

上级 c6a85ad3
......@@ -455,7 +455,7 @@ static void request_init() {
efree(l_millisecond);
add_assoc_long(&temp, "startTime", millisecond);
add_assoc_string(&temp, "operationName", get_page_request_uri());
// add_assoc_string(&sky_entry_span, "peer", "127.0.0.1");
add_assoc_string(&temp, "peer", "");
add_assoc_long(&temp, "spanType", 0);
add_assoc_long(&temp, "spanLayer", 3);
add_assoc_long(&temp, "componentId", COMPONENT_HTTPCLIENT);
......@@ -517,6 +517,10 @@ static void module_init() {
do {
application_id = applicationCodeRegister(SKYWALKING_G(grpc), SKYWALKING_G(app_code));
if(application_id == -100000) {
sleep(1);
}
i++;
} while (application_id == -100000 && i <= 3);
......@@ -546,6 +550,9 @@ static void module_init() {
application_instance = registerInstance(SKYWALKING_G(grpc), application_id, millisecond, uuid, SKY_OS_NAME,
hostname, getpid(),
ipv4s);
if(application_instance == -100000) {
sleep(1);
}
i++;
} while (application_instance == -100000 && i <= 3);
......
......@@ -185,11 +185,15 @@ int main(int argc, char **argv) {
for (int i = 0; i < spans.size(); i++) {
SpanObject *spanObject = traceSegmentObject.add_spans();
spanObject->set_spanid(spans[i]["spanId"]);
spanObject->set_parentspanid(spans[i]["parentSpanId"]);
spanObject->set_spanid(spans[i]["spanId"].get<int>());
spanObject->set_parentspanid(spans[i]["parentSpanId"].get<int>());
spanObject->set_starttime(spans[i]["startTime"]);
spanObject->set_endtime(spans[i]["endTime"]);
spanObject->set_operationname(spans[i]["operationName"]);
std::string peer(spans[i]["peer"].get<std::string>());
if(!peer.empty()) {
spanObject->set_peer(peer);
}
int spanType = spans[i]["spanType"].get<int>();
if (spanType == 0) {
......@@ -205,7 +209,7 @@ int main(int argc, char **argv) {
spanObject->set_spanlayer(SpanLayer::Http);
}
spanObject->set_componentid(spans[i]["componentId"]);
spanObject->set_componentid(spans[i]["componentId"].get<int>());
spanObject->set_iserror(spans[i]["isError"].get<int>());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册