Skip to content

Commit

Permalink
build: release crates separatedly (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun authored Aug 9, 2024
1 parent aa7463e commit 024c101
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 85 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.toml]
indent_size = tab
tab_width = 2
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy

- name: Check format
if: ${{ matrix.rust == 'nightly' }}
run: cargo fmt --all -- --check

- name: Check clippy
if: ${{ matrix.rust == 'nightly' }}
run: cargo clippy --all-targets --all-features -- --deny warnings

- name: Build
run: cargo build --workspace --all-targets

- name: Run tests
run: |
cargo test --workspace --all-targets -- --nocapture
cargo test --doc
# Github Action sometimes run out of resources to run benches
# GitHub Action sometimes run out of resources to run benches
# - name: Run benches
# run: cargo bench --workspace --bench compare --bench trace

- name: Run examples
run: |
cargo run --example asynchronous
Expand Down
24 changes: 15 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,26 @@ members = [
resolver = "2"

[workspace.package]
authors = ["fastrace authors"]
authors = ["Fastrace Authors"]
edition = "2021"
homepage = "https://github.com/fastracelabs/fastrace"
license = "Apache-2.0"
repository = "https://github.com/fastracelabs/fastrace"
version = "0.6.8"

[workspace.dependencies]
fastrace = { version = "0.6.8", path = "fastrace" }
fastrace-datadog = { version = "0.6.8", path = "fastrace-datadog" }
fastrace-futures = { version = "0.6.8", path = "fastrace-futures" }
fastrace-jaeger = { version = "0.6.8", path = "fastrace-jaeger" }
fastrace-macro = { version = "0.6.8", path = "fastrace-macro" }
fastrace-opentelemetry = { version = "0.6.8", path = "fastrace-opentelemetry" }
# workspace dependencies
fastrace = { version = "0.7.0", path = "fastrace" }
fastrace-macro = { version = "0.7.0", path = "fastrace-macro" }

# workspace leaves
fastrace-datadog = { path = "fastrace-datadog" }
fastrace-futures = { path = "fastrace-futures" }
fastrace-jaeger = { path = "fastrace-jaeger" }
fastrace-opentelemetry = { path = "fastrace-opentelemetry" }

# crates.io dependencies
futures = { version = "0.3" }
log = { version = "0.4" }
serde = { version = "1.0", features = ["derive"] }

[profile.bench]
lto = true
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Libraries should include `fastrace` as a dependency without enabling any extra f

```toml
[dependencies]
fastrace = "0.6"
fastrace = "0.7"
```

Add a `trace` attribute to the function you want to trace. In this example, a `SpanRecord` will be collected every time the function is called, if a tracing context is set up by the caller.
Expand Down Expand Up @@ -65,7 +65,7 @@ Applications should include `fastrace` as a dependency with the `enable` feature

```toml
[dependencies]
fastrace = { version = "0.6", features = ["enable"] }
fastrace = { version = "0.7", features = ["enable"] }
```

Applications should initialize a `Reporter` implementation early in the program's runtime. Span records generated before the reporter is initialized will be ignored. Before terminating, `flush()` should be called to ensure all collected span records are reported.
Expand Down Expand Up @@ -97,10 +97,10 @@ fn main() {

![Benchmark result by architecture](etc/img/benchmark-arch.svg)

| | x86-64 (Intel Broadwell) | x86-64 (Intel Skylake) | x86-64 (AMD Zen) | ARM (AWS Graviton2) |
|----------------------|--------------------------|------------------------|------------------|---------------------|
| tokio-tracing | 124x slower | 33x slower | 36x slower | 29x slower |
| rustracing | 45x slower | 10x slower | 11x slower | 9x slower |
| | x86-64 (Intel Broadwell) | x86-64 (Intel Skylake) | x86-64 (AMD Zen) | ARM (AWS Graviton2) |
|---------------------|--------------------------|------------------------|------------------|---------------------|
| tokio-tracing | 124x slower | 33x slower | 36x slower | 29x slower |
| rustracing | 45x slower | 10x slower | 11x slower | 9x slower |
| fastrace (baseline) | 1x (3.4us) | 1x (3.2us) | 1x (3.8us) | 1x (4.2us) |

**By creating different number of spans:**
Expand Down Expand Up @@ -149,24 +149,24 @@ For example, fastrace doesn't introduce new logging macros, e.g. `info!()` or `e

### Will fastrace incorporate 'level' for spans?

The concept of 'level' may not be an optimal feature for tracing systems. While `tokio-tracing` incorporates this feature, the underlying motivation for having levels in a span primarily revolves around performance. More specifically, it relates to the performance implications of tracing elements that are not of interest. However, tracing differs from logging in two key aspects:
The concept of 'level' may not be an optimal feature for tracing systems. While `tokio-tracing` incorporates this feature, the underlying motivation for having levels in a span primarily revolves around performance. More specifically, it relates to the performance implications of tracing elements that are not of interest. However, tracing differs from logging in two key aspects:

1. Disregarding a low-level span might inadvertently discard a high-level child span.
2. The process of filtering, or 'level' as it's often called, in a tracing system should be applied to a trace as a whole rather than individual spans within a trace.
1. Disregarding a low-level span might inadvertently discard a high-level child span.
2. The process of filtering, or 'level' as it's often called, in a tracing system should be applied to a trace as a whole rather than individual spans within a trace.

In this context, fastrace offers a more efficient solution by filtering out entire traces that are not of interest through its unique tail-sampling design. Therefore, the concept of 'level', borrowed directly from logging systems, may not be suitable for fastrace.

### Will fastrace support OpenTelemetry feature 'X'?

fastrace is focused on high performance tracing only. You can open an issue for the missing tracing features you want to have.

Note that we always prioritize performance over features, so that not all tracing feature requests may be accepted.
Note that we always prioritize performance over features, so that not all tracing feature requests may be accepted.

### What's the status of this library?

**API Unstable**: The API is not stabilized yet, may be changed in the future.
**API Unstable**: The API is not stabilized yet, may be changed in the future.

**Code base Tested**: fastrace has been tested with high coverage. However, applications utilizing fastrace have not been widely deployed, so that fastrace is currently **NOT** regarded as battle-tested.
**Code base Tested**: fastrace has been tested with high coverage. However, applications utilizing fastrace have not been widely deployed, so that fastrace is currently **NOT** regarded as battle-tested.

[Docs]: https://docs.rs/fastrace/
[Examples]: fastrace/examples
Expand Down
20 changes: 10 additions & 10 deletions fastrace-datadog/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[package]
name = "fastrace-datadog"
version = "0.7.0"

categories = ["development-tools::debugging"]
description = "Datadog reporter for fastrace"
documentation = "https://docs.rs/fastrace-datadog"
keywords = ["tracing", "span", "datadog", "jaeger", "opentelemetry"]
name = "fastrace-datadog"
readme = "README.md"

authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
fastrace = { workspace = true }
log = "0.4"
log = { workspace = true }
reqwest = { version = "0.12", features = ["blocking"] }
rmp-serde = "1.3"
serde = { version = "1.0", features = ["derive"] }
serde = { workspace = true }

[dev-dependencies]
futures = "0.3"
futures = { workspace = true }
16 changes: 8 additions & 8 deletions fastrace-futures/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "fastrace-futures"
version = "0.7.0"

categories = ["development-tools::debugging"]
description = "Utilities for tracing `futures` with fastrace"
documentation = "https://docs.rs/fastrace-futures"
keywords = ["tracing", "span", "futures", "jaeger", "opentelemetry"]
name = "fastrace-futures"
readme = "README.md"

authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
fastrace = { workspace = true }
futures = "0.3"
futures = { workspace = true }
pin-project-lite = "0.2"

[dev-dependencies]
Expand Down
18 changes: 9 additions & 9 deletions fastrace-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[package]
name = "fastrace-jaeger"
version = "0.7.0"

categories = ["development-tools::debugging"]
description = "Jaeger reporter for fastrace"
documentation = "https://docs.rs/fastrace-jaeger"
keywords = ["tracing", "span", "datadog", "jaeger", "opentelemetry"]
name = "fastrace-jaeger"
readme = "README.md"

authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
fastrace = { workspace = true }
log = "0.4"
log = { workspace = true }
thrift_codec = "0.3"

[dev-dependencies]
futures = "0.3"
futures = { workspace = true }
17 changes: 9 additions & 8 deletions fastrace-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "fastrace-macro"
version = "0.7.0"

categories = ["development-tools::debugging"]
description = "Attribute procedural macro for fastrace"
documentation = "https://docs.rs/fastrace-macro"
keywords = ["tracing", "span", "datadog", "jaeger", "opentelemetry"]
name = "fastrace-macro"
readme = "README.md"

authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[lib]
proc-macro = true
Expand All @@ -31,9 +31,10 @@ syn = { version = "1.0.84", features = [

[dev-dependencies]
fastrace = { workspace = true }
log = { workspace = true }
logcall = "0.1"
tokio = { version = "1.38", features = ["full"] }
trybuild = "1.0"
# The procedural macro `trace` only supports async-trait higher than or equal to 0.1.52
async-trait = "0.1.52"
log = "0.4"

20 changes: 10 additions & 10 deletions fastrace-opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[package]
name = "fastrace-opentelemetry"
version = "0.7.0"

categories = ["development-tools::debugging"]
description = "Opentelemetry reporter for fastrace"
documentation = "https://docs.rs/fastrace-jaeger"
documentation = "https://docs.rs/fastrace-opentelemetry"
keywords = ["tracing", "span", "datadog", "jaeger", "opentelemetry"]
name = "fastrace-opentelemetry"
readme = "README.md"

authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
fastrace = { workspace = true }
futures = { version = "0.3", features = ["executor"] }
log = "0.4"
futures = { workspace = true, features = ["executor"] }
log = { workspace = true }
opentelemetry = { version = "0.24", features = ["trace"] }
opentelemetry_sdk = { version = "0.24", features = ["trace"] }

Expand Down
18 changes: 9 additions & 9 deletions fastrace/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "fastrace"
version = "0.7.0"

categories = ["development-tools::debugging"]
description = "A high-performance timeline tracing library for Rust"
documentation = "https://docs.rs/fastrace"
keywords = ["tracing", "span", "datadog", "jaeger", "opentelemetry"]
name = "fastrace"
readme = "../README.md"

authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[features]
enable = []
Expand All @@ -36,9 +36,9 @@ fastrace-datadog = { workspace = true }
fastrace-jaeger = { workspace = true }
fastrace-opentelemetry = { workspace = true }
flume = "0.11"
futures = "0.3"
futures = { workspace = true }
futures-timer = "3"
log = "0.4"
log = { workspace = true }
logcall = "0.1"
mockall = "0.12"
once_cell = "1.19"
Expand Down
7 changes: 4 additions & 3 deletions test-statically-disable/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name = "test-statically-disable"
publish = false
version = "0.0.1"

authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
fastrace = { workspace = true }

0 comments on commit 024c101

Please # to comment.