twitter/finagle

Let's support non-RPC spans

Open

#541 aberto em 9 de ago. de 2016

Ver no GitHub
 (10 comments) (2 reactions) (0 assignees)Scala (1.435 forks)batch import
help wanted

Métricas do repositório

Stars
 (8.864 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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.

Guia do colaborador