All significant changes to this project will be documented in this file.
- Upgrade MSRV to 1.85 and Edition to 2024.
- Deprecated
Span::enter_with_parents(). It now uses the first non-noop parent as the primary parent and converts additional parents to links.
- Added
Span::with_link()andSpan::add_link(). - Added
LocalSpan::with_link()andLocalSpan::add_link(). - Added
SpanRecord.linksand propagated links through collector post-processing. - Added
serde::Serializeandserde::Deserializesupport forSpanContextusing W3Ctraceparentformat.
- Fixed
#[trace]macro span attachment by generating the wrapper function with the original function span.
- Deprecated
Config::tail_sampled(). - Spans are held until the root span finishes by default, and
Span::cancel()discards spans collected up to the root span drop.
#[trace]macro now supports trait-object futures and preserves input tokens more faithfully to avoid compilation errors.
- Added
#[allow(unreachable_code)]on the macro return hint to quiet new compiler warnings.
- Fixed stale spans not being cleared after reporting.
- Fixed memory leak when reporter is not set.
- Propagated trace context no matter whether the reporter is set.
- Fixed an issue where
SpanContext::random()returned a non-zero parent id.
TraceContext::random()now returns aTraceContextwith randomTraceIdandSpanId.- Added
Config::tail_sampled(), which defaults tofalse. - Added attribute
#[trace(crate = ::fastrace)]to redirect the path to thefastracecrate.
- Deprecated
Config::max_spans_per_trace()andConfig::report_before_root_finish().
- Upgraded MSRV to 1.80.
- Improved performance.
- Added
TraceId::random()andSpanId::random(). - Added
FromStr,Display, andserdesupport forTraceIdandSpanId. - Added
Span::add_property()andSpan::add_properties(). - Added
Span::add_event()andLocalSpan::add_event().
- Deprecated
Event::add_to_parent()andEvent::add_to_local_parent().
- Reduced dependencies to
futures0.3.
- Optimized collect behavior when the span is not sampled.
- Upgraded
opentelemetryto 0.26.0.
- Upgraded
opentelemetryto 0.25.0.
- Allowed
LocalSpan::add_property()when the local parent is aSpan.
- Lowered MSRV to 1.75.
- Upgraded dependencies including
opentelemetryand more. - Removed deprecated methods
Config::batch_report_intervalandConfig::batch_report_max_spans. - Changed
Reporter::report()to takeVec<SpanRecord>instead of&[SpanRecord].
- Added
SpanContext.sampled, which is propagated through child spans.
- Deprecated
full_name!()and renamed it tofull_path!(). - Deprecated
SpanContext::encode_w3c_traceparent_with_sampled().
- Renamed project to
fastrace.
- Added
Config::report_intervalas the background collector interval.
- Deprecated
Config::batch_report_intervalandConfig::batch_report_max_spans. - Fixed a performance issue in object-pool that caused lock racing.
- Upgraded
opentelemetry,opentelemetry_sdk, andopentelemetry-otlp.
- Upgraded to
opentelemetry0.22,opentelemetry_sdk0.22.1, andopentelemetry-otlp0.15.
- Added
LocalSpan::add_propertyandLocalSpan::add_properties. - Added
Config::report_before_root_finish. - Added new crate
fastrace-futures.
- Added
LocalSpans::to_span_records(). - Added
#[trace(properties = { "k1": "v1", "k2": "v2" })]. - Added
func_name!(),full_name!(), andfile_location!()tofastrace::prelude.
- Improved documentation.
- Macro now uses the full function path as the default span name. You can turn this off with
#[trace(short_name = true)]. - Added utility macros
func_name!(),full_name!(), andfile_location!()for span naming. - Added
Span::elapsed()that returns elapsed time since span creation.
- Span name and event name now accept both
&'static strandString(Into<Cow<'static, str>>) instead of only&'static str. with_propertyandwith_propertiesnow acceptimpl Into<Cow<'static, str>>instead of onlyCow<'static, str>.
- Fixed panics due to destruction of Thread Local Storage values.
- Removed
Collectorand replaced it withReporter. - Macro arguments must be named when provided, for example
#[trace(name = "name")].
- Added
Eventtype to represent single points in time during a span lifetime. - Added
fastrace-opentelemetryreporter to send spans to OpenTelemetry collectors. - Allowed statically opting out of tracing by not enabling the
enablefeature.
- Removed
LocalSpanGuardand merged it intoLocalSpan. - Removed
LocalSpan::with_property,LocalSpan::with_properties,Span::with_property, andSpan::with_properties. - Removed
LocalParentGuard;Span::set_local_parentnow returnsOption<Guard<impl FnOnce()>>.
- Added
LocalSpan::add_property,LocalSpan::add_properties,Span::add_property, andSpan::add_properties.
- Added an async variant of Jaeger reporting function
fastrace::report().
LocalSpan::with_propertynow takes&mut selfinstead ofself.
Collector::collect()became async because span collection moved to a background thread to reduce tracing overhead.
- Attribute macro
#[trace]on async functions can automatically extract the caller local parent. Previously, the caller had to callin_span()manually.
- Redesigned all APIs for a better ergonomic experience.
#[trace]now automatically detectsasync fnandasync-trait, and#[trace_async]was removed.