twitter/finagle

Let's support non-RPC spans

開放

#541 建立於 2016年8月9日

 (10 則留言) (2 個反應) (0 位負責人)Scala (1,435 個分叉)batch import
help wanted

倉庫指標

星標
 (8,864 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

The current tracing system is special-cased for client and server spans. There are non-rpc spans, such as expensive local code or messaging activity that are not currently representable in finagle. Let's make them possible!

Expected behavior

I'd like to be able to indicate the start and finish of an abstract operation, without relying on annotation values. For example:

Trace.recordStart() -> Tracer.record(Annotation.Start())
Trace.recordOperation(message: operation) -> Tracer.record(Annotation.Operation(operation))
Trace.recordFinish() -> Tracer.record(Annotation.Finish())
Trace.recordError(message: String) -> Tracer.record(Annotation.Error(message))

These annotations control the authoritative start and finish (success or error) of an abstract span. Annotation.Operation is the same use as Annotation.Rpc, except it more clearly indicates it isn't necessarily an RPC (ex a one-way message).

Actual behavior

Right now, you can only authoritatively create and finish RPC spans. If you create a different type of span, you end up with a "finagle.flush" annotation 2 minutes later as the tracer has no idea that the span is complete. It is also impossible to create a span that only includes binary annotations.

貢獻者指南