Skip to content

Commit

Permalink
Move opentelemetry crate into a directory to flatten the workspace (#324
Browse files Browse the repository at this point in the history
)

This makes working with cargo easier, because many commands (like cargo
check, cargo test) will apply to all crates by default, rather than
only selecting the crate in the top-level directory.
  • Loading branch information
djc authored Nov 1, 2020
1 parent 2574dd5 commit f9e91e7
Show file tree
Hide file tree
Showing 117 changed files with 297 additions and 90 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ jobs:
with:
profile: minimal
toolchain: 1.42.0
override: true
- name: Run tests
run: cargo test --verbose --features base64_format,trace,metrics,serialize,binary_propagator,tokio,async-std,serde,http,tonic,reqwest -p opentelemetry -p opentelemetry-jaeger -p opentelemetry-zipkin
run: cargo --version &&
cargo test --verbose --manifest-path=opentelemetry/Cargo.toml --features base64_format,trace,metrics,serialize,binary_propagator,tokio,async-std,serde,http,tonic,reqwest &&
cargo test --manifest-path=opentelemetry-jaeger/Cargo.toml &&
cargo test --manifest-path=opentelemetry-zipkin/Cargo.toml
meta:
continue-on-error: true
runs-on: ubuntu-latest
Expand All @@ -67,7 +71,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
args: -p opentelemetry --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
Expand Down
71 changes: 1 addition & 70 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,61 +1,6 @@
[package]
name = "opentelemetry"
version = "0.9.1"
authors = ["OpenTelemetry Authors <[email protected]>"]
description = "A metrics collection and distributed tracing framework"
homepage = "https://github.com/open-telemetry/opentelemetry-rust"
repository = "https://github.com/open-telemetry/opentelemetry-rust"
readme = "README.md"
categories = [
"development-tools::debugging",
"development-tools::profiling",
"api-bindings",
"asynchronous",
]
keywords = ["opentelemetry", "logging", "tracing", "metrics", "async"]
license = "Apache-2.0"
edition = "2018"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
async-std = { version = "1.6", features = ["unstable"], default-features = false, optional = true }
async-trait = { version = "0.1", optional = true }
base64 = { version = "0.13", optional = true }
bincode = { version = "1.2", optional = true }
dashmap = { version = "4.0.0-rc6", optional = true }
fnv = { version = "1.0", optional = true }
futures = "0.3"
lazy_static = "1.4"
percent-encoding = { version = "2.0", optional = true }
pin-project = { version = "0.4", optional = true }
rand = { version = "0.7", default-features = false, features = ["std"], optional = true }
regex = { version = "1.3", default-features = false, features = ["std", "perf"], optional = true}
serde = { version = "1.0", features = ["derive", "rc"], optional = true }
http = { version = "0.2", optional = true }
thiserror = { version = "1.0", optional = true }
tokio = { version = "0.2", default-features = false, features = ["rt-core", "blocking", "time", "stream"], optional = true }
tonic = { version = "0.3", default-features = false, optional = true }
reqwest = { version = "0.10", default-features = false, features = ["blocking"], optional = true }
surf = { version = "2.0", default-features = false, optional = true }

[dev-dependencies]
criterion = "0.3.1"
rand_distr = "0.3.0"
tokio = { version = "0.2", features = ["full"] }

[features]
default = ["trace"]
base64_format = ["base64", "binary_propagator"]
trace = ["rand", "pin-project", "async-trait", "regex", "percent-encoding"]
metrics = ["thiserror", "dashmap", "fnv"]
serialize = ["serde", "bincode"]
binary_propagator = []

