mirror of
https://github.com/emqx/neuron.git
synced 2026-10-22 01:05:56 +08:00
otel:rm log
This commit is contained in:
@@ -593,26 +593,6 @@ static int adapter_responseto(neu_adapter_t * adapter,
|
||||
neu_reqresp_head_t *pheader = neu_msg_get_header(msg);
|
||||
strcpy(pheader->sender, adapter->name);
|
||||
|
||||
neu_otel_trace_ctx trace = NULL;
|
||||
neu_otel_scope_ctx scope = NULL;
|
||||
if (neu_otel_control_is_started()) {
|
||||
trace = neu_otel_find_trace(header->ctx);
|
||||
if (trace) {
|
||||
scope = neu_otel_add_span(trace);
|
||||
neu_otel_scope_set_span_name(scope, "adapter write tag response");
|
||||
char new_span_id[36] = { 0 };
|
||||
neu_otel_new_span_id(new_span_id);
|
||||
neu_otel_scope_set_span_id(scope, new_span_id);
|
||||
uint8_t *p_sp_id = neu_otel_scope_get_pre_span_id(scope);
|
||||
if (p_sp_id) {
|
||||
neu_otel_scope_set_parent_span_id2(scope, p_sp_id, 8);
|
||||
}
|
||||
neu_otel_scope_add_span_attr_int(scope, "thread id",
|
||||
(int64_t) pthread_self());
|
||||
neu_otel_scope_set_span_start_time(scope, neu_time_ms());
|
||||
}
|
||||
}
|
||||
|
||||
int ret = neu_send_msg_to(adapter->control_fd, &dst, msg);
|
||||
if (0 != ret) {
|
||||
nlog_error("adapter: %s send responseto %s failed, ret: %d, errno: %d",
|
||||
@@ -621,10 +601,6 @@ static int adapter_responseto(neu_adapter_t * adapter,
|
||||
neu_msg_free(msg);
|
||||
}
|
||||
|
||||
if (neu_otel_control_is_started() && trace) {
|
||||
neu_otel_scope_set_span_end_time(scope, neu_time_ms());
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,12 +55,11 @@ int neu_plugin_op(neu_plugin_t *plugin, neu_reqresp_head_t head, void *data)
|
||||
neu_otel_scope_ctx scope = NULL;
|
||||
|
||||
if (head.otel_trace_type == NEU_OTEL_TRACE_TYPE_REST_COMM) {
|
||||
nng_aio * aio = (nng_aio *) head.ctx;
|
||||
nng_http_req *nng_req = nng_aio_get_input(aio, 0);
|
||||
const char * http_method = nng_http_req_get_method(nng_req);
|
||||
|
||||
if (neu_otel_control_is_started()) {
|
||||
const char *trace_parent =
|
||||
nng_aio * aio = (nng_aio *) head.ctx;
|
||||
nng_http_req *nng_req = nng_aio_get_input(aio, 0);
|
||||
const char * http_method = nng_http_req_get_method(nng_req);
|
||||
const char * trace_parent =
|
||||
nng_http_req_get_header(nng_req, "traceparent");
|
||||
const char *trace_state =
|
||||
nng_http_req_get_header(nng_req, "tracestate");
|
||||
|
||||
Reference in New Issue
Block a user