openzipkin / zipkin-support

repository for support questions raised as issues
4 stars 2 forks source link

Duration for async one way span #24

Open DarwinSin opened 4 years ago

DarwinSin commented 4 years ago

The duration of an async one way span is not captured on the Zipkin UI. The span is shared across processes, with only ‘cs’ and ‘sr’ annotations captured at the client and server side respectively. There is an explicit Start and flush in both client and server. No spam.finish invoked anywhere. The trace json from the zipkin server shows 2 spans with the same Id, each having the correct time stamp and no duration. I effectively want to see the duration of this entire span from Cs to Sr . - I see this information on the right tab of the span as ‘Relative Time’ under the ‘Server Start’ annotation. But the actual span does not show the duration bar. Using 2.21 version of zipkin with inmemory storage and java brave client library. Am I missing anything, or is this the expected behaviour?

codefromthecrypt commented 4 years ago

@DarwinSin we've deprecated the practice of one-way for the reason you mention

DarwinSin commented 4 years ago

@DarwinSin we've deprecated the practice of one-way for the reason you mention

So if I want to capture the duration between processes in a span, how do I go about it?

codefromthecrypt commented 4 years ago

span should use normal start/finish apis. the duration between different spans is currently not done anywhere except in the trace view

DarwinSin commented 4 years ago

When sharing spans across processes, the normal start and finish would work though, would it? Are there any recommendations on how this can be modelled/implemented?

codefromthecrypt commented 4 years ago

@DarwinSin sharing spans across processes is an anti-practice at this point. the only use case to share a span ID is client+server for legacy reasons, and in modeling that, both should have timestamp and duration, and the server-side have the "shared" flag set to disambiguate it.

https://github.com/openzipkin/zipkin-api/blob/master/zipkin2-api.yaml