[workspace]
members = [
"opentelemetry",
"opentelemetry-contrib",
"opentelemetry-jaeger",
"opentelemetry-otlp",
Expand All @@ -74,17 +19,3 @@ members = [
"examples/zipkin",
"examples/tracing-grpc"
]

[[bench]]
name = "trace"
harness = false

[[bench]]
name = "metric"
harness = false
required-features = ["metrics"]

[[bench]]
name = "ddsketch"
harness = false
required-features = ["metrics"]
2 changes: 1 addition & 1 deletion examples/actix-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2018"

[dependencies]
opentelemetry = { path = "../../", features = ["tokio"] }
opentelemetry = { path = "../../opentelemetry", features = ["tokio"] }
opentelemetry-jaeger = { path = "../../opentelemetry-jaeger", features = ["collector_client", "tokio"] }
thrift = "0.13"
futures = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/actix-udp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2018"

[dependencies]
opentelemetry = { path = "../../" }
opentelemetry = { path = "../../opentelemetry" }
opentelemetry-jaeger = { path = "../../opentelemetry-jaeger" }
thrift = "0.13"
futures = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = "2018"
futures = "0.3"
thrift = "0.13"
tokio = { version = "0.2", features = ["full"] }
opentelemetry = { path = "../../", features = ["tokio"] }
opentelemetry = { path = "../../opentelemetry", features = ["tokio"] }
opentelemetry-jaeger = { path = "../../opentelemetry-jaeger", features = ["tokio"] }
2 changes: 1 addition & 1 deletion examples/aws-xray/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ path = "src/client.rs"
[dependencies]
hyper = "0.13"
tokio = { version = "0.2", features = ["full"] }
opentelemetry = { path = "../../", features = ["http"] }
opentelemetry = { path = "../../opentelemetry", features = ["http"] }
opentelemetry-contrib = { path = "../../opentelemetry-contrib" }
2 changes: 1 addition & 1 deletion examples/basic-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
futures = "0.3"
lazy_static = "1.4"
opentelemetry = { path = "../../", features = ["tokio", "metrics", "serialize"] }
opentelemetry = { path = "../../opentelemetry", features = ["tokio", "metrics", "serialize"] }
opentelemetry-otlp = { path = "../../opentelemetry-otlp" }
serde_json = "1.0"
tokio = { version = "0.2", features = ["full"] }
2 changes: 1 addition & 1 deletion examples/basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
futures = "0.3"
lazy_static = "1.4"
opentelemetry = { path = "../../", features = ["serialize", "tokio", "metrics"] }
opentelemetry = { path = "../../opentelemetry", features = ["serialize", "tokio", "metrics"] }
opentelemetry-jaeger = { path = "../../opentelemetry-jaeger", features = ["tokio"] }
serde_json = "1.0"
thrift = "0.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/datadog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "0.1.0"
edition = "2018"

[dependencies]
opentelemetry = { path = "../../" }
opentelemetry = { path = "../../opentelemetry" }
opentelemetry-contrib = { path = "../../opentelemetry-contrib", features = ["datadog"] }
2 changes: 1 addition & 1 deletion examples/grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ http = "0.2"
tonic = "0.3"
prost = "0.6"
tokio = { version = "0.2", features = ["full"] }
opentelemetry = { path = "../../", features = ["tonic"] }
opentelemetry = { path = "../../opentelemetry", features = ["tonic"] }
opentelemetry-jaeger = { path = "../../opentelemetry-jaeger" }

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion examples/http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ path = "src/client.rs"
[dependencies]
hyper = "0.13"
tokio = { version = "0.2", features = ["full"] }
opentelemetry = { path = "../../", features = ["http"] }
opentelemetry = { path = "../../opentelemetry", features = ["http"] }
2 changes: 1 addition & 1 deletion examples/zipkin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "0.1.0"
edition = "2018"

[dependencies]
opentelemetry = { path = "../../" }
opentelemetry = { path = "../../opentelemetry" }
opentelemetry-zipkin = { path = "../../opentelemetry-zipkin" }
2 changes: 1 addition & 1 deletion opentelemetry-contrib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ surf-client = ["opentelemetry/surf"]
[dependencies]
async-trait = { version = "0.1", optional = true }
indexmap = { version = "1.6", optional = true }
opentelemetry = { version = "0.9", path = "..", features = ["trace", "http"] }
opentelemetry = { version = "0.9", path = "../opentelemetry", features = ["trace", "http"] }
rmp = { version = "0.8", optional = true }
lazy_static = "1.4"
reqwest = { version = "0.10", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async-std = { version = "1.6", optional = true }
async-trait = "0.1"
http = { version = "0.2", optional = true }
isahc = { version = "0.9", default-features = false, optional = true }
opentelemetry = { version = "0.9", default-features = false, features = ["trace"], path = ".." }
opentelemetry = { version = "0.9", default-features = false, features = ["trace"], path = "../opentelemetry" }
thrift = "0.13"
tokio = { version = "0.2", features = ["udp", "sync"], optional = true }

Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rustdoc-args = ["--cfg", "docsrs"]
async-trait = "0.1"
futures = "0.3.5"
grpcio = "0.6"
opentelemetry = { version = "0.9.0", default-features = false, features = ["trace"], path = ".." }
opentelemetry = { version = "0.9.0", default-features = false, features = ["trace"], path = "../opentelemetry" }
protobuf = "2.18"

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-prometheus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
opentelemetry = { version = "0.9.0", path = "..", default-features = false, features = ["metrics"] }
opentelemetry = { version = "0.9.0", path = "../opentelemetry", default-features = false, features = ["metrics"] }
prometheus = "0.10"
protobuf = "2.14"

Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-semantic-conventions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
opentelemetry = { version = "0.9.0", default-features = false, path = ".." }
opentelemetry = { version = "0.9.0", default-features = false, path = "../opentelemetry" }

[dev-dependencies]
opentelemetry = { version = "0.9.0", default-features = false, features = ["trace"], path = ".." }
opentelemetry = { version = "0.9.0", default-features = false, features = ["trace"], path = "../opentelemetry" }
2 changes: 1 addition & 1 deletion opentelemetry-zipkin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ surf-client = ["opentelemetry/surf"]

[dependencies]
async-trait = "0.1"
opentelemetry = { version = "0.9.0", path = "..", features = ["trace", "http"] }
opentelemetry = { version = "0.9.0", path = "../opentelemetry", features = ["trace", "http"] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
typed-builder = "0.7"
Expand Down
File renamed without changes.
69 changes: 69 additions & 0 deletions opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[package]
name = "opentelemetry"
version = "0.9.1"
authors = ["OpenTelemetry Authors <[email protected]>"]
description = "A metrics collection and distributed tracing framework"
homepage = "https://github.com/open-telemetry/opentelemetry-rust"
repository = "https://github.com/open-telemetry/opentelemetry-rust"
readme = "README.md"
categories = [
"development-tools::debugging",
"development-tools::profiling",
"api-bindings",
"asynchronous",
]
keywords = ["opentelemetry", "logging", "tracing", "metrics", "async"]
license = "Apache-2.0"
edition = "2018"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
async-std = { version = "1.6", features = ["unstable"], default-features = false, optional = true }
async-trait = { version = "0.1", optional = true }
base64 = { version = "0.13", optional = true }
bincode = { version = "1.2", optional = true }
dashmap = { version = "4.0.0-rc6", optional = true }
fnv = { version = "1.0", optional = true }
futures = "0.3"
lazy_static = "1.4"
percent-encoding = { version = "2.0", optional = true }
pin-project = { version = "0.4", optional = true }
rand = { version = "0.7", default-features = false, features = ["std"], optional = true }
regex = { version = "1.3", default-features = false, features = ["std", "perf"], optional = true}
serde = { version = "1.0", features = ["derive", "rc"], optional = true }
http = { version = "0.2", optional = true }
thiserror = { version = "1.0", optional = true }
tokio = { version = "0.2", default-features = false, features = ["rt-core", "blocking", "time", "stream"], optional = true }
tonic = { version = "0.3", default-features = false, optional = true }
reqwest = { version = "0.10", default-features = false, features = ["blocking"], optional = true }
surf = { version = "2.0", default-features = false, optional = true }

[dev-dependencies]
criterion = "0.3.1"
rand_distr = "0.3.0"
tokio = { version = "0.2", features = ["full"] }

[features]
default = ["trace"]
base64_format = ["base64", "binary_propagator"]
trace = ["rand", "pin-project", "async-trait", "regex", "percent-encoding"]
metrics = ["thiserror", "dashmap", "fnv"]
serialize = ["serde", "bincode"]
binary_propagator = []

[[bench]]
name = "trace"
harness = false

[[bench]]
name = "metric"
harness = false
required-features = ["metrics"]

[[bench]]
name = "ddsketch"
harness = false
required-features = ["metrics"]
Loading

0 comments on commit f9e91e7

Please sign in to comment.