Crates.io | tracing-actions |
lib.rs | tracing-actions |
version | 0.3.1 |
source | src |
created_at | 2023-05-09 03:17:43.224181 |
updated_at | 2023-06-23 21:30:21.303614 |
description | Tracing subscriber that vends action trace structures to a callback |
homepage | |
repository | https://github.com/kvc0/tracing-actions |
max_upload_size | |
id | 860220 |
size | 29,878 |
Tracing-actions is a tracing
extension for recording service functions.
It gives you a tracing
subscriber to which you can supply a callback. The tracing
crate
is highly general, and that generality is more than some uses need.
If you are trying to send opentelemetry line protocol traces to some service, you need to
materialize whole spans to build up OTLP messages. The ActionTraceSubscriber
gives you a
callback for each completed span. It was made with OTLP in mind, but ActionTrace
s can be
used for any number of other destinations.
Spans used by ActionTraceSubscriber
can be optimistically cached, if you use the LazySpanCache
.
That feature is a simple best-effort racing cache. If 2 threads need a span at the same instant,
one gets a cached span and the other makes a new one. They both try to return the new span to the
cache upon completion, and if the cache is full the span is simply dropped.