Skip to content

Commit 7137c44

Browse files
committed
console-api,console-subscriber-tokio-console: attempt to genericize over subscriber
This is currently a build failure. Not sure how to fix it.
1 parent bb94af6 commit 7137c44

File tree

16 files changed

+384
-312
lines changed

16 files changed

+384
-312
lines changed

Cargo.lock

Lines changed: 256 additions & 223 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

console-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tonic = { version = "0.7", default-features = false, features = [
3636
] }
3737
prost = "0.10"
3838
prost-types = "0.10"
39-
tracing-core = "0.1.17"
39+
tracing-core = "0.1.29"
4040

4141
[dev-dependencies]
4242
tonic-build = { version = "0.7", default-features = false, features = [

console-api/proto/common.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ message Span {
7878
repeated Field fields = 3;
7979
// Timestamp for the span.
8080
google.protobuf.Timestamp at = 4;
81-
// An Id that uniquely identifies this span's parent (if any).
82-
optional SpanId parent_id = 5;
8381
}
8482

8583
// Any new metadata that was registered since the last update.

console-api/src/generated/google.protobuf.rs

Whitespace-only changes.

console-api/src/generated/rs.tokio.console.common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ pub struct Span {
106106
/// Timestamp for the span.
107107
#[prost(message, optional, tag="4")]
108108
pub at: ::core::option::Option<::prost_types::Timestamp>,
109-
/// An Id that uniquely identifies this span's parent (if any).
110-
#[prost(message, optional, tag="5")]
111-
pub parent_id: ::core::option::Option<SpanId>,
112109
}
113110
/// Any new metadata that was registered since the last update.
114111
#[derive(Clone, PartialEq, ::prost::Message)]

console-api/src/generated/rs.tokio.console.instrument.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub mod instrument_client {
8484
where
8585
T: tonic::client::GrpcService<tonic::body::BoxBody>,
8686
T::Error: Into<StdError>,
87-
T::ResponseBody: Default + Body<Data = Bytes> + Send + 'static,
87+
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
8888
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
8989
{
9090
pub fn new(inner: T) -> Self {
@@ -97,6 +97,7 @@ pub mod instrument_client {
9797
) -> InstrumentClient<InterceptedService<T, F>>
9898
where
9999
F: tonic::service::Interceptor,
100+
T::ResponseBody: Default,
100101
T: tonic::codegen::Service<
101102
http::Request<tonic::body::BoxBody>,
102103
Response = http::Response<
@@ -129,9 +130,9 @@ pub mod instrument_client {
129130
&mut self,
130131
request: impl tonic::IntoRequest<super::InstrumentRequest>,
131132
) -> Result<
132-
tonic::Response<tonic::codec::Streaming<super::Update>>,
133-
tonic::Status,
134-
> {
133+
tonic::Response<tonic::codec::Streaming<super::Update>>,
134+
tonic::Status,
135+
> {
135136
self.inner
136137
.ready()
137138
.await
@@ -152,11 +153,9 @@ pub mod instrument_client {
152153
&mut self,
153154
request: impl tonic::IntoRequest<super::TaskDetailsRequest>,
154155
) -> Result<
155-
tonic::Response<
156-
tonic::codec::Streaming<super::super::tasks::TaskDetails>,
157-
>,
158-
tonic::Status,
159-
> {
156+
tonic::Response<tonic::codec::Streaming<super::super::tasks::TaskDetails>>,
157+
tonic::Status,
158+
> {
160159
self.inner
161160
.ready()
162161
.await

console-api/src/generated/rs.tokio.console.trace.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub mod trace_client {
104104
where
105105
T: tonic::client::GrpcService<tonic::body::BoxBody>,
106106
T::Error: Into<StdError>,
107-
T::ResponseBody: Default + Body<Data = Bytes> + Send + 'static,
107+
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
108108
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
109109
{
110110
pub fn new(inner: T) -> Self {
@@ -117,6 +117,7 @@ pub mod trace_client {
117117
) -> TraceClient<InterceptedService<T, F>>
118118
where
119119
F: tonic::service::Interceptor,
120+
T::ResponseBody: Default,
120121
T: tonic::codegen::Service<
121122
http::Request<tonic::body::BoxBody>,
122123
Response = http::Response<
@@ -149,9 +150,9 @@ pub mod trace_client {
149150
&mut self,
150151
request: impl tonic::IntoRequest<super::WatchRequest>,
151152
) -> Result<
152-
tonic::Response<tonic::codec::Streaming<super::TraceEvent>>,
153-
tonic::Status,
154-
> {
153+
tonic::Response<tonic::codec::Streaming<super::TraceEvent>>,
154+
tonic::Status,
155+
> {
155156
self.inner
156157
.ready()
157158
.await

console-api/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
pub mod async_ops;
55
/// Represents unique id's and Rust source locations.
66
mod common;
7+
/// Represents updates to the causality tree.
8+
pub mod consequences;
79
/// Represents interactions between the console-subscriber and a console client observing it.
810
pub mod instrument;
911
/// Represents updates to the resources in an async runtime.
@@ -12,6 +14,4 @@ pub mod resources;
1214
pub mod tasks;
1315
/// Represents events on the tracing subsystem: thread registration and span activities.
1416
pub mod trace;
15-
/// Represents updates to the causality tree.
16-
pub mod consequences;
1717
pub use common::*;

console-subscriber/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ tokio-stream = "0.1"
3737
thread_local = "1.1.3"
3838
console-api = { version = "0.2.0", path = "../console-api", features = ["transport"] }
3939
tonic = { version = "0.7", features = ["transport"] }
40-
tracing-core = "0.1.24"
40+
tracing-core = "0.1.29"
4141
tracing = "0.1.26"
4242
tracing-subscriber = { version = "0.3.11", default-features = false, features = ["fmt", "registry"] }
43-
tracing-causality = { path = "../../tracing-causality" }
43+
tracing-causality = { version = "0.1.0" }
4444
futures = { version = "0.3", default-features = false }
4545
hdrhistogram = { version = "7.3.0", default-features = false, features = ["serialization"] }
4646
# The parking_lot dependency is renamed, because we want our `parking_lot`

console-subscriber/examples/app.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::time::Duration;
1+
use std::{sync::Arc, time::Duration};
22

33
static HELP: &str = r#"
44
Example console-instrumented app
@@ -17,13 +17,16 @@ OPTIONS:
1717
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
1818
use tracing_subscriber::prelude::*;
1919

20+
// initialize an underlying `Registry`
21+
let registry = Arc::new(tracing_subscriber::registry());
22+
2023
// spawn the console server in the background,
2124
// returning a `Layer`:
22-
let console_layer = console_subscriber::spawn();
25+
let console_layer = console_subscriber::spawn(registry.clone());
2326

24-
// build a `Subscriber` by combining layers with a
25-
// `tracing_subscriber::Registry`:
26-
tracing_subscriber::registry().with(console_layer).init();
27+
// build a `Subscriber` by combining layers with the
28+
// `registry`:
29+
registry.with(console_layer).init();
2730

2831
// spawn optional extras from CLI args
2932
// skip first which is command name

0 commit comments

Comments
 (0)