Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
Merge #2404
Browse files Browse the repository at this point in the history
2404: Instrument tests with custom macro & export over OTLP r=klochowicz a=Restioson

This PR uses a custom `#[otel_test]` macro to instrument `daemon-tests` and export the spans over OTLP to Jaeger, when the `ITCHYSATS_TEST_INSTRUMENTATION` environment variable is set to `1`.

This currently uses the simple exporter. I tried the batch exporter, but this strangely caused some tests to hang.

## TODOs
- [x] Disable instrumentation option for CI
- [x] Get gRPC to build on ARM CI, or swap it for tonic (which doesn't currently work)
- [x] How can we configure the service name and log levels for crates other than daemon-tests?

Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
Co-authored-by: Restioson <restiosondev@gmail.com>
  • Loading branch information
3 people authored Jul 18, 2022
2 parents 1f1fd58 + f36c3ed commit faeb44b
Show file tree
Hide file tree
Showing 11 changed files with 368 additions and 79 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,5 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
sudo apt-get install g++-aarch64-linux-gnu
- run: cargo build --target=aarch64-unknown-linux-gnu --bins
190 changes: 183 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ members = [
"shared-bin",
"daemon-tests",
"tokio-extras",
"otel-tests",
"otel-tests-macro",
"xtras",
"xtra-bitmex-price-feed",
"bdk-ext",
Expand Down
2 changes: 1 addition & 1 deletion daemon-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ maker = { path = "../maker" }
mockall = "0.11"
mockall_derive = "0.11"
model = { path = "../model" }
otel-tests = { path = "../otel-tests" }
rand = "0.6"
rust_decimal = "1.25"
rust_decimal_macros = "1.25"
Expand All @@ -21,7 +22,6 @@ time = "0.3.11"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "net", "tracing"] }
tokio-extras = { path = "../tokio-extras", features = ["xtra"] }
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi", "env-filter", "local-time", "tracing-log", "json"] }
xtra = { version = "0.6", features = ["instrumentation"] }
xtra-bitmex-price-feed = { path = "../xtra-bitmex-price-feed" }
xtra-libp2p = { path = "../xtra-libp2p" }
Expand Down
Loading

0 comments on commit faeb44b

Please sign in to comment.