diff --git a/CHANGELOG.md b/CHANGELOG.md index 02a1978..5d1fc76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,160 +1,270 @@ -# Changelog +# CHANGELOG + +All significant changes to this project will be documented in this file. ## Unreleased +## v0.7.17 + +### Breaking Changes + +* Deprecated `Span::enter_with_parents()`. It now uses the first non-noop parent as the primary parent and converts additional parents to links. + +### New Features + +* Added `Span::with_link()` and `Span::add_link()`. +* Added `LocalSpan::with_link()` and `LocalSpan::add_link()`. +* Added `SpanRecord.links` and propagated links through collector post-processing. +* Added `serde::Serialize` and `serde::Deserialize` support for `SpanContext` using W3C `traceparent` format. + +### Bug Fixes + +* Fixed `#[trace]` macro span attachment by generating the wrapper function with the original function span. + ## v0.7.16 -- Deprecate `Config::tail_sampled()`; spans are held until the root span finishes by default, and `Span::cancel()` discards spans collected up to the root's drop. +### Improvements + +* 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. ## v0.7.15 -- `#[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. +### Bug Fixes + +* `#[trace]` macro now supports trait-object futures and preserves input tokens more faithfully to avoid compilation errors. + +### Improvements + +* Added `#[allow(unreachable_code)]` on the macro return hint to quiet new compiler warnings. ## v0.7.14 -- Fix stale spans not being cleared after reporting. +### Bug Fixes -## v0.7.13 +* Fixed stale spans not being cleared after reporting. -- Fix memory leak when reporter is not set. +## v0.7.13 -## v0.7.12 +### Bug Fixes -- Propagate trace context no matter the reporter is set or not. +* Fixed memory leak when reporter is not set. ## v0.7.12 -- Fix the issue that`SpanContext::random()` returns a non-zero parent id. +### Bug Fixes + +* Propagated trace context no matter whether the reporter is set. +* Fixed an issue where `SpanContext::random()` returned a non-zero parent id. ## v0.7.10 -- `TraceContext::random()` now returns a `TraceContext` with random `TraceId` and `SpanId`. -- Add `Config::tail_sampled()`, which defaults to `false`. -- Add attribute `#[trace(crate = ::fastrace)]` to redirect the path to `fastrace` crate. -- Deprecate `Config::max_spans_per_trace()` and `Config::report_before_root_finish()`. +### New Features + +* `TraceContext::random()` now returns a `TraceContext` with random `TraceId` and `SpanId`. +* Added `Config::tail_sampled()`, which defaults to `false`. +* Added attribute `#[trace(crate = ::fastrace)]` to redirect the path to the `fastrace` crate. + +### Improvements + +* Deprecated `Config::max_spans_per_trace()` and `Config::report_before_root_finish()`. ## v0.7.9 -- Upgrade MSRV to 1.80. -- Improved performance. +### Breaking Changes + +* Upgraded MSRV to 1.80. + +### Improvements + +* Improved performance. ## v0.7.8 -- Add `TraceId::random()` and `SpanId::random()`. -- Add `FromStr`, `Display`, and `serde` support for `TraceId`, `SpanId`. -- Add `Span::add_property()` and `Span::add_properties()`. -- Add `Span::add_event()` and `LocalSpan::add_event()`. -- Deprecate `Event::add_to_parent()` and `Event::add_to_local_parent()`. +### New Features + +* Added `TraceId::random()` and `SpanId::random()`. +* Added `FromStr`, `Display`, and `serde` support for `TraceId` and `SpanId`. +* Added `Span::add_property()` and `Span::add_properties()`. +* Added `Span::add_event()` and `LocalSpan::add_event()`. + +### Improvements + +* Deprecated `Event::add_to_parent()` and `Event::add_to_local_parent()`. ## v0.7.6 -- Reduce dependencies to futures 0.3. +### Improvements + +* Reduced dependencies to `futures` 0.3. ## v0.7.5 -- Optimize collect behavior when the span is not sampled. +### Improvements + +* Optimized collect behavior when the span is not sampled. ## v0.7.4 -- Upgrade opentelemtry to 0.26.0. +### Improvements + +* Upgraded `opentelemetry` to 0.26.0. ## v0.7.3 -- Upgrade opentelemtry to 0.25.0. +### Improvements + +* Upgraded `opentelemetry` to 0.25.0. ## v0.7.2 -- Allow to `LocalSpan::add_property()` when the local parent is a `Span`. +### New Features + +* Allowed `LocalSpan::add_property()` when the local parent is a `Span`. ## v0.7.1 -- Lower MSRV to 1.75. +### Improvements + +* Lowered MSRV to 1.75. ## v0.7.0 -- Upgrade dependencies including opentelemtry and more. -- Remove deprecated methods `Config::batch_report_interval` and `Config::batch_report_max_spans`. -- Deprecate `full_name!()` and rename it to `full_path!()`. -- Deprecate `SpanContext::encode_w3c_traceparent_with_sampled()`. -- Pass `Vec` to `Reporter::report()` instead of `&[SpanRecord]`. -- Added `SpanContext.sampled`, which will be propagated through the child spans. +### Breaking Changes + +* Upgraded dependencies including `opentelemetry` and more. +* Removed deprecated methods `Config::batch_report_interval` and `Config::batch_report_max_spans`. +* Changed `Reporter::report()` to take `Vec` instead of `&[SpanRecord]`. + +### New Features + +* Added `SpanContext.sampled`, which is propagated through child spans. + +### Improvements + +* Deprecated `full_name!()` and renamed it to `full_path!()`. +* Deprecated `SpanContext::encode_w3c_traceparent_with_sampled()`. ## v0.6.8 -- Project rename to `fastrace`. +### Breaking Changes + +* Renamed project to `fastrace`. ## v0.6.7 -- Add `Config::report_interval`: The background collector working interval. -- Deprecate `Config::batch_report_interval` and `Config::batch_report_max_spans`. -- Fix a performance issue in object-pool which was causing lock racing. +### New Features + +* Added `Config::report_interval` as the background collector interval. + +### Improvements + +* Deprecated `Config::batch_report_interval` and `Config::batch_report_max_spans`. +* Fixed a performance issue in object-pool that caused lock racing. ## v0.6.6 -- Update to opentelemetry, opentelemetry_sdk, and opentelemetry-otlp. +### Improvements + +* Upgraded `opentelemetry`, `opentelemetry_sdk`, and `opentelemetry-otlp`. ## v0.6.5 -- Update to opentelemetry 0.22, opentelemetry_sdk 0.22.1, and opentelemetry-otlp: 0.15. +### Improvements + +* Upgraded to `opentelemetry` 0.22, `opentelemetry_sdk` 0.22.1, and `opentelemetry-otlp` 0.15. ## v0.6.4 -- Add `LocalSpan::add_property` and `LocalSpan::add_properties`. -- Add `Config::report_before_root_finish`. -- Add new crate `fastrace-futures`. +### New Features + +* Added `LocalSpan::add_property` and `LocalSpan::add_properties`. +* Added `Config::report_before_root_finish`. +* Added new crate `fastrace-futures`. ## v0.6.3 -- Add `LocalSpans::to_span_records()`. -- Add `#[trace(properties = { "k1": "v1", "k2": "v2" })]`. -- Add `func_name!()`, `full_name!()`, and `file_location!()` to `fastrace::prelude`. +### New Features + +* Added `LocalSpans::to_span_records()`. +* Added `#[trace(properties = { "k1": "v1", "k2": "v2" })]`. +* Added `func_name!()`, `full_name!()`, and `file_location!()` to `fastrace::prelude`. ## v0.6.2 -- Improve documentation. +### Improvements + +* Improved documentation. ## v0.6.1 -- Macro will use the full path of the function as span name instead of the only function name. You can turn it off by setting `#[trace(short_name = true)]`. -- Add utility macros `func_name!()`, `full_name!()`, and `file_location!()` to generate names for use in span. -- Add `Span::elapsed()` that returns the elapsed time since the span is created. +### New Features + +* 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!()`, and `file_location!()` for span naming. +* Added `Span::elapsed()` that returns elapsed time since span creation. ## v0.6.0 -- Span name and event name now accept both `&'static str` and `String` (`Into>`), which previously only accept `&'static str`. -- `with_property` and `with_properties` now accept `impl Into>`, which previously accept `Cow<'static, str>`. +### Improvements + +* Span name and event name now accept both `&'static str` and `String` (`Into>`) instead of only `&'static str`. +* `with_property` and `with_properties` now accept `impl Into>` instead of only `Cow<'static, str>`. ## v0.5.1 -- Fix panics due to destruction of Thread Local Storage value +### Bug Fixes + +* Fixed panics due to destruction of Thread Local Storage values. ## v0.5.0 -- Add `Event` type to represent single points in time during the span's lifetime. -- Add `fastrace-opentelementry` reporter that reports spans to OpenTelemetry collector. -- Removed `Collector` and replaced it with `Reporter`. -- The macro arguments must be named if any, e.g. `#[trace(name="name")]`. -- Allow to statically opt-out of tracing by not setting `enable` feature. +### Breaking Changes + +* Removed `Collector` and replaced it with `Reporter`. +* Macro arguments must be named when provided, for example `#[trace(name = "name")]`. + +### New Features + +* Added `Event` type to represent single points in time during a span lifetime. +* Added `fastrace-opentelemetry` reporter to send spans to OpenTelemetry collectors. +* Allowed statically opting out of tracing by not enabling the `enable` feature. ## v0.4.0 -- Remove `LocalSpanGuard` and merge it into `LocalSpan`. -- Remove `LocalSpan::with_property`, `LocalSpan::with_properties`, `Span::with_property` and `Span::with_properties`. -- Add `LocalSpan::add_property`, `LocalSpan::add_properties`, `Span::add_property` and `Span::add_properties`. -- Remove `LocalParentGuard`. `Span::set_local_parent` returns a general `Option>` instead. +### Breaking Changes + +* Removed `LocalSpanGuard` and merged it into `LocalSpan`. +* Removed `LocalSpan::with_property`, `LocalSpan::with_properties`, `Span::with_property`, and `Span::with_properties`. +* Removed `LocalParentGuard`; `Span::set_local_parent` now returns `Option>`. + +### New Features + +* Added `LocalSpan::add_property`, `LocalSpan::add_properties`, `Span::add_property`, and `Span::add_properties`. ## v0.3.1 -- Add an async variant of jaeger reporting function `fastrace::report()`. -- `LocalSpan::with_property` now no longer takes `self` but `&mut self` instead. +### New Features + +* Added an async variant of Jaeger reporting function `fastrace::report()`. + +### Improvements + +* `LocalSpan::with_property` now takes `&mut self` instead of `self`. ## v0.3.0 -- `Collector::collect()` becomes an async function because the span collection work is moved to a background thread to extremely reduce the performance overhead on the code being tracing. -- Attribute macro `#[trace]` on async function becomes able to automatically extract the local parent in the caller's context. Previously, the caller must manually call `in_span()`. +### Breaking Changes + +* `Collector::collect()` became async because span collection moved to a background thread to reduce tracing overhead. + +### New Features + +* Attribute macro `#[trace]` on async functions can automatically extract the caller local parent. Previously, the caller had to call `in_span()` manually. ## v0.2.0 -- All API get redesigned for better egnormic experience. -- Attribute macro `#[trace]` automatically detects `async fn` and crate `async-trait`, and since that, `#[trace_async]` is removed. +### Breaking Changes + +* Redesigned all APIs for a better ergonomic experience. +* `#[trace]` now automatically detects `async fn` and `async-trait`, and `#[trace_async]` was removed. diff --git a/Cargo.lock b/Cargo.lock index 9e51a13..7311d7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,7 +353,7 @@ name = "example" version = "0.0.0" dependencies = [ "anyhow", - "fastrace 0.7.16", + "fastrace 0.7.17", "fastrace-datadog", "fastrace-jaeger", "fastrace-opentelemetry", @@ -394,14 +394,14 @@ dependencies = [ [[package]] name = "fastrace" -version = "0.7.16" +version = "0.7.17" dependencies = [ "async-trait", "crossbeam", "divan", "fastant", - "fastrace 0.7.16", - "fastrace-macro 0.7.16", + "fastrace 0.7.17", + "fastrace-macro 0.7.17", "fastrace-opentelemetry", "flume", "futures-timer", @@ -425,9 +425,9 @@ dependencies = [ [[package]] name = "fastrace-datadog" -version = "0.7.16" +version = "0.7.17" dependencies = [ - "fastrace 0.7.16", + "fastrace 0.7.17", "log", "reqwest", "rmp-serde", @@ -436,10 +436,10 @@ dependencies = [ [[package]] name = "fastrace-futures" -version = "0.7.16" +version = "0.7.17" dependencies = [ "async-stream", - "fastrace 0.7.16", + "fastrace 0.7.17", "futures", "futures-core", "futures-sink", @@ -449,9 +449,9 @@ dependencies = [ [[package]] name = "fastrace-jaeger" -version = "0.7.16" +version = "0.7.17" dependencies = [ - "fastrace 0.7.16", + "fastrace 0.7.17", "log", "thrift_codec", ] @@ -470,9 +470,9 @@ dependencies = [ [[package]] name = "fastrace-macro" -version = "0.7.16" +version = "0.7.17" dependencies = [ - "fastrace 0.7.16", + "fastrace 0.7.17", "proc-macro-error2", "proc-macro2", "quote", @@ -481,9 +481,9 @@ dependencies = [ [[package]] name = "fastrace-opentelemetry" -version = "0.15.1" +version = "0.16.0" dependencies = [ - "fastrace 0.7.16", + "fastrace 0.7.17", "log", "opentelemetry", "opentelemetry-otlp", @@ -2133,7 +2133,7 @@ version = "0.0.0" dependencies = [ "async-stream", "async-trait", - "fastrace 0.7.16", + "fastrace 0.7.17", "futures", "log", "logcall", @@ -2145,7 +2145,7 @@ dependencies = [ name = "test-statically-disable" version = "0.0.0" dependencies = [ - "fastrace 0.7.16", + "fastrace 0.7.17", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index cb25a12..82060ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,8 +22,8 @@ rust-version = "1.80.0" [workspace.dependencies] # Workspace dependencies -fastrace = { version = "0.7.16", path = "fastrace" } -fastrace-macro = { version = "=0.7.16", path = "fastrace-macro" } +fastrace = { version = "0.7.17", path = "fastrace" } +fastrace-macro = { version = "0.7.17", path = "fastrace-macro" } # Workspace leaves fastrace-datadog = { path = "fastrace-datadog" } diff --git a/fastrace-datadog/Cargo.toml b/fastrace-datadog/Cargo.toml index e80cb78..2b3c5f6 100644 --- a/fastrace-datadog/Cargo.toml +++ b/fastrace-datadog/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastrace-datadog" -version = "0.7.16" +version = "0.7.17" categories = ["development-tools::debugging"] description = "Datadog reporter for fastrace" diff --git a/fastrace-futures/Cargo.toml b/fastrace-futures/Cargo.toml index 3ed78bd..9db9c5c 100644 --- a/fastrace-futures/Cargo.toml +++ b/fastrace-futures/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastrace-futures" -version = "0.7.16" +version = "0.7.17" categories = ["development-tools::debugging"] description = "Utilities for tracing `futures` with fastrace" diff --git a/fastrace-jaeger/Cargo.toml b/fastrace-jaeger/Cargo.toml index 49ca66a..da3c5e1 100644 --- a/fastrace-jaeger/Cargo.toml +++ b/fastrace-jaeger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastrace-jaeger" -version = "0.7.16" +version = "0.7.17" categories = ["development-tools::debugging"] description = "Jaeger reporter for fastrace" diff --git a/fastrace-macro/Cargo.toml b/fastrace-macro/Cargo.toml index 7b34522..59befa8 100644 --- a/fastrace-macro/Cargo.toml +++ b/fastrace-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastrace-macro" -version = "0.7.16" +version = "0.7.17" categories = ["development-tools::debugging"] description = "Attribute procedural macro for fastrace" diff --git a/fastrace-opentelemetry/CHANGELOG.md b/fastrace-opentelemetry/CHANGELOG.md index 517ca69..c34a2ca 100644 --- a/fastrace-opentelemetry/CHANGELOG.md +++ b/fastrace-opentelemetry/CHANGELOG.md @@ -1,45 +1,79 @@ -# Changelog +# CHANGELOG + +All significant changes to this project will be documented in this file. ## Unreleased +## v0.16.0 + +### New Features + +* Added OpenTelemetry link export support by mapping `SpanRecord.links` to OTel span links. + ## v0.15.1 -* Add a bridge to extract the current fastrace `SpanContext` and convert it as the current OpenTelemetry `Context`. +### New Features + +* Added a bridge to extract current fastrace `SpanContext` and convert it into current OpenTelemetry `Context`. ## v0.15.0 -* Recognise `SpanContext.is_remote` from the `span.parent_span_is_remote` properties on spans. -* Stop exporting OpenTelemetry-reserved properties (span kind, status, remote parent) as generic span attributes. +### New Features + +* Recognized `SpanContext.is_remote` from `span.parent_span_is_remote` span property. + +### Improvements + +* Stopped exporting OpenTelemetry-reserved properties (`span.kind`, status fields, remote parent flag) as generic span attributes. ## v0.14.0 -* Upgrade opentelemtry to 0.31.0. +### Improvements + +* Upgraded `opentelemetry` to 0.31.0. ## v0.13.0 -* Recognise `Status` from the `span.status_code` and `span.status_description` properties on spans. +### New Features + +* Recognized span status from `span.status_code` and `span.status_description` properties. ## v0.12.0 -* Remove `SpanKind` argument from `OpenTelemetryReporter::new()`. -* Recognise `SpanKind` from the `span.kind` property on spans. +### Breaking Changes + +* Removed `SpanKind` argument from `OpenTelemetryReporter::new()`. + +### New Features + +* Recognized `SpanKind` from `span.kind` span property. ## v0.11.0 -* Upgrade opentelemtry to 0.30.0. +### Improvements + +* Upgraded `opentelemetry` to 0.30.0. ## v0.10.0 -* Upgrade opentelemtry to 0.29.0. +### Improvements + +* Upgraded `opentelemetry` to 0.29.0. ## v0.9.0 -* Upgrade opentelemtry to 0.28.0. +### Improvements + +* Upgraded `opentelemetry` to 0.28.0. ## v0.8.1 -* Reduce dependencies to futures 0.3. +### Improvements + +* Reduced dependencies to `futures` 0.3. ## v0.8.0 -* Upgrade opentelemtry to 0.27.0. +### Improvements + +* Upgraded `opentelemetry` to 0.27.0. diff --git a/fastrace-opentelemetry/Cargo.toml b/fastrace-opentelemetry/Cargo.toml index da97efc..56791e3 100644 --- a/fastrace-opentelemetry/Cargo.toml +++ b/fastrace-opentelemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastrace-opentelemetry" -version = "0.15.1" +version = "0.16.0" categories = ["development-tools::debugging"] description = "Opentelemetry reporter for fastrace" diff --git a/fastrace/Cargo.toml b/fastrace/Cargo.toml index 865ba9c..08578d5 100644 --- a/fastrace/Cargo.toml +++ b/fastrace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastrace" -version = "0.7.16" +version = "0.7.17" categories = ["development-tools::debugging"] description = "A high-performance timeline tracing library for Rust"