Skip to content

edgemicro tracing issue #147

@ctcxiao

Description

@ctcxiao

Hi there,I found an issue when using edgemicro tracing function. I have one project with opentracing call edgemicro and edgemicro forward to my backend server.

the call chain is like this:

projectA with opentracing -> edgemciro -> projectB with opentracing

I use jaeger backend,but in fact, edgemicro not send its trace information to my jaeger backend.
And my edgemicro start command is as below:

EDGEMICRO_OPENTRACE=true EDGEMICRO_TRACE_MODULE=path/to/tracer edgemicro start -o internal -e development -k xxxx -s xxx

and my tracer core code is as below, I use jaeger client in initTracer function:

module.exports = {
	 initTracerMod: function(name) {
	 	const tracer = initTracer(config, options)
		return tracer;
	}
}

I this it's ok, but edgemicro trace function not works well.so I try to find root cause in source code.At last I found an issue in source code at this file https://github.com/apigee/microgateway-core/blob/master/lib/trace-helper.js

at line 32:

 `requestspan = proxyTrace.extract(FORMAT_HTTP_HEADERS, req.headers);`

proxyTrace.extract function need to return an spanContext, not a span.and at line 37-39, use it to set tag

 requestspan.setTag(Tags.HTTP_URL, req.url);
 requestspan.setTag(Tags.HTTP_METHOD, req.method);

here will occur setTag is not a function error, but in source code it catch the err but do nothing, so the error will gone.the trace information will not be sent as well.

That's all about edgemicro tracing issue.Hope it will be fixed as soon.

thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions