skywalking icon indicating copy to clipboard operation
skywalking copied to clipboard

can the TraceContext.traceId() is a real traceId when the collector is not running

Open archer-christ opened this issue 8 years ago • 3 comments


Requirement or improvement

When I use TraceContext.traceId() or logback toolkit to log the traceId , if the collector is not running now the it just [Ignored Trace] logged out .

Like sleuth it log the traceId no matter the Zipkin is running. I can use the traceId to anlayse log file or do something else .

So my requirement can the TraceContext.traceId() is a real traceId when the collector is not running , sometimes its lightwight .

archer-christ avatar Mar 21 '18 11:03 archer-christ

@archer-christ I understand your requirement, but I think it is a little hard to implement in current agent. All APIs in application-toolkits are for bridge manual SDK to auto agent core. So when the core is not working, it is really hard to output the id.

I understand Zipkin maybe can go in this way. right? @adriancole But in our trace/segment, there are several keys are based on backend, and for considering performance cost, if the backend is not there at the beginning, the trace core (ContextManager) will not go to work.

So if you are truly interested in this feature, we can have a deep discussion about how to support that, but you need to our core first. I suggest you should start with ContextManager APIs and TracingContext APIs.

wu-sheng avatar Mar 21 '18 12:03 wu-sheng

https://github.com/apache/incubator-skywalking/blob/03824c2f8f43d55746ac466f0252bd78c1b48363/apm-application-toolkit/apm-toolkit-trace/src/main/java/org/skywalking/apm/toolkit/trace/TraceContext.java#L37 这个TraceContext.traceId()方法有实现么?我搜了下代码,没看到耶~

gMan1990 avatar Apr 11 '18 05:04 gMan1990

@archer-christ TraceContext.traceId() is based on SkyWalking agent core too, this class is only a bridge. You can't use SkyWalking as a plugin for your logging system. This is not our target.

wu-sheng avatar Apr 11 '18 06:04 wu-sheng