From e0f7eb518f080faadaa4a560dfa90048ac3ccc9d Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Sat, 25 Jul 2020 20:57:29 +0100
Subject: [PATCH 01/45] Add tracing support

---
 docs/book/content/SUMMARY.md       |  2 ++
 docs/book/content/tracing/index.md | 38 +++++++++++++++++++++++
 docs/book/tests/Cargo.toml         |  4 +++
 juniper/Cargo.toml                 |  2 ++
 juniper/src/lib.rs                 | 25 ++++++++++++----
 juniper/src/macros/mod.rs          |  2 ++
 juniper/src/macros/tracing.rs      | 48 ++++++++++++++++++++++++++++++
 7 files changed, 116 insertions(+), 5 deletions(-)
 create mode 100644 docs/book/content/tracing/index.md
 create mode 100644 juniper/src/macros/tracing.rs

diff --git a/docs/book/content/SUMMARY.md b/docs/book/content/SUMMARY.md
index 49c542f52..de351f608 100644
--- a/docs/book/content/SUMMARY.md
+++ b/docs/book/content/SUMMARY.md
@@ -25,6 +25,8 @@
     - [Hyper](servers/hyper.md)
   - [Third Party Integrations](servers/third-party.md)
 
+- [Tracing](tracing/index.md)
+
 - [Advanced Topics](advanced/index.md)
 
   - [Introspection](advanced/introspection.md)
diff --git a/docs/book/content/tracing/index.md b/docs/book/content/tracing/index.md
new file mode 100644
index 000000000..0a490f59d
--- /dev/null
+++ b/docs/book/content/tracing/index.md
@@ -0,0 +1,38 @@
+# Tracing
+
+Juniper relies on the [tracing](https://crates.io/crates/tracing) crate for instrumentation.
+
+!FILENAME Cargo.toml
+
+```toml
+[dependencies]
+tracing = "0.1.17"
+tracing-subscriber = "0.2.9"
+tracing-log = "0.1.1"
+```
+
+## Usage
+
+```rust
+# extern crate tracing;
+# extern crate tracing_subscriber;
+# extern crate tracing_log;
+fn main() {
+    // compatibility with the log crate (unstable)
+    // converts all log records into tracing events
+    tracing_log::LogTracer::init().expect("LogTracer init failed");
+
+    // a builder for `FmtSubscriber`.
+    let subscriber = tracing_subscriber::FmtSubscriber::builder()
+        // all spans/events with a level higher than TRACE
+        // (e.g, debug, info, warn, etc.) will be written to stdout.
+        .with_max_level(tracing::Level::TRACE)
+        // completes the builder.
+        .finish();
+
+    tracing::subscriber::set_global_default(subscriber)
+        .expect("Setting default tracing subscriber failed");
+
+    // ...
+}
+```
diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml
index 120f1a894..5943b3bb4 100644
--- a/docs/book/tests/Cargo.toml
+++ b/docs/book/tests/Cargo.toml
@@ -20,6 +20,10 @@ skeptic = "0.13"
 serde_json = "1.0.39"
 uuid = "0.8"
 
+tracing = "0.1.17"
+tracing-subscriber = "0.2.9"
+tracing-log = "0.1.1"
+
 [build-dependencies]
 skeptic = "0.13"
 
diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml
index d02b6cf47..59a432f62 100644
--- a/juniper/Cargo.toml
+++ b/juniper/Cargo.toml
@@ -52,6 +52,8 @@ url = { version = "2", optional = true }
 uuid = { version = "0.8", optional = true }
 graphql-parser = {version = "0.3.0", optional = true }
 
+tracing = {version = "0.1.17", optional = true }
+
 [dev-dependencies]
 bencher = "0.1.2"
 serde_json = { version = "1.0.2" }
diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index baba1af2f..663d41637 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -260,7 +260,10 @@ where
         let errors = validate_input_values(variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -293,7 +296,10 @@ where
 
         let errors = ctx.into_errors();
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -303,7 +309,10 @@ where
         let errors = validate_input_values(variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -338,7 +347,10 @@ where
 
         let errors = ctx.into_errors();
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -348,7 +360,10 @@ where
         let errors = validate_input_values(&variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
diff --git a/juniper/src/macros/mod.rs b/juniper/src/macros/mod.rs
index 1d4c57006..a8bfcd0f3 100644
--- a/juniper/src/macros/mod.rs
+++ b/juniper/src/macros/mod.rs
@@ -10,3 +10,5 @@ mod interface;
 mod tests;
 
 pub mod subscription_helpers;
+
+mod tracing;
diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
new file mode 100644
index 000000000..676295266
--- /dev/null
+++ b/juniper/src/macros/tracing.rs
@@ -0,0 +1,48 @@
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_internal {
+    ($trace_type:ident; $($element:expr),*) => {{
+        #[cfg(feature = "tracing")]
+        tracing::$trace_type!($($element),*);
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(trace; $($element),*)
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_debug {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(debug; $($element),*)
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_info {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(info; $($element),*)
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_warn {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(warn; $($element),*)
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_error {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(error; $($element),*)
+    }};
+}

From 753c80fd9bf618b8297fbb4e27194f2429d4803d Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 10:16:28 -1000
Subject: [PATCH 02/45] Rocket can now compile on stable

---
 juniper_rocket/Makefile.toml | 17 -----------------
 1 file changed, 17 deletions(-)
 delete mode 100644 juniper_rocket/Makefile.toml

diff --git a/juniper_rocket/Makefile.toml b/juniper_rocket/Makefile.toml
deleted file mode 100644
index 8695d6a67..000000000
--- a/juniper_rocket/Makefile.toml
+++ /dev/null
@@ -1,17 +0,0 @@
-[tasks.build-verbose]
-condition = { channels = ["nightly"] }
-
-[tasks.build-verbose.windows]
-condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } }
-
-[tasks.test-verbose]
-condition = { channels = ["nightly"] }
-
-[tasks.test-verbose.windows]
-condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } }
-
-[tasks.ci-coverage-flow]
-condition = { channels = ["nightly"] }
-
-[tasks.ci-coverage-flow.windows]
-disabled = true
\ No newline at end of file

From c599bae962ece7b546eada2af4bf983ced428519 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 16:48:57 -1000
Subject: [PATCH 03/45] Remove `boxed` in favor of `pin`.

---
 juniper/src/types/scalars.rs             | 2 +-
 juniper_codegen/src/graphql_union/mod.rs | 2 +-
 juniper_codegen/src/util/mod.rs          | 7 +++----
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/juniper/src/types/scalars.rs b/juniper/src/types/scalars.rs
index 53ebc1acc..2f50eefd1 100644
--- a/juniper/src/types/scalars.rs
+++ b/juniper/src/types/scalars.rs
@@ -245,7 +245,7 @@ where
         executor: &'a Executor<Self::Context, S>,
     ) -> crate::BoxFuture<'a, crate::ExecutionResult<S>> {
         use futures::future;
-        future::FutureExt::boxed(future::ready(self.resolve(info, selection_set, executor)))
+        Box::pin(future::ready(self.resolve(info, selection_set, executor)))
     }
 }
 
diff --git a/juniper_codegen/src/graphql_union/mod.rs b/juniper_codegen/src/graphql_union/mod.rs
index a8658132c..129044526 100644
--- a/juniper_codegen/src/graphql_union/mod.rs
+++ b/juniper_codegen/src/graphql_union/mod.rs
@@ -472,7 +472,7 @@ impl ToTokens for UnionDefinition {
                                 { #expr },
                                 executor.context()
                             );
-                            return ::juniper::futures::future::FutureExt::boxed(async move {
+                            return Box::pin(async move {
                                 match res? {
                                     Some((ctx, r)) => {
                                         let subexec = executor.replaced_context(ctx);
diff --git a/juniper_codegen/src/util/mod.rs b/juniper_codegen/src/util/mod.rs
index ee8b8a781..f91696c91 100644
--- a/juniper_codegen/src/util/mod.rs
+++ b/juniper_codegen/src/util/mod.rs
@@ -880,8 +880,7 @@ impl GraphQLTypeDefiniton {
                                     Err(e) => Err(e),
                                 }
                             };
-                            use ::juniper::futures::future;
-                            future::FutureExt::boxed(f)
+                            Box::pin(f)
                         },
                     )
                 } else {
@@ -908,7 +907,7 @@ impl GraphQLTypeDefiniton {
                                 Err(e) => Err(e),
                             };
                             use ::juniper::futures::future;
-                            future::FutureExt::boxed(future::ready(v))
+                            Box::pin(future::ready(v))
                         )
                     };
 
@@ -1445,7 +1444,7 @@ impl GraphQLTypeDefiniton {
                 ) -> ::juniper::BoxFuture<'a, ::juniper::ExecutionResult<#scalar>> {
                     use ::juniper::futures::future;
                     let v = ::juniper::GraphQLValue::resolve(self, info, selection_set, executor);
-                    future::FutureExt::boxed(future::ready(v))
+                    Box::pin(future::ready(v))
                 }
             }
         );

From b5569340868004965eb08d52f263894079e4ca19 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 21:43:10 -1000
Subject: [PATCH 04/45] Add tracing support example

---
 Cargo.toml                             |   1 +
 examples/tracing_support/.gitignore    |   4 +
 examples/tracing_support/Cargo.toml    |  14 ++++
 examples/tracing_support/Makefile.toml |  20 +++++
 examples/tracing_support/src/main.rs   | 109 +++++++++++++++++++++++++
 juniper/src/lib.rs                     |   1 +
 6 files changed, 149 insertions(+)
 create mode 100644 examples/tracing_support/.gitignore
 create mode 100644 examples/tracing_support/Cargo.toml
 create mode 100644 examples/tracing_support/Makefile.toml
 create mode 100644 examples/tracing_support/src/main.rs

diff --git a/Cargo.toml b/Cargo.toml
index 79429a10e..c703b0ef3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,7 @@ members = [
   "juniper_codegen",
   "juniper",
   "examples/basic_subscriptions",
+  "examples/tracing_support",
   "examples/warp_async",
   "examples/warp_subscriptions",
   "integration_tests/juniper_tests",
diff --git a/examples/tracing_support/.gitignore b/examples/tracing_support/.gitignore
new file mode 100644
index 000000000..68f412d09
--- /dev/null
+++ b/examples/tracing_support/.gitignore
@@ -0,0 +1,4 @@
+/target/
+**/*.rs.bk
+Cargo.lock
+
diff --git a/examples/tracing_support/Cargo.toml b/examples/tracing_support/Cargo.toml
new file mode 100644
index 000000000..a09c90e1b
--- /dev/null
+++ b/examples/tracing_support/Cargo.toml
@@ -0,0 +1,14 @@
+[package]
+name = "tracing_support"
+version = "0.1.0"
+authors = ["Christian Legnitto <christian.legnitto@robinhood.com>"]
+edition = "2018"
+publish = false
+
+[dependencies]
+tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
+tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
+# Note instead of a path you would use the proper Juniper version in your own
+# project.
+juniper = { path = "../../juniper", features = ["tracing"] }
+tokio = { version = "0.2.22", features = ["rt-core", "macros", "blocking"] }
diff --git a/examples/tracing_support/Makefile.toml b/examples/tracing_support/Makefile.toml
new file mode 100644
index 000000000..bce0dd4c9
--- /dev/null
+++ b/examples/tracing_support/Makefile.toml
@@ -0,0 +1,20 @@
+[tasks.run]
+disabled = true
+
+[tasks.release]
+disabled = true
+
+[tasks.release-some]
+disabled = true
+
+[tasks.release-local-test]
+disabled = true
+
+[tasks.release-some-local-test]
+disabled = true
+
+[tasks.release-dry-run]
+disabled = true
+
+[tasks.release-some-dry-run]
+disabled = true
diff --git a/examples/tracing_support/src/main.rs b/examples/tracing_support/src/main.rs
new file mode 100644
index 000000000..6e6bf2cac
--- /dev/null
+++ b/examples/tracing_support/src/main.rs
@@ -0,0 +1,109 @@
+extern crate juniper;
+extern crate tokio;
+extern crate tracing;
+extern crate tracing_subscriber;
+
+use juniper::{
+    graphql_object, EmptyMutation, EmptySubscription, FieldError, GraphQLEnum, RootNode, Variables,
+};
+use tracing::{trace_span, Instrument as _};
+use tracing_subscriber::EnvFilter;
+
+#[derive(Clone, Copy, Debug)]
+struct Context;
+impl juniper::Context for Context {}
+
+#[derive(Clone, Copy, Debug, GraphQLEnum)]
+enum UserKind {
+    Admin,
+    User,
+    Guest,
+}
+
+#[derive(Clone, Debug)]
+struct User {
+    id: i32,
+    kind: UserKind,
+    name: String,
+}
+
+#[graphql_object(Context = Context)]
+impl User {
+    fn id(&self) -> i32 {
+        self.id
+    }
+
+    fn kind(&self) -> UserKind {
+        self.kind
+    }
+
+    fn name(&self) -> &str {
+        &self.name
+    }
+
+    async fn friends(&self) -> Vec<User> {
+        vec![]
+    }
+}
+
+#[derive(Clone, Copy, Debug)]
+struct Query;
+
+#[graphql_object(Context = Context)]
+impl Query {
+    async fn users() -> Vec<User> {
+        vec![User {
+            id: 1,
+            kind: UserKind::Admin,
+            name: "user1".into(),
+        }]
+    }
+
+    /// Fetch a URL and return the response body text.
+    async fn double(x: i32) -> Result<i32, FieldError> {
+        Ok(x * 2)
+    }
+}
+
+type Schema = RootNode<'static, Query, EmptyMutation<Context>, EmptySubscription<Context>>;
+
+fn schema() -> Schema {
+    Schema::new(
+        Query,
+        EmptyMutation::<Context>::new(),
+        EmptySubscription::<Context>::new(),
+    )
+}
+
+#[tokio::main]
+async fn main() {
+    // A builder for `FmtSubscriber`.
+    let subscriber = tracing_subscriber::fmt()
+        // This enables standard env variables such as `RUST_LOG=trace`.
+        .with_env_filter(EnvFilter::from_default_env())
+        // This makes it so we can see all span events.
+        .with_span_events(tracing_subscriber::fmt::format::FmtSpan::FULL)
+        .finish();
+
+    tracing::subscriber::set_global_default(subscriber).expect("no global subscriber has been set");
+
+    let ctx = Context {};
+    let vars = Variables::new();
+    let root = schema();
+
+    // When run with `RUST_LOG=trace cargo run`, this should output to `stdout`.
+    let query = "{ users { id } }";
+    let (_, _errors) = juniper::execute(query, None, &root, &vars, &ctx)
+        .await
+        .unwrap();
+
+    // When run with `RUST_LOG=trace cargo run`, this should output to `stdout`.
+    // Note that there is a top-level span of "doubling{42}" as it was set
+    // here. This is useful to attach context to each call to `execute`.
+    let query = "{ double(x: 42) }";
+    let (_, _errors) = juniper::execute(query, None, &root, &vars, &ctx)
+        .instrument(trace_span!("doubling", "{}", 42))
+        .await
+        .map_err(|e| format!("{:?}", e))
+        .unwrap();
+}
diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 663d41637..9eec13705 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -383,6 +383,7 @@ where
     MutationT: GraphQLType<S, Context = QueryT::Context>,
     SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
 {
+    __juniper_span_trace!("execute_sync");
     execute_sync(
         match format {
             IntrospectionFormat::All => INTROSPECTION_QUERY,

From 0134da3d915dd72825ad9392aa328bcea55c9f16 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 21:54:01 -1000
Subject: [PATCH 05/45] Add some coarse execution tracing

---
 docs/book/tests/Cargo.toml           |  2 +-
 examples/tracing_support/src/main.rs | 13 ++++++-
 juniper/Cargo.toml                   |  2 +-
 juniper/src/lib.rs                   | 13 +++++--
 juniper/src/macros/tracing.rs        | 56 +++++++++++++++++++++++++++-
 5 files changed, 79 insertions(+), 7 deletions(-)

diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml
index 5943b3bb4..282e8a61e 100644
--- a/docs/book/tests/Cargo.toml
+++ b/docs/book/tests/Cargo.toml
@@ -20,7 +20,7 @@ skeptic = "0.13"
 serde_json = "1.0.39"
 uuid = "0.8"
 
-tracing = "0.1.17"
+tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing", optional = true }
 tracing-subscriber = "0.2.9"
 tracing-log = "0.1.1"
 
diff --git a/examples/tracing_support/src/main.rs b/examples/tracing_support/src/main.rs
index 6e6bf2cac..8dc638a5e 100644
--- a/examples/tracing_support/src/main.rs
+++ b/examples/tracing_support/src/main.rs
@@ -59,6 +59,14 @@ impl Query {
         }]
     }
 
+    fn bob() -> User {
+        User {
+            id: 1,
+            kind: UserKind::Admin,
+            name: "Bob".into(),
+        }
+    }
+
     /// Fetch a URL and return the response body text.
     async fn double(x: i32) -> Result<i32, FieldError> {
         Ok(x * 2)
@@ -104,6 +112,9 @@ async fn main() {
     let (_, _errors) = juniper::execute(query, None, &root, &vars, &ctx)
         .instrument(trace_span!("doubling", "{}", 42))
         .await
-        .map_err(|e| format!("{:?}", e))
         .unwrap();
+
+    // You can also trace sync execution.
+    let query = "{ bob { name } }";
+    let (_, _errors) = juniper::execute_sync(query, None, &root, &vars, &ctx).unwrap();
 }
diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml
index 59a432f62..2ca00cca7 100644
--- a/juniper/Cargo.toml
+++ b/juniper/Cargo.toml
@@ -52,7 +52,7 @@ url = { version = "2", optional = true }
 uuid = { version = "0.8", optional = true }
 graphql-parser = {version = "0.3.0", optional = true }
 
-tracing = {version = "0.1.17", optional = true }
+tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing", optional = true }
 
 [dev-dependencies]
 bencher = "0.1.2"
diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 9eec13705..2edab1b38 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -245,6 +245,7 @@ where
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
+        __juniper_span_trace!("rule_validation");
         let mut ctx = ValidatorContext::new(&root_node.schema, &document);
         visit_all_rules(&mut ctx, &document);
 
@@ -257,6 +258,7 @@ where
     let operation = get_operation(&document, operation_name)?;
 
     {
+        __juniper_span_trace!("validate_input_values");
         let errors = validate_input_values(variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
@@ -267,6 +269,7 @@ where
         }
     }
 
+    __juniper_span_trace!("execute_sync");
     execute_validated_query(&document, operation, root_node, variables, context)
 }
 
@@ -291,6 +294,7 @@ where
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
+        __juniper_span_trace!("rule_validation");
         let mut ctx = ValidatorContext::new(&root_node.schema, &document);
         visit_all_rules(&mut ctx, &document);
 
@@ -306,6 +310,7 @@ where
     let operation = get_operation(&document, operation_name)?;
 
     {
+        __juniper_span_trace!("validate_input_values");
         let errors = validate_input_values(variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
@@ -316,8 +321,11 @@ where
         }
     }
 
-    executor::execute_validated_query_async(&document, operation, root_node, variables, context)
-        .await
+    let f = executor::execute_validated_query_async(
+        &document, operation, root_node, variables, context,
+    );
+
+    __juniper_instrument_trace!(f, "execute").await
 }
 
 /// Resolve subscription into `ValuesStream`
@@ -383,7 +391,6 @@ where
     MutationT: GraphQLType<S, Context = QueryT::Context>,
     SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
 {
-    __juniper_span_trace!("execute_sync");
     execute_sync(
         match format {
             IntrospectionFormat::All => INTROSPECTION_QUERY,
diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
index 676295266..bb97479d3 100644
--- a/juniper/src/macros/tracing.rs
+++ b/juniper/src/macros/tracing.rs
@@ -1,9 +1,63 @@
+// Macros to instrument future spans.
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_instrument_internal {
+    ($trace_type:ident; $fut:expr, $($element:expr),*) => {{
+        #[cfg(feature = "tracing")]
+        {
+            use tracing;
+            tracing::Instrument::instrument($fut, tracing::$trace_type!($($element),*))
+        }
+        #[cfg(not(feature = "tracing"))]
+        {
+            $fut
+        }
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_instrument_trace {
+    ($fut:expr, $($element:expr),*) => {{
+        $crate::__juniper_instrument_internal!(trace_span; $fut, $($element),*)
+    }}
+}
+
+// Macros to instrument (non-future) spans.
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_internal {
+    ($trace_type:ident; $($element:expr),*) => {{
+        #[cfg(feature = "tracing")]
+        use tracing;
+        #[cfg(feature = "tracing")]
+        let myspan = tracing::span!(tracing::Level::$trace_type, ($($element),*));
+        #[cfg(feature = "tracing")]
+        let _enter = myspan.enter();
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace {
+    ($($element:expr),*) => {{
+        $crate::__juniper_span_internal!(TRACE; $($element),*)
+    }}
+}
+
+// Macros to instrument events.
+
 #[doc(hidden)]
 #[macro_export]
 macro_rules! __juniper_trace_internal {
     ($trace_type:ident; $($element:expr),*) => {{
         #[cfg(feature = "tracing")]
-        tracing::$trace_type!($($element),*);
+        {
+            use tracing;
+            tracing::$trace_type!($($element),*);
+        }
     }};
 }
 

From 5c888a80e289eb7c8e235e20a894ee47151992d5 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 22:19:18 -1000
Subject: [PATCH 06/45] Remove old comment / docs

---
 examples/tracing_support/src/main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/tracing_support/src/main.rs b/examples/tracing_support/src/main.rs
index 8dc638a5e..11dc4e326 100644
--- a/examples/tracing_support/src/main.rs
+++ b/examples/tracing_support/src/main.rs
@@ -67,7 +67,7 @@ impl Query {
         }
     }
 
-    /// Fetch a URL and return the response body text.
+    /// Double the provided number.
     async fn double(x: i32) -> Result<i32, FieldError> {
         Ok(x * 2)
     }

From 01b34538ff9832258666030d057acb2228032717 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 23:07:50 -1000
Subject: [PATCH 07/45] Fix book tests

---
 docs/book/content/tracing/index.md  | 60 +++++++++++++++++++++--------
 docs/book/tests/Cargo.toml          |  9 ++---
 examples/tracing_support/Cargo.toml |  2 +-
 3 files changed, 49 insertions(+), 22 deletions(-)

diff --git a/docs/book/content/tracing/index.md b/docs/book/content/tracing/index.md
index 0a490f59d..84678fcf6 100644
--- a/docs/book/content/tracing/index.md
+++ b/docs/book/content/tracing/index.md
@@ -1,38 +1,66 @@
 # Tracing
 
-Juniper relies on the [tracing](https://crates.io/crates/tracing) crate for instrumentation.
+Juniper has optional support for the [tracing](https://crates.io/crates/tracing) crate for instrumentation.
+
+This feature is off by default and can be enabled via the `tracing` feature.
 
 !FILENAME Cargo.toml
 
 ```toml
 [dependencies]
+juniper = { version = "0.14.2", features = ["default", "tracing"]}
 tracing = "0.1.17"
-tracing-subscriber = "0.2.9"
-tracing-log = "0.1.1"
 ```
 
 ## Usage
 
 ```rust
+# extern crate futures;
+# extern crate juniper;
+# extern crate tokio;
 # extern crate tracing;
 # extern crate tracing_subscriber;
-# extern crate tracing_log;
-fn main() {
-    // compatibility with the log crate (unstable)
-    // converts all log records into tracing events
-    tracing_log::LogTracer::init().expect("LogTracer init failed");
-
-    // a builder for `FmtSubscriber`.
-    let subscriber = tracing_subscriber::FmtSubscriber::builder()
-        // all spans/events with a level higher than TRACE
-        // (e.g, debug, info, warn, etc.) will be written to stdout.
-        .with_max_level(tracing::Level::TRACE)
-        // completes the builder.
+use juniper::{EmptyMutation, EmptySubscription, RootNode, graphql_object, Variables};
+
+#[derive(Clone, Copy, Debug)]
+struct Query;
+
+#[graphql_object]
+impl Query {
+    async fn foo() -> i32 {
+        42
+    }
+}
+
+type Schema = RootNode<'static, Query, EmptyMutation<()>, EmptySubscription<()>>;
+
+
+#[tokio::main]
+async fn main() {
+    // Set up the tracing subscriber.
+    let subscriber = tracing_subscriber::fmt()
+        // This enables standard env variables such as `RUST_LOG=trace`.
+        .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
+        // This makes it so we can see all span events.
+        .with_span_events(tracing_subscriber::fmt::format::FmtSpan::FULL)
         .finish();
 
     tracing::subscriber::set_global_default(subscriber)
         .expect("Setting default tracing subscriber failed");
 
-    // ...
+    // Set up GraphQL information.
+    let vars = Variables::new();
+    let root = Schema::new(
+        Query,
+        EmptyMutation::<()>::new(),
+        EmptySubscription::<()>::new(),
+    );
+
+    // When run with `RUST_LOG=trace cargo run`, this should output traces /
+    // span events to `stdout`.
+    let query = "{ foo }";
+    let (_, _errors) = juniper::execute(query, None, &root, &vars, &())
+        .await
+        .unwrap();
 }
 ```
diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml
index 282e8a61e..0d54b11a3 100644
--- a/docs/book/tests/Cargo.toml
+++ b/docs/book/tests/Cargo.toml
@@ -6,13 +6,13 @@ edition = "2018"
 build = "build.rs"
 
 [dependencies]
-juniper = { path = "../../../juniper" }
+juniper = { path = "../../../juniper", features = ["default", "tracing"] }
 juniper_iron = { path = "../../../juniper_iron" }
 juniper_subscriptions = { path = "../../../juniper_subscriptions" }
 
 derive_more = "0.99.7"
 futures = "0.3"
-tokio = { version = "0.2", features = ["rt-core", "blocking", "stream", "rt-util"] }
+tokio = { version = "0.2", features = ["rt-core", "blocking", "stream", "rt-util", "macros"] }
 iron = "0.5.0"
 mount = "0.4.0"
 
@@ -20,9 +20,8 @@ skeptic = "0.13"
 serde_json = "1.0.39"
 uuid = "0.8"
 
-tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing", optional = true }
-tracing-subscriber = "0.2.9"
-tracing-log = "0.1.1"
+tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
+tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
 
 [build-dependencies]
 skeptic = "0.13"
diff --git a/examples/tracing_support/Cargo.toml b/examples/tracing_support/Cargo.toml
index a09c90e1b..d8d314685 100644
--- a/examples/tracing_support/Cargo.toml
+++ b/examples/tracing_support/Cargo.toml
@@ -7,7 +7,7 @@ publish = false
 
 [dependencies]
 tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
-tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
+tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
 # Note instead of a path you would use the proper Juniper version in your own
 # project.
 juniper = { path = "../../juniper", features = ["tracing"] }

From 7ac7304e55f2485404229f70869c270d34ec4030 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 23:10:41 -1000
Subject: [PATCH 08/45] fix up some imports

---
 docs/book/content/tracing/index.md | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/docs/book/content/tracing/index.md b/docs/book/content/tracing/index.md
index 84678fcf6..a1259e5ba 100644
--- a/docs/book/content/tracing/index.md
+++ b/docs/book/content/tracing/index.md
@@ -15,11 +15,10 @@ tracing = "0.1.17"
 ## Usage
 
 ```rust
-# extern crate futures;
 # extern crate juniper;
-# extern crate tokio;
-# extern crate tracing;
-# extern crate tracing_subscriber;
+extern crate tokio;
+extern crate tracing;
+extern crate tracing_subscriber;
 use juniper::{EmptyMutation, EmptySubscription, RootNode, graphql_object, Variables};
 
 #[derive(Clone, Copy, Debug)]

From 06687ddf44dee5e7ad7beed4c94a5e4b435e2294 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 23:12:34 -1000
Subject: [PATCH 09/45] Add back subscriber Cargo.toml instructions

---
 docs/book/content/tracing/index.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/book/content/tracing/index.md b/docs/book/content/tracing/index.md
index a1259e5ba..c0cc1e8d7 100644
--- a/docs/book/content/tracing/index.md
+++ b/docs/book/content/tracing/index.md
@@ -10,6 +10,7 @@ This feature is off by default and can be enabled via the `tracing` feature.
 [dependencies]
 juniper = { version = "0.14.2", features = ["default", "tracing"]}
 tracing = "0.1.17"
+tracing-subscriber = "0.2.9"
 ```
 
 ## Usage

From 697a7432179dd282c09d1df2648eb5a17586a34b Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Wed, 29 Jul 2020 18:26:39 +0100
Subject: [PATCH 10/45] Change trace errors to trace

---
 juniper/src/lib.rs | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 121c6534c..3391ed4bc 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -251,7 +251,10 @@ where
 
         let errors = ctx.into_errors();
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -263,7 +266,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -301,7 +304,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -315,7 +318,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -356,7 +359,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -369,7 +372,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }

From f2977d5085b90e3d4fa78a0972a738e0c003af20 Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Wed, 29 Jul 2020 21:24:31 +0100
Subject: [PATCH 11/45] Tracing unit tests

---
 juniper/src/tests/mod.rs         |  4 ++
 juniper/src/tests/trace_tests.rs | 87 ++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 juniper/src/tests/trace_tests.rs

diff --git a/juniper/src/tests/mod.rs b/juniper/src/tests/mod.rs
index 3e42ec7da..d624dc5ae 100644
--- a/juniper/src/tests/mod.rs
+++ b/juniper/src/tests/mod.rs
@@ -11,3 +11,7 @@ mod schema_introspection;
 mod subscriptions;
 #[cfg(test)]
 mod type_info_tests;
+
+#[cfg(test)]
+#[cfg(feature = "tracing")]
+mod trace_tests;
diff --git a/juniper/src/tests/trace_tests.rs b/juniper/src/tests/trace_tests.rs
new file mode 100644
index 000000000..957b72f22
--- /dev/null
+++ b/juniper/src/tests/trace_tests.rs
@@ -0,0 +1,87 @@
+use tracing_test::*;
+
+use crate::{
+    executor::Variables,
+    schema::model::RootNode,
+    tests::fixtures::starwars::{model::Database, schema::Query},
+    types::scalars::{EmptyMutation, EmptySubscription},
+};
+
+// TODO: waiting for https://github.com/tokio-rs/tracing/pull/793
+// TODO: async tests waiting for https://github.com/tokio-rs/tracing/pull/808
+// TODO: tracing feature needs to be enable when testing
+// cargo test --features tracing
+#[test]
+fn test_trace_execute_clean() {
+    let doc = r#"
+        {
+            hero {
+                name
+            }
+        }"#;
+    let database = Database::new();
+    let schema = RootNode::new(
+        Query,
+        EmptyMutation::<Database>::new(),
+        EmptySubscription::<Database>::new(),
+    );
+
+    let span_rule_validation = span("rule_validation");
+    let span_validate_input_values = span("validate_input_values");
+    let span_execute_sync = span("execute_sync");
+
+    let (subscriber, handle) = subscriber::expect()
+        .new_span(span_rule_validation.clone())
+        .enter(span_rule_validation.clone())
+        .exit(span_rule_validation.clone())
+        .drop_span(span_rule_validation.clone())
+        .new_span(span_validate_input_values.clone())
+        .enter(span_validate_input_values.clone())
+        .exit(span_validate_input_values.clone())
+        .drop_span(span_validate_input_values.clone())
+        .new_span(span_execute_sync.clone())
+        .enter(span_execute_sync.clone())
+        .exit(span_execute_sync.clone())
+        .drop_span(span_execute_sync.clone())
+        .done()
+        .run_with_handle();
+
+    tracing::subscriber::with_default(subscriber, || {
+        juniper::execute_sync(doc, None, &schema, &Variables::new(), &database).ok();
+    });
+
+    handle.assert_finished();
+}
+
+#[test]
+fn test_trace_execute_with_error() {
+    let doc = r#"
+        {
+            super_hero {
+                name
+            }
+        }"#;
+    let database = Database::new();
+    let schema = RootNode::new(
+        Query,
+        EmptyMutation::<Database>::new(),
+        EmptySubscription::<Database>::new(),
+    );
+
+    let span_rule_validation = span("rule_validation");
+
+    let (subscriber, handle) = subscriber::expect()
+        .new_span(span_rule_validation.clone())
+        .enter(span_rule_validation.clone())
+        .event(event().with_target("juniper"))
+        .exit(span_rule_validation.clone())
+        .drop_span(span_rule_validation.clone())
+        .done()
+        .run_with_handle();
+
+    tracing::subscriber::with_default(subscriber, || {
+        juniper::execute_sync(doc, None, &schema, &Variables::new(), &database).err();
+    });
+
+    handle.assert_finished();
+}

From 6c3654c99624585ac34a018ce839e8b5ff4b93ba Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Wed, 29 Jul 2020 21:27:04 +0100
Subject: [PATCH 12/45] Tracing unit tests names

---
 juniper/src/tests/trace_tests.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/juniper/src/tests/trace_tests.rs b/juniper/src/tests/trace_tests.rs
index 957b72f22..bca0ff08d 100644
--- a/juniper/src/tests/trace_tests.rs
+++ b/juniper/src/tests/trace_tests.rs
@@ -12,7 +12,7 @@ use crate::{
 // TODO: tracing feature needs to be enable when testing
 // cargo test --features tracing
 #[test]
-fn test_trace_execute_clean() {
+fn test_execute_sync_clean() {
     let doc = r#"
         {
             hero {
@@ -54,7 +54,7 @@ fn test_trace_execute_clean() {
 }
 
 #[test]
-fn test_trace_execute_with_error() {
+fn test_execute_sync_with_error() {
     let doc = r#"
         {
             super_hero {

From 7f746de21e9076c5f7e4b4d8922c4574b2695d26 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Wed, 29 Jul 2020 13:51:02 -1000
Subject: [PATCH 13/45] Revert "Rocket can now compile on stable"

This reverts commit 753c80fd9bf618b8297fbb4e27194f2429d4803d.
---
 juniper_rocket/Makefile.toml | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 juniper_rocket/Makefile.toml

diff --git a/juniper_rocket/Makefile.toml b/juniper_rocket/Makefile.toml
new file mode 100644
index 000000000..8695d6a67
--- /dev/null
+++ b/juniper_rocket/Makefile.toml
@@ -0,0 +1,17 @@
+[tasks.build-verbose]
+condition = { channels = ["nightly"] }
+
+[tasks.build-verbose.windows]
+condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } }
+
+[tasks.test-verbose]
+condition = { channels = ["nightly"] }
+
+[tasks.test-verbose.windows]
+condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } }
+
+[tasks.ci-coverage-flow]
+condition = { channels = ["nightly"] }
+
+[tasks.ci-coverage-flow.windows]
+disabled = true
\ No newline at end of file

From 88dc9c425e85d7f4e77f68376cbf20ddb6b12d55 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Thu, 13 Aug 2020 21:55:05 -1000
Subject: [PATCH 14/45] Fix tracing spans

---
 juniper/src/lib.rs            | 15 +++++++++++++--
 juniper/src/macros/tracing.rs | 17 +++++++----------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 3391ed4bc..715e1a114 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -124,6 +124,11 @@ pub use {futures, static_assertions as sa};
 #[doc(inline)]
 pub use futures::future::BoxFuture;
 
+// This is required by the `tracing` feature.
+#[cfg(feature = "tracing")]
+#[doc(hidden)]
+pub use tracing;
+
 // Depend on juniper_codegen and re-export everything in it.
 // This allows users to just depend on juniper and get the derive
 // functionality automatically.
@@ -242,6 +247,9 @@ where
     MutationT: GraphQLType<S, Context = QueryT::Context>,
     SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
 {
+    __juniper_span_trace!("execute_sync");
+
+    __juniper_trace!("GraphQLDocument: {}", document_source);
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
@@ -272,7 +280,7 @@ where
         }
     }
 
-    __juniper_span_trace!("execute_sync");
+    __juniper_span_trace!("execute_validated_query");
     execute_validated_query(&document, operation, root_node, variables, context)
 }
 
@@ -294,6 +302,9 @@ where
     SubscriptionT::TypeInfo: Sync,
     S: ScalarValue + Send + Sync,
 {
+    __juniper_span_trace!("execute");
+
+    __juniper_trace!("GraphQLDocument: {}", document_source);
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
@@ -328,7 +339,7 @@ where
         &document, operation, root_node, variables, context,
     );
 
-    __juniper_instrument_trace!(f, "execute").await
+    __juniper_instrument_trace!(f, "execute_validated_query").await
 }
 
 /// Resolve subscription into `ValuesStream`
diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
index bb97479d3..589b2cda1 100644
--- a/juniper/src/macros/tracing.rs
+++ b/juniper/src/macros/tracing.rs
@@ -29,22 +29,20 @@ macro_rules! __juniper_instrument_trace {
 #[doc(hidden)]
 #[macro_export]
 macro_rules! __juniper_span_internal {
-    ($trace_type:ident; $($element:expr),*) => {{
-        #[cfg(feature = "tracing")]
-        use tracing;
+    ($trace_type:ident; $($element:expr),*) => {
         #[cfg(feature = "tracing")]
-        let myspan = tracing::span!(tracing::Level::$trace_type, ($($element),*));
+        let myspan = $crate::tracing::span!($crate::tracing::Level::$trace_type, ($($element),*));
         #[cfg(feature = "tracing")]
         let _enter = myspan.enter();
-    }};
+    };
 }
 
 #[doc(hidden)]
 #[macro_export]
 macro_rules! __juniper_span_trace {
-    ($($element:expr),*) => {{
-        $crate::__juniper_span_internal!(TRACE; $($element),*)
-    }}
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(TRACE; $($element),*);
+    }
 }
 
 // Macros to instrument events.
@@ -55,8 +53,7 @@ macro_rules! __juniper_trace_internal {
     ($trace_type:ident; $($element:expr),*) => {{
         #[cfg(feature = "tracing")]
         {
-            use tracing;
-            tracing::$trace_type!($($element),*);
+            $crate::tracing::$trace_type!($($element),*);
         }
     }};
 }

From 8a2f6ec3fb9ceab9bf0581897709e3f4bc74b3f3 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Thu, 13 Aug 2020 22:25:22 -1000
Subject: [PATCH 15/45] Do not include trailing newline on the last error

---
 juniper/src/lib.rs | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 715e1a114..ea6a1ddb8 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -217,9 +217,12 @@ impl<'a> fmt::Display for GraphQLError<'a> {
         match self {
             GraphQLError::ParseError(error) => write!(f, "{}", error),
             GraphQLError::ValidationError(errors) => {
-                for error in errors {
-                    writeln!(f, "{}", error)?;
-                }
+                let errors = errors
+                    .iter()
+                    .map(|e| format!("{}", e))
+                    .collect::<Vec<_>>()
+                    .join("\n");
+                write!(f, "{}", errors)?;
                 Ok(())
             }
             GraphQLError::NoOperationProvided => write!(f, "No operation provided"),

From 83fd44d13b53708e3ffdc8b53f5000039d437fed Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Thu, 13 Aug 2020 22:31:05 -1000
Subject: [PATCH 16/45] Standard tracing labels on snake_case

---
 juniper/src/lib.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index ea6a1ddb8..700c396d7 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -252,7 +252,7 @@ where
 {
     __juniper_span_trace!("execute_sync");
 
-    __juniper_trace!("GraphQLDocument: {}", document_source);
+    __juniper_trace!("document: {}", document_source);
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
@@ -263,7 +263,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {}", gql_error);
 
             return Err(gql_error);
         }
@@ -277,7 +277,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {}", gql_error);
 
             return Err(gql_error);
         }
@@ -307,7 +307,7 @@ where
 {
     __juniper_span_trace!("execute");
 
-    __juniper_trace!("GraphQLDocument: {}", document_source);
+    __juniper_trace!("document: {}", document_source);
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
@@ -318,7 +318,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {}", gql_error);
 
             return Err(gql_error);
         }
@@ -332,7 +332,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {}", gql_error);
 
             return Err(gql_error);
         }

From c92dd87c73434f6531d0c5d9535b95952bf7b7d2 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Thu, 13 Aug 2020 22:31:37 -1000
Subject: [PATCH 17/45] Add a validation error case to the tracing example

---
 examples/tracing_support/src/main.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/tracing_support/src/main.rs b/examples/tracing_support/src/main.rs
index 11dc4e326..502c47ba5 100644
--- a/examples/tracing_support/src/main.rs
+++ b/examples/tracing_support/src/main.rs
@@ -115,6 +115,7 @@ async fn main() {
         .unwrap();
 
     // You can also trace sync execution.
-    let query = "{ bob { name } }";
-    let (_, _errors) = juniper::execute_sync(query, None, &root, &vars, &ctx).unwrap();
+    // This should output a validation error in the middle of other spans.
+    let query = "{ bob { field_that_does_not_exist } }";
+    let _ = juniper::execute_sync(query, None, &root, &vars, &ctx);
 }

From 64d8e11cc3b6fe04ccfda35340e081f3546828b7 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Fri, 14 Aug 2020 21:55:18 -1000
Subject: [PATCH 18/45] Use $crate everywhere

---
 juniper/src/macros/tracing.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
index 589b2cda1..a77eab9b7 100644
--- a/juniper/src/macros/tracing.rs
+++ b/juniper/src/macros/tracing.rs
@@ -6,8 +6,7 @@ macro_rules! __juniper_instrument_internal {
     ($trace_type:ident; $fut:expr, $($element:expr),*) => {{
         #[cfg(feature = "tracing")]
         {
-            use tracing;
-            tracing::Instrument::instrument($fut, tracing::$trace_type!($($element),*))
+            $crate::tracing::Instrument::instrument($fut, tracing::$trace_type!($($element),*))
         }
         #[cfg(not(feature = "tracing"))]
         {

From cdbc0ce42d318cbe0d913a83af058e81e5196a15 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Fri, 14 Aug 2020 21:55:36 -1000
Subject: [PATCH 19/45] Add other levels to span macros

---
 juniper/src/macros/tracing.rs | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
index a77eab9b7..05882e398 100644
--- a/juniper/src/macros/tracing.rs
+++ b/juniper/src/macros/tracing.rs
@@ -44,6 +44,38 @@ macro_rules! __juniper_span_trace {
     }
 }
 
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace_debug {
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(DEBUG; $($element),*);
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace_info {
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(INFO; $($element),*);
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace_warn {
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(WARN; $($element),*);
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace_error {
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(ERROR; $($element),*);
+    }
+}
+
 // Macros to instrument events.
 
 #[doc(hidden)]

From 5938345ffa5fc453ff73570bcc182c99bb7a58de Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Sat, 3 Oct 2020 14:13:21 +0100
Subject: [PATCH 20/45] Use the released tracing crate

---
 docs/book/tests/Cargo.toml          | 4 ++--
 examples/tracing_support/Cargo.toml | 4 ++--
 juniper/Cargo.toml                  | 2 +-
 juniper/src/tests/trace_tests.rs    | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml
index 0d54b11a3..16ce9614a 100644
--- a/docs/book/tests/Cargo.toml
+++ b/docs/book/tests/Cargo.toml
@@ -20,8 +20,8 @@ skeptic = "0.13"
 serde_json = "1.0.39"
 uuid = "0.8"
 
-tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
-tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
+tracing = "0.1.21"
+tracing-subscriber = "0.2.12"
 
 [build-dependencies]
 skeptic = "0.13"
diff --git a/examples/tracing_support/Cargo.toml b/examples/tracing_support/Cargo.toml
index d8d314685..c7c8aa0ed 100644
--- a/examples/tracing_support/Cargo.toml
+++ b/examples/tracing_support/Cargo.toml
@@ -6,8 +6,8 @@ edition = "2018"
 publish = false
 
 [dependencies]
-tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
-tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
+tracing = "0.1.21"
+tracing-subscriber = "0.2.12"
 # Note instead of a path you would use the proper Juniper version in your own
 # project.
 juniper = { path = "../../juniper", features = ["tracing"] }
diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml
index 22f8ea22b..bfaf79caf 100644
--- a/juniper/Cargo.toml
+++ b/juniper/Cargo.toml
@@ -53,7 +53,7 @@ url = { version = "2.0", optional = true }
 uuid = { default-features = false, version = "0.8", optional = true }
 graphql-parser = { version = "0.3", optional = true }
 
-tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing", optional = true }
+tracing = { version = "0.1.21", optional = true }
 
 [dev-dependencies]
 bencher = "0.1.2"
diff --git a/juniper/src/tests/trace_tests.rs b/juniper/src/tests/trace_tests.rs
index bca0ff08d..89d53add8 100644
--- a/juniper/src/tests/trace_tests.rs
+++ b/juniper/src/tests/trace_tests.rs
@@ -8,7 +8,7 @@ use crate::{
 };
 
 // TODO: waiting for https://github.com/tokio-rs/tracing/pull/793
-// TODO: async tests waiting for https://github.com/tokio-rs/tracing/pull/808
+// TODO: async tests
 // TODO: tracing feature needs to be enable when testing
 // cargo test --features tracing
 #[test]

From 8bc07f63a330409ab0fe410d81fbe9c3ceb2dab1 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian@legnitto.com>
Date: Wed, 28 Oct 2020 19:54:40 -0700
Subject: [PATCH 21/45] Fix email address

---
 examples/tracing_support/Cargo.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/tracing_support/Cargo.toml b/examples/tracing_support/Cargo.toml
index c7c8aa0ed..408536fdb 100644
--- a/examples/tracing_support/Cargo.toml
+++ b/examples/tracing_support/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 name = "tracing_support"
 version = "0.1.0"
-authors = ["Christian Legnitto <christian.legnitto@robinhood.com>"]
+authors = ["Christian Legnitto <christian@legnitto.com>"]
 edition = "2018"
 publish = false
 

From 82497d3918244c28615fc03e7754bb950dc1c5b4 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian@legnitto.com>
Date: Wed, 28 Oct 2020 19:56:49 -0700
Subject: [PATCH 22/45] Standardize on snake case for tracing

---
 juniper/src/lib.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index b980b7e88..a76610e9a 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -373,7 +373,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -386,7 +386,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {:?}", gql_error);
 
             return Err(gql_error);
         }

From 79102a3ed063da69c55975259bc3039ff80529fb Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Sat, 25 Jul 2020 20:57:29 +0100
Subject: [PATCH 23/45] Add tracing support

---
 docs/book/content/SUMMARY.md       |  2 ++
 docs/book/content/tracing/index.md | 38 +++++++++++++++++++++++
 docs/book/tests/Cargo.toml         |  4 +++
 juniper/Cargo.toml                 |  2 ++
 juniper/src/lib.rs                 | 25 ++++++++++++----
 juniper/src/macros/mod.rs          |  4 +++
 juniper/src/macros/tracing.rs      | 48 ++++++++++++++++++++++++++++++
 7 files changed, 118 insertions(+), 5 deletions(-)
 create mode 100644 docs/book/content/tracing/index.md
 create mode 100644 juniper/src/macros/tracing.rs

diff --git a/docs/book/content/SUMMARY.md b/docs/book/content/SUMMARY.md
index 24ea171ff..4c1203078 100644
--- a/docs/book/content/SUMMARY.md
+++ b/docs/book/content/SUMMARY.md
@@ -25,6 +25,8 @@
     - [Hyper](servers/hyper.md)
   - [Third Party Integrations](servers/third-party.md)
 
+- [Tracing](tracing/index.md)
+
 - [Advanced Topics](advanced/index.md)
 
   - [Introspection](advanced/introspection.md)
diff --git a/docs/book/content/tracing/index.md b/docs/book/content/tracing/index.md
new file mode 100644
index 000000000..0a490f59d
--- /dev/null
+++ b/docs/book/content/tracing/index.md
@@ -0,0 +1,38 @@
+# Tracing
+
+Juniper relies on the [tracing](https://crates.io/crates/tracing) crate for instrumentation.
+
+!FILENAME Cargo.toml
+
+```toml
+[dependencies]
+tracing = "0.1.17"
+tracing-subscriber = "0.2.9"
+tracing-log = "0.1.1"
+```
+
+## Usage
+
+```rust
+# extern crate tracing;
+# extern crate tracing_subscriber;
+# extern crate tracing_log;
+fn main() {
+    // compatibility with the log crate (unstable)
+    // converts all log records into tracing events
+    tracing_log::LogTracer::init().expect("LogTracer init failed");
+
+    // a builder for `FmtSubscriber`.
+    let subscriber = tracing_subscriber::FmtSubscriber::builder()
+        // all spans/events with a level higher than TRACE
+        // (e.g, debug, info, warn, etc.) will be written to stdout.
+        .with_max_level(tracing::Level::TRACE)
+        // completes the builder.
+        .finish();
+
+    tracing::subscriber::set_global_default(subscriber)
+        .expect("Setting default tracing subscriber failed");
+
+    // ...
+}
+```
diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml
index 7456182c7..44a41eb0e 100644
--- a/docs/book/tests/Cargo.toml
+++ b/docs/book/tests/Cargo.toml
@@ -19,6 +19,10 @@ serde_json = "1.0"
 tokio = { version = "0.2", features = ["blocking", "macros", "rt-core", "rt-util", "stream"] }
 uuid = "0.8"
 
+tracing = "0.1.17"
+tracing-subscriber = "0.2.9"
+tracing-log = "0.1.1"
+
 [build-dependencies]
 skeptic = "0.13"
 
diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml
index d13e8750e..f3bdee01a 100644
--- a/juniper/Cargo.toml
+++ b/juniper/Cargo.toml
@@ -50,6 +50,8 @@ static_assertions = "1.1"
 url = { version = "2.0", optional = true }
 uuid = { version = "0.8", default-features = false, optional = true }
 
+tracing = {version = "0.1.17", optional = true }
+
 [dev-dependencies]
 bencher = "0.1.2"
 pretty_assertions = "0.6.1"
diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 3cab9b96c..ca80d2767 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -246,7 +246,10 @@ where
         let errors = validate_input_values(variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -279,7 +282,10 @@ where
 
         let errors = ctx.into_errors();
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -289,7 +295,10 @@ where
         let errors = validate_input_values(variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -324,7 +333,10 @@ where
 
         let errors = ctx.into_errors();
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -334,7 +346,10 @@ where
         let errors = validate_input_values(&variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
diff --git a/juniper/src/macros/mod.rs b/juniper/src/macros/mod.rs
index b38958dae..c052a5eb2 100644
--- a/juniper/src/macros/mod.rs
+++ b/juniper/src/macros/mod.rs
@@ -4,3 +4,7 @@ pub mod helper;
 
 #[cfg(test)]
 mod tests;
+
+pub mod subscription_helpers;
+
+mod tracing;
diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
new file mode 100644
index 000000000..676295266
--- /dev/null
+++ b/juniper/src/macros/tracing.rs
@@ -0,0 +1,48 @@
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_internal {
+    ($trace_type:ident; $($element:expr),*) => {{
+        #[cfg(feature = "tracing")]
+        tracing::$trace_type!($($element),*);
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(trace; $($element),*)
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_debug {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(debug; $($element),*)
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_info {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(info; $($element),*)
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_warn {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(warn; $($element),*)
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_trace_error {
+    ($($element:expr),*) => {{
+        $crate::__juniper_trace_internal!(error; $($element),*)
+    }};
+}

From 6a16cf857ff21a87638d58cb86bf73bd372e99b7 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 10:16:28 -1000
Subject: [PATCH 24/45] Rocket can now compile on stable

---
 juniper_rocket/Makefile.toml | 17 -----------------
 1 file changed, 17 deletions(-)
 delete mode 100644 juniper_rocket/Makefile.toml

diff --git a/juniper_rocket/Makefile.toml b/juniper_rocket/Makefile.toml
deleted file mode 100644
index 8695d6a67..000000000
--- a/juniper_rocket/Makefile.toml
+++ /dev/null
@@ -1,17 +0,0 @@
-[tasks.build-verbose]
-condition = { channels = ["nightly"] }
-
-[tasks.build-verbose.windows]
-condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } }
-
-[tasks.test-verbose]
-condition = { channels = ["nightly"] }
-
-[tasks.test-verbose.windows]
-condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } }
-
-[tasks.ci-coverage-flow]
-condition = { channels = ["nightly"] }
-
-[tasks.ci-coverage-flow.windows]
-disabled = true
\ No newline at end of file

From 11bb5e2ac7a24f1bf27c134190705695649a4857 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 21:43:10 -1000
Subject: [PATCH 25/45] Add tracing support example

---
 Cargo.toml                             |   1 +
 examples/tracing_support/.gitignore    |   4 +
 examples/tracing_support/Cargo.toml    |  14 ++++
 examples/tracing_support/Makefile.toml |  20 +++++
 examples/tracing_support/src/main.rs   | 109 +++++++++++++++++++++++++
 juniper/src/lib.rs                     |   1 +
 6 files changed, 149 insertions(+)
 create mode 100644 examples/tracing_support/.gitignore
 create mode 100644 examples/tracing_support/Cargo.toml
 create mode 100644 examples/tracing_support/Makefile.toml
 create mode 100644 examples/tracing_support/src/main.rs

diff --git a/Cargo.toml b/Cargo.toml
index ddb54b5bb..22c710236 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,7 @@ members = [
   "juniper_codegen",
   "juniper",
   "examples/basic_subscriptions",
+  "examples/tracing_support",
   "examples/warp_async",
   "examples/warp_subscriptions",
   "examples/actix_subscriptions",
diff --git a/examples/tracing_support/.gitignore b/examples/tracing_support/.gitignore
new file mode 100644
index 000000000..68f412d09
--- /dev/null
+++ b/examples/tracing_support/.gitignore
@@ -0,0 +1,4 @@
+/target/
+**/*.rs.bk
+Cargo.lock
+
diff --git a/examples/tracing_support/Cargo.toml b/examples/tracing_support/Cargo.toml
new file mode 100644
index 000000000..a09c90e1b
--- /dev/null
+++ b/examples/tracing_support/Cargo.toml
@@ -0,0 +1,14 @@
+[package]
+name = "tracing_support"
+version = "0.1.0"
+authors = ["Christian Legnitto <christian.legnitto@robinhood.com>"]
+edition = "2018"
+publish = false
+
+[dependencies]
+tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
+tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
+# Note instead of a path you would use the proper Juniper version in your own
+# project.
+juniper = { path = "../../juniper", features = ["tracing"] }
+tokio = { version = "0.2.22", features = ["rt-core", "macros", "blocking"] }
diff --git a/examples/tracing_support/Makefile.toml b/examples/tracing_support/Makefile.toml
new file mode 100644
index 000000000..bce0dd4c9
--- /dev/null
+++ b/examples/tracing_support/Makefile.toml
@@ -0,0 +1,20 @@
+[tasks.run]
+disabled = true
+
+[tasks.release]
+disabled = true
+
+[tasks.release-some]
+disabled = true
+
+[tasks.release-local-test]
+disabled = true
+
+[tasks.release-some-local-test]
+disabled = true
+
+[tasks.release-dry-run]
+disabled = true
+
+[tasks.release-some-dry-run]
+disabled = true
diff --git a/examples/tracing_support/src/main.rs b/examples/tracing_support/src/main.rs
new file mode 100644
index 000000000..6e6bf2cac
--- /dev/null
+++ b/examples/tracing_support/src/main.rs
@@ -0,0 +1,109 @@
+extern crate juniper;
+extern crate tokio;
+extern crate tracing;
+extern crate tracing_subscriber;
+
+use juniper::{
+    graphql_object, EmptyMutation, EmptySubscription, FieldError, GraphQLEnum, RootNode, Variables,
+};
+use tracing::{trace_span, Instrument as _};
+use tracing_subscriber::EnvFilter;
+
+#[derive(Clone, Copy, Debug)]
+struct Context;
+impl juniper::Context for Context {}
+
+#[derive(Clone, Copy, Debug, GraphQLEnum)]
+enum UserKind {
+    Admin,
+    User,
+    Guest,
+}
+
+#[derive(Clone, Debug)]
+struct User {
+    id: i32,
+    kind: UserKind,
+    name: String,
+}
+
+#[graphql_object(Context = Context)]
+impl User {
+    fn id(&self) -> i32 {
+        self.id
+    }
+
+    fn kind(&self) -> UserKind {
+        self.kind
+    }
+
+    fn name(&self) -> &str {
+        &self.name
+    }
+
+    async fn friends(&self) -> Vec<User> {
+        vec![]
+    }
+}
+
+#[derive(Clone, Copy, Debug)]
+struct Query;
+
+#[graphql_object(Context = Context)]
+impl Query {
+    async fn users() -> Vec<User> {
+        vec![User {
+            id: 1,
+            kind: UserKind::Admin,
+            name: "user1".into(),
+        }]
+    }
+
+    /// Fetch a URL and return the response body text.
+    async fn double(x: i32) -> Result<i32, FieldError> {
+        Ok(x * 2)
+    }
+}
+
+type Schema = RootNode<'static, Query, EmptyMutation<Context>, EmptySubscription<Context>>;
+
+fn schema() -> Schema {
+    Schema::new(
+        Query,
+        EmptyMutation::<Context>::new(),
+        EmptySubscription::<Context>::new(),
+    )
+}
+
+#[tokio::main]
+async fn main() {
+    // A builder for `FmtSubscriber`.
+    let subscriber = tracing_subscriber::fmt()
+        // This enables standard env variables such as `RUST_LOG=trace`.
+        .with_env_filter(EnvFilter::from_default_env())
+        // This makes it so we can see all span events.
+        .with_span_events(tracing_subscriber::fmt::format::FmtSpan::FULL)
+        .finish();
+
+    tracing::subscriber::set_global_default(subscriber).expect("no global subscriber has been set");
+
+    let ctx = Context {};
+    let vars = Variables::new();
+    let root = schema();
+
+    // When run with `RUST_LOG=trace cargo run`, this should output to `stdout`.
+    let query = "{ users { id } }";
+    let (_, _errors) = juniper::execute(query, None, &root, &vars, &ctx)
+        .await
+        .unwrap();
+
+    // When run with `RUST_LOG=trace cargo run`, this should output to `stdout`.
+    // Note that there is a top-level span of "doubling{42}" as it was set
+    // here. This is useful to attach context to each call to `execute`.
+    let query = "{ double(x: 42) }";
+    let (_, _errors) = juniper::execute(query, None, &root, &vars, &ctx)
+        .instrument(trace_span!("doubling", "{}", 42))
+        .await
+        .map_err(|e| format!("{:?}", e))
+        .unwrap();
+}
diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index ca80d2767..3f1941ac4 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -369,6 +369,7 @@ where
     MutationT: GraphQLType<S, Context = QueryT::Context>,
     SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
 {
+    __juniper_span_trace!("execute_sync");
     execute_sync(
         match format {
             IntrospectionFormat::All => INTROSPECTION_QUERY,

From 57ecb56010ea6bb6d59c34f778120809a8a4ca07 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 21:54:01 -1000
Subject: [PATCH 26/45] Add some coarse execution tracing

---
 docs/book/tests/Cargo.toml           |  2 +-
 examples/tracing_support/src/main.rs | 13 ++++++-
 juniper/Cargo.toml                   |  2 +-
 juniper/src/lib.rs                   | 13 +++++--
 juniper/src/macros/tracing.rs        | 56 +++++++++++++++++++++++++++-
 5 files changed, 79 insertions(+), 7 deletions(-)

diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml
index 44a41eb0e..18155e865 100644
--- a/docs/book/tests/Cargo.toml
+++ b/docs/book/tests/Cargo.toml
@@ -19,7 +19,7 @@ serde_json = "1.0"
 tokio = { version = "0.2", features = ["blocking", "macros", "rt-core", "rt-util", "stream"] }
 uuid = "0.8"
 
-tracing = "0.1.17"
+tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing", optional = true }
 tracing-subscriber = "0.2.9"
 tracing-log = "0.1.1"
 
diff --git a/examples/tracing_support/src/main.rs b/examples/tracing_support/src/main.rs
index 6e6bf2cac..8dc638a5e 100644
--- a/examples/tracing_support/src/main.rs
+++ b/examples/tracing_support/src/main.rs
@@ -59,6 +59,14 @@ impl Query {
         }]
     }
 
+    fn bob() -> User {
+        User {
+            id: 1,
+            kind: UserKind::Admin,
+            name: "Bob".into(),
+        }
+    }
+
     /// Fetch a URL and return the response body text.
     async fn double(x: i32) -> Result<i32, FieldError> {
         Ok(x * 2)
@@ -104,6 +112,9 @@ async fn main() {
     let (_, _errors) = juniper::execute(query, None, &root, &vars, &ctx)
         .instrument(trace_span!("doubling", "{}", 42))
         .await
-        .map_err(|e| format!("{:?}", e))
         .unwrap();
+
+    // You can also trace sync execution.
+    let query = "{ bob { name } }";
+    let (_, _errors) = juniper::execute_sync(query, None, &root, &vars, &ctx).unwrap();
 }
diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml
index f3bdee01a..b52b2b2a9 100644
--- a/juniper/Cargo.toml
+++ b/juniper/Cargo.toml
@@ -50,7 +50,7 @@ static_assertions = "1.1"
 url = { version = "2.0", optional = true }
 uuid = { version = "0.8", default-features = false, optional = true }
 
-tracing = {version = "0.1.17", optional = true }
+tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing", optional = true }
 
 [dev-dependencies]
 bencher = "0.1.2"
diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 3f1941ac4..ca98e841c 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -231,6 +231,7 @@ where
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
+        __juniper_span_trace!("rule_validation");
         let mut ctx = ValidatorContext::new(&root_node.schema, &document);
         visit_all_rules(&mut ctx, &document);
 
@@ -243,6 +244,7 @@ where
     let operation = get_operation(&document, operation_name)?;
 
     {
+        __juniper_span_trace!("validate_input_values");
         let errors = validate_input_values(variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
@@ -253,6 +255,7 @@ where
         }
     }
 
+    __juniper_span_trace!("execute_sync");
     execute_validated_query(&document, operation, root_node, variables, context)
 }
 
@@ -277,6 +280,7 @@ where
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
+        __juniper_span_trace!("rule_validation");
         let mut ctx = ValidatorContext::new(&root_node.schema, &document);
         visit_all_rules(&mut ctx, &document);
 
@@ -292,6 +296,7 @@ where
     let operation = get_operation(&document, operation_name)?;
 
     {
+        __juniper_span_trace!("validate_input_values");
         let errors = validate_input_values(variables, operation, &root_node.schema);
 
         if !errors.is_empty() {
@@ -302,8 +307,11 @@ where
         }
     }
 
-    executor::execute_validated_query_async(&document, operation, root_node, variables, context)
-        .await
+    let f = executor::execute_validated_query_async(
+        &document, operation, root_node, variables, context,
+    );
+
+    __juniper_instrument_trace!(f, "execute").await
 }
 
 /// Resolve subscription into `ValuesStream`
@@ -369,7 +377,6 @@ where
     MutationT: GraphQLType<S, Context = QueryT::Context>,
     SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
 {
-    __juniper_span_trace!("execute_sync");
     execute_sync(
         match format {
             IntrospectionFormat::All => INTROSPECTION_QUERY,
diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
index 676295266..bb97479d3 100644
--- a/juniper/src/macros/tracing.rs
+++ b/juniper/src/macros/tracing.rs
@@ -1,9 +1,63 @@
+// Macros to instrument future spans.
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_instrument_internal {
+    ($trace_type:ident; $fut:expr, $($element:expr),*) => {{
+        #[cfg(feature = "tracing")]
+        {
+            use tracing;
+            tracing::Instrument::instrument($fut, tracing::$trace_type!($($element),*))
+        }
+        #[cfg(not(feature = "tracing"))]
+        {
+            $fut
+        }
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_instrument_trace {
+    ($fut:expr, $($element:expr),*) => {{
+        $crate::__juniper_instrument_internal!(trace_span; $fut, $($element),*)
+    }}
+}
+
+// Macros to instrument (non-future) spans.
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_internal {
+    ($trace_type:ident; $($element:expr),*) => {{
+        #[cfg(feature = "tracing")]
+        use tracing;
+        #[cfg(feature = "tracing")]
+        let myspan = tracing::span!(tracing::Level::$trace_type, ($($element),*));
+        #[cfg(feature = "tracing")]
+        let _enter = myspan.enter();
+    }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace {
+    ($($element:expr),*) => {{
+        $crate::__juniper_span_internal!(TRACE; $($element),*)
+    }}
+}
+
+// Macros to instrument events.
+
 #[doc(hidden)]
 #[macro_export]
 macro_rules! __juniper_trace_internal {
     ($trace_type:ident; $($element:expr),*) => {{
         #[cfg(feature = "tracing")]
-        tracing::$trace_type!($($element),*);
+        {
+            use tracing;
+            tracing::$trace_type!($($element),*);
+        }
     }};
 }
 

From cff66787e9be36ef8700eac5afb58655cbd24202 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 22:19:18 -1000
Subject: [PATCH 27/45] Remove old comment / docs

---
 examples/tracing_support/src/main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/tracing_support/src/main.rs b/examples/tracing_support/src/main.rs
index 8dc638a5e..11dc4e326 100644
--- a/examples/tracing_support/src/main.rs
+++ b/examples/tracing_support/src/main.rs
@@ -67,7 +67,7 @@ impl Query {
         }
     }
 
-    /// Fetch a URL and return the response body text.
+    /// Double the provided number.
     async fn double(x: i32) -> Result<i32, FieldError> {
         Ok(x * 2)
     }

From cb3ee27a88409d053c8bba19b16f477897658514 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 23:07:50 -1000
Subject: [PATCH 28/45] Fix book tests

---
 docs/book/content/tracing/index.md  | 60 +++++++++++++++++++++--------
 docs/book/tests/Cargo.toml          |  8 ++--
 examples/tracing_support/Cargo.toml |  2 +-
 3 files changed, 49 insertions(+), 21 deletions(-)

diff --git a/docs/book/content/tracing/index.md b/docs/book/content/tracing/index.md
index 0a490f59d..84678fcf6 100644
--- a/docs/book/content/tracing/index.md
+++ b/docs/book/content/tracing/index.md
@@ -1,38 +1,66 @@
 # Tracing
 
-Juniper relies on the [tracing](https://crates.io/crates/tracing) crate for instrumentation.
+Juniper has optional support for the [tracing](https://crates.io/crates/tracing) crate for instrumentation.
+
+This feature is off by default and can be enabled via the `tracing` feature.
 
 !FILENAME Cargo.toml
 
 ```toml
 [dependencies]
+juniper = { version = "0.14.2", features = ["default", "tracing"]}
 tracing = "0.1.17"
-tracing-subscriber = "0.2.9"
-tracing-log = "0.1.1"
 ```
 
 ## Usage
 
 ```rust
+# extern crate futures;
+# extern crate juniper;
+# extern crate tokio;
 # extern crate tracing;
 # extern crate tracing_subscriber;
-# extern crate tracing_log;
-fn main() {
-    // compatibility with the log crate (unstable)
-    // converts all log records into tracing events
-    tracing_log::LogTracer::init().expect("LogTracer init failed");
-
-    // a builder for `FmtSubscriber`.
-    let subscriber = tracing_subscriber::FmtSubscriber::builder()
-        // all spans/events with a level higher than TRACE
-        // (e.g, debug, info, warn, etc.) will be written to stdout.
-        .with_max_level(tracing::Level::TRACE)
-        // completes the builder.
+use juniper::{EmptyMutation, EmptySubscription, RootNode, graphql_object, Variables};
+
+#[derive(Clone, Copy, Debug)]
+struct Query;
+
+#[graphql_object]
+impl Query {
+    async fn foo() -> i32 {
+        42
+    }
+}
+
+type Schema = RootNode<'static, Query, EmptyMutation<()>, EmptySubscription<()>>;
+
+
+#[tokio::main]
+async fn main() {
+    // Set up the tracing subscriber.
+    let subscriber = tracing_subscriber::fmt()
+        // This enables standard env variables such as `RUST_LOG=trace`.
+        .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
+        // This makes it so we can see all span events.
+        .with_span_events(tracing_subscriber::fmt::format::FmtSpan::FULL)
         .finish();
 
     tracing::subscriber::set_global_default(subscriber)
         .expect("Setting default tracing subscriber failed");
 
-    // ...
+    // Set up GraphQL information.
+    let vars = Variables::new();
+    let root = Schema::new(
+        Query,
+        EmptyMutation::<()>::new(),
+        EmptySubscription::<()>::new(),
+    );
+
+    // When run with `RUST_LOG=trace cargo run`, this should output traces /
+    // span events to `stdout`.
+    let query = "{ foo }";
+    let (_, _errors) = juniper::execute(query, None, &root, &vars, &())
+        .await
+        .unwrap();
 }
 ```
diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml
index 18155e865..52ef407f6 100644
--- a/docs/book/tests/Cargo.toml
+++ b/docs/book/tests/Cargo.toml
@@ -6,12 +6,13 @@ authors = ["Magnus Hallin <mhallin@fastmail.com>"]
 build = "build.rs"
 
 [dependencies]
-juniper = { path = "../../../juniper" }
+juniper = { path = "../../../juniper", features = ["default", "tracing"] }
 juniper_iron = { path = "../../../juniper_iron" }
 juniper_subscriptions = { path = "../../../juniper_subscriptions" }
 
 derive_more = "0.99"
 futures = "0.3"
+tokio = { version = "0.2", features = ["rt-core", "blocking", "stream", "rt-util", "macros"] }
 iron = "0.5"
 mount = "0.4"
 skeptic = "0.13"
@@ -19,9 +20,8 @@ serde_json = "1.0"
 tokio = { version = "0.2", features = ["blocking", "macros", "rt-core", "rt-util", "stream"] }
 uuid = "0.8"
 
-tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing", optional = true }
-tracing-subscriber = "0.2.9"
-tracing-log = "0.1.1"
+tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
+tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
 
 [build-dependencies]
 skeptic = "0.13"
diff --git a/examples/tracing_support/Cargo.toml b/examples/tracing_support/Cargo.toml
index a09c90e1b..d8d314685 100644
--- a/examples/tracing_support/Cargo.toml
+++ b/examples/tracing_support/Cargo.toml
@@ -7,7 +7,7 @@ publish = false
 
 [dependencies]
 tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
-tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
+tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
 # Note instead of a path you would use the proper Juniper version in your own
 # project.
 juniper = { path = "../../juniper", features = ["tracing"] }

From 0d52c50ba2ffecdcf5871f17ef13afc9d40bbfb7 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 23:10:41 -1000
Subject: [PATCH 29/45] fix up some imports

---
 docs/book/content/tracing/index.md | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/docs/book/content/tracing/index.md b/docs/book/content/tracing/index.md
index 84678fcf6..a1259e5ba 100644
--- a/docs/book/content/tracing/index.md
+++ b/docs/book/content/tracing/index.md
@@ -15,11 +15,10 @@ tracing = "0.1.17"
 ## Usage
 
 ```rust
-# extern crate futures;
 # extern crate juniper;
-# extern crate tokio;
-# extern crate tracing;
-# extern crate tracing_subscriber;
+extern crate tokio;
+extern crate tracing;
+extern crate tracing_subscriber;
 use juniper::{EmptyMutation, EmptySubscription, RootNode, graphql_object, Variables};
 
 #[derive(Clone, Copy, Debug)]

From 7f2450996b34e6175f39816db681dbeffd9fe825 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Tue, 28 Jul 2020 23:12:34 -1000
Subject: [PATCH 30/45] Add back subscriber Cargo.toml instructions

---
 docs/book/content/tracing/index.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/book/content/tracing/index.md b/docs/book/content/tracing/index.md
index a1259e5ba..c0cc1e8d7 100644
--- a/docs/book/content/tracing/index.md
+++ b/docs/book/content/tracing/index.md
@@ -10,6 +10,7 @@ This feature is off by default and can be enabled via the `tracing` feature.
 [dependencies]
 juniper = { version = "0.14.2", features = ["default", "tracing"]}
 tracing = "0.1.17"
+tracing-subscriber = "0.2.9"
 ```
 
 ## Usage

From cb7ab0cf34a44c5583c23674bf716349d7442704 Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Wed, 29 Jul 2020 18:26:39 +0100
Subject: [PATCH 31/45] Change trace errors to trace

---
 juniper/src/lib.rs | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index ca98e841c..cd37858c6 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -237,7 +237,10 @@ where
 
         let errors = ctx.into_errors();
         if !errors.is_empty() {
-            return Err(GraphQLError::ValidationError(errors));
+            let gql_error = GraphQLError::ValidationError(errors);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
+
+            return Err(gql_error);
         }
     }
 
@@ -249,7 +252,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -287,7 +290,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -301,7 +304,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -342,7 +345,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -355,7 +358,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace_error!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("GraphQLError: {:?}", gql_error);
 
             return Err(gql_error);
         }

From 7b02ccc6b88709888baf00afd85e9819e2440854 Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Wed, 29 Jul 2020 21:24:31 +0100
Subject: [PATCH 32/45] Tracing unit tests

---
 juniper/src/tests/mod.rs         |  4 ++
 juniper/src/tests/trace_tests.rs | 87 ++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 juniper/src/tests/trace_tests.rs

diff --git a/juniper/src/tests/mod.rs b/juniper/src/tests/mod.rs
index 3e42ec7da..d624dc5ae 100644
--- a/juniper/src/tests/mod.rs
+++ b/juniper/src/tests/mod.rs
@@ -11,3 +11,7 @@ mod schema_introspection;
 mod subscriptions;
 #[cfg(test)]
 mod type_info_tests;
+
+#[cfg(test)]
+#[cfg(feature = "tracing")]
+mod trace_tests;
diff --git a/juniper/src/tests/trace_tests.rs b/juniper/src/tests/trace_tests.rs
new file mode 100644
index 000000000..957b72f22
--- /dev/null
+++ b/juniper/src/tests/trace_tests.rs
@@ -0,0 +1,87 @@
+use tracing_test::*;
+
+use crate::{
+    executor::Variables,
+    schema::model::RootNode,
+    tests::fixtures::starwars::{model::Database, schema::Query},
+    types::scalars::{EmptyMutation, EmptySubscription},
+};
+
+// TODO: waiting for https://github.com/tokio-rs/tracing/pull/793
+// TODO: async tests waiting for https://github.com/tokio-rs/tracing/pull/808
+// TODO: tracing feature needs to be enable when testing
+// cargo test --features tracing
+#[test]
+fn test_trace_execute_clean() {
+    let doc = r#"
+        {
+            hero {
+                name
+            }
+        }"#;
+    let database = Database::new();
+    let schema = RootNode::new(
+        Query,
+        EmptyMutation::<Database>::new(),
+        EmptySubscription::<Database>::new(),
+    );
+
+    let span_rule_validation = span("rule_validation");
+    let span_validate_input_values = span("validate_input_values");
+    let span_execute_sync = span("execute_sync");
+
+    let (subscriber, handle) = subscriber::expect()
+        .new_span(span_rule_validation.clone())
+        .enter(span_rule_validation.clone())
+        .exit(span_rule_validation.clone())
+        .drop_span(span_rule_validation.clone())
+        .new_span(span_validate_input_values.clone())
+        .enter(span_validate_input_values.clone())
+        .exit(span_validate_input_values.clone())
+        .drop_span(span_validate_input_values.clone())
+        .new_span(span_execute_sync.clone())
+        .enter(span_execute_sync.clone())
+        .exit(span_execute_sync.clone())
+        .drop_span(span_execute_sync.clone())
+        .done()
+        .run_with_handle();
+
+    tracing::subscriber::with_default(subscriber, || {
+        juniper::execute_sync(doc, None, &schema, &Variables::new(), &database).ok();
+    });
+
+    handle.assert_finished();
+}
+
+#[test]
+fn test_trace_execute_with_error() {
+    let doc = r#"
+        {
+            super_hero {
+                name
+            }
+        }"#;
+    let database = Database::new();
+    let schema = RootNode::new(
+        Query,
+        EmptyMutation::<Database>::new(),
+        EmptySubscription::<Database>::new(),
+    );
+
+    let span_rule_validation = span("rule_validation");
+
+    let (subscriber, handle) = subscriber::expect()
+        .new_span(span_rule_validation.clone())
+        .enter(span_rule_validation.clone())
+        .event(event().with_target("juniper"))
+        .exit(span_rule_validation.clone())
+        .drop_span(span_rule_validation.clone())
+        .done()
+        .run_with_handle();
+
+    tracing::subscriber::with_default(subscriber, || {
+        juniper::execute_sync(doc, None, &schema, &Variables::new(), &database).err();
+    });
+
+    handle.assert_finished();
+}

From 4000f1e82e37aa47b0db1209bdfb8608a6692157 Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Wed, 29 Jul 2020 21:27:04 +0100
Subject: [PATCH 33/45] Tracing unit tests names

---
 juniper/src/tests/trace_tests.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/juniper/src/tests/trace_tests.rs b/juniper/src/tests/trace_tests.rs
index 957b72f22..bca0ff08d 100644
--- a/juniper/src/tests/trace_tests.rs
+++ b/juniper/src/tests/trace_tests.rs
@@ -12,7 +12,7 @@ use crate::{
 // TODO: tracing feature needs to be enable when testing
 // cargo test --features tracing
 #[test]
-fn test_trace_execute_clean() {
+fn test_execute_sync_clean() {
     let doc = r#"
         {
             hero {
@@ -54,7 +54,7 @@ fn test_trace_execute_clean() {
 }
 
 #[test]
-fn test_trace_execute_with_error() {
+fn test_execute_sync_with_error() {
     let doc = r#"
         {
             super_hero {

From e968c4b21ecd22288a6b838372cd1bb5e475b346 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Wed, 29 Jul 2020 13:51:02 -1000
Subject: [PATCH 34/45] Revert "Rocket can now compile on stable"

This reverts commit 753c80fd9bf618b8297fbb4e27194f2429d4803d.
---
 juniper_rocket/Makefile.toml | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 juniper_rocket/Makefile.toml

diff --git a/juniper_rocket/Makefile.toml b/juniper_rocket/Makefile.toml
new file mode 100644
index 000000000..8695d6a67
--- /dev/null
+++ b/juniper_rocket/Makefile.toml
@@ -0,0 +1,17 @@
+[tasks.build-verbose]
+condition = { channels = ["nightly"] }
+
+[tasks.build-verbose.windows]
+condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } }
+
+[tasks.test-verbose]
+condition = { channels = ["nightly"] }
+
+[tasks.test-verbose.windows]
+condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } }
+
+[tasks.ci-coverage-flow]
+condition = { channels = ["nightly"] }
+
+[tasks.ci-coverage-flow.windows]
+disabled = true
\ No newline at end of file

From 58fed76d8046c32dd5df19acfbadb4c0e955a3be Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Thu, 13 Aug 2020 21:55:05 -1000
Subject: [PATCH 35/45] Fix tracing spans

---
 juniper/src/lib.rs            | 15 +++++++++++++--
 juniper/src/macros/tracing.rs | 17 +++++++----------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index cd37858c6..5239f1aeb 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -106,6 +106,11 @@ pub use {async_trait::async_trait, futures, serde, static_assertions as sa};
 #[doc(inline)]
 pub use futures::future::{BoxFuture, LocalBoxFuture};
 
+// This is required by the `tracing` feature.
+#[cfg(feature = "tracing")]
+#[doc(hidden)]
+pub use tracing;
+
 // Depend on juniper_codegen and re-export everything in it.
 // This allows users to just depend on juniper and get the derive
 // functionality automatically.
@@ -228,6 +233,9 @@ where
     MutationT: GraphQLType<S, Context = QueryT::Context>,
     SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
 {
+    __juniper_span_trace!("execute_sync");
+
+    __juniper_trace!("GraphQLDocument: {}", document_source);
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
@@ -258,7 +266,7 @@ where
         }
     }
 
-    __juniper_span_trace!("execute_sync");
+    __juniper_span_trace!("execute_validated_query");
     execute_validated_query(&document, operation, root_node, variables, context)
 }
 
@@ -280,6 +288,9 @@ where
     SubscriptionT::TypeInfo: Sync,
     S: ScalarValue + Send + Sync,
 {
+    __juniper_span_trace!("execute");
+
+    __juniper_trace!("GraphQLDocument: {}", document_source);
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
@@ -314,7 +325,7 @@ where
         &document, operation, root_node, variables, context,
     );
 
-    __juniper_instrument_trace!(f, "execute").await
+    __juniper_instrument_trace!(f, "execute_validated_query").await
 }
 
 /// Resolve subscription into `ValuesStream`
diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
index bb97479d3..589b2cda1 100644
--- a/juniper/src/macros/tracing.rs
+++ b/juniper/src/macros/tracing.rs
@@ -29,22 +29,20 @@ macro_rules! __juniper_instrument_trace {
 #[doc(hidden)]
 #[macro_export]
 macro_rules! __juniper_span_internal {
-    ($trace_type:ident; $($element:expr),*) => {{
-        #[cfg(feature = "tracing")]
-        use tracing;
+    ($trace_type:ident; $($element:expr),*) => {
         #[cfg(feature = "tracing")]
-        let myspan = tracing::span!(tracing::Level::$trace_type, ($($element),*));
+        let myspan = $crate::tracing::span!($crate::tracing::Level::$trace_type, ($($element),*));
         #[cfg(feature = "tracing")]
         let _enter = myspan.enter();
-    }};
+    };
 }
 
 #[doc(hidden)]
 #[macro_export]
 macro_rules! __juniper_span_trace {
-    ($($element:expr),*) => {{
-        $crate::__juniper_span_internal!(TRACE; $($element),*)
-    }}
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(TRACE; $($element),*);
+    }
 }
 
 // Macros to instrument events.
@@ -55,8 +53,7 @@ macro_rules! __juniper_trace_internal {
     ($trace_type:ident; $($element:expr),*) => {{
         #[cfg(feature = "tracing")]
         {
-            use tracing;
-            tracing::$trace_type!($($element),*);
+            $crate::tracing::$trace_type!($($element),*);
         }
     }};
 }

From 7b5ad7e85d72f07942222a7b51a2a62def3823df Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Thu, 13 Aug 2020 22:25:22 -1000
Subject: [PATCH 36/45] Do not include trailing newline on the last error

---
 juniper/src/lib.rs | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 5239f1aeb..0d9cc2c45 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -203,9 +203,12 @@ impl<'a> fmt::Display for GraphQLError<'a> {
         match self {
             GraphQLError::ParseError(error) => write!(f, "{}", error),
             GraphQLError::ValidationError(errors) => {
-                for error in errors {
-                    writeln!(f, "{}", error)?;
-                }
+                let errors = errors
+                    .iter()
+                    .map(|e| format!("{}", e))
+                    .collect::<Vec<_>>()
+                    .join("\n");
+                write!(f, "{}", errors)?;
                 Ok(())
             }
             GraphQLError::NoOperationProvided => write!(f, "No operation provided"),

From c34a1c234400448fdb0174efa698dddb4ad017b8 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Thu, 13 Aug 2020 22:31:05 -1000
Subject: [PATCH 37/45] Standard tracing labels on snake_case

---
 juniper/src/lib.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 0d9cc2c45..54a45d386 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -238,7 +238,7 @@ where
 {
     __juniper_span_trace!("execute_sync");
 
-    __juniper_trace!("GraphQLDocument: {}", document_source);
+    __juniper_trace!("document: {}", document_source);
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
@@ -249,7 +249,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {}", gql_error);
 
             return Err(gql_error);
         }
@@ -263,7 +263,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {}", gql_error);
 
             return Err(gql_error);
         }
@@ -293,7 +293,7 @@ where
 {
     __juniper_span_trace!("execute");
 
-    __juniper_trace!("GraphQLDocument: {}", document_source);
+    __juniper_trace!("document: {}", document_source);
     let document = parse_document_source(document_source, &root_node.schema)?;
 
     {
@@ -304,7 +304,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {}", gql_error);
 
             return Err(gql_error);
         }
@@ -318,7 +318,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {}", gql_error);
 
             return Err(gql_error);
         }

From 26407e2aeeae07c73f1f7fd025b8e101b2975c87 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Thu, 13 Aug 2020 22:31:37 -1000
Subject: [PATCH 38/45] Add a validation error case to the tracing example

---
 examples/tracing_support/src/main.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/tracing_support/src/main.rs b/examples/tracing_support/src/main.rs
index 11dc4e326..502c47ba5 100644
--- a/examples/tracing_support/src/main.rs
+++ b/examples/tracing_support/src/main.rs
@@ -115,6 +115,7 @@ async fn main() {
         .unwrap();
 
     // You can also trace sync execution.
-    let query = "{ bob { name } }";
-    let (_, _errors) = juniper::execute_sync(query, None, &root, &vars, &ctx).unwrap();
+    // This should output a validation error in the middle of other spans.
+    let query = "{ bob { field_that_does_not_exist } }";
+    let _ = juniper::execute_sync(query, None, &root, &vars, &ctx);
 }

From 94279d171c370ce2d13025d7213e744312cbf368 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Fri, 14 Aug 2020 21:55:18 -1000
Subject: [PATCH 39/45] Use $crate everywhere

---
 juniper/src/macros/tracing.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
index 589b2cda1..a77eab9b7 100644
--- a/juniper/src/macros/tracing.rs
+++ b/juniper/src/macros/tracing.rs
@@ -6,8 +6,7 @@ macro_rules! __juniper_instrument_internal {
     ($trace_type:ident; $fut:expr, $($element:expr),*) => {{
         #[cfg(feature = "tracing")]
         {
-            use tracing;
-            tracing::Instrument::instrument($fut, tracing::$trace_type!($($element),*))
+            $crate::tracing::Instrument::instrument($fut, tracing::$trace_type!($($element),*))
         }
         #[cfg(not(feature = "tracing"))]
         {

From bf35077e46db530db6d4aaf138305f07886b6aaa Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian.legnitto@robinhood.com>
Date: Fri, 14 Aug 2020 21:55:36 -1000
Subject: [PATCH 40/45] Add other levels to span macros

---
 juniper/src/macros/tracing.rs | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/juniper/src/macros/tracing.rs b/juniper/src/macros/tracing.rs
index a77eab9b7..05882e398 100644
--- a/juniper/src/macros/tracing.rs
+++ b/juniper/src/macros/tracing.rs
@@ -44,6 +44,38 @@ macro_rules! __juniper_span_trace {
     }
 }
 
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace_debug {
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(DEBUG; $($element),*);
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace_info {
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(INFO; $($element),*);
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace_warn {
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(WARN; $($element),*);
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __juniper_span_trace_error {
+    ($($element:expr),*) => {
+        $crate::__juniper_span_internal!(ERROR; $($element),*);
+    }
+}
+
 // Macros to instrument events.
 
 #[doc(hidden)]

From 23650161e0b6e74776685072ab9826a9ee844034 Mon Sep 17 00:00:00 2001
From: Mihai Dinculescu <mihai.dinculescu@outlook.com>
Date: Sat, 3 Oct 2020 14:13:21 +0100
Subject: [PATCH 41/45] Use the released tracing crate

---
 docs/book/tests/Cargo.toml          | 4 ++--
 examples/tracing_support/Cargo.toml | 4 ++--
 juniper/Cargo.toml                  | 2 +-
 juniper/src/tests/trace_tests.rs    | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml
index 52ef407f6..cd6bd6526 100644
--- a/docs/book/tests/Cargo.toml
+++ b/docs/book/tests/Cargo.toml
@@ -20,8 +20,8 @@ serde_json = "1.0"
 tokio = { version = "0.2", features = ["blocking", "macros", "rt-core", "rt-util", "stream"] }
 uuid = "0.8"
 
-tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
-tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
+tracing = "0.1.21"
+tracing-subscriber = "0.2.12"
 
 [build-dependencies]
 skeptic = "0.13"
diff --git a/examples/tracing_support/Cargo.toml b/examples/tracing_support/Cargo.toml
index d8d314685..c7c8aa0ed 100644
--- a/examples/tracing_support/Cargo.toml
+++ b/examples/tracing_support/Cargo.toml
@@ -6,8 +6,8 @@ edition = "2018"
 publish = false
 
 [dependencies]
-tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing" }
-tracing-subscriber = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing"}
+tracing = "0.1.21"
+tracing-subscriber = "0.2.12"
 # Note instead of a path you would use the proper Juniper version in your own
 # project.
 juniper = { path = "../../juniper", features = ["tracing"] }
diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml
index b52b2b2a9..96fcbca73 100644
--- a/juniper/Cargo.toml
+++ b/juniper/Cargo.toml
@@ -50,7 +50,7 @@ static_assertions = "1.1"
 url = { version = "2.0", optional = true }
 uuid = { version = "0.8", default-features = false, optional = true }
 
-tracing = { git = "https://github.com/tokio-rs/tracing.git", branch = "davidbarsky/add-instrument-trait-to-tracing", optional = true }
+tracing = { version = "0.1.21", optional = true }
 
 [dev-dependencies]
 bencher = "0.1.2"
diff --git a/juniper/src/tests/trace_tests.rs b/juniper/src/tests/trace_tests.rs
index bca0ff08d..89d53add8 100644
--- a/juniper/src/tests/trace_tests.rs
+++ b/juniper/src/tests/trace_tests.rs
@@ -8,7 +8,7 @@ use crate::{
 };
 
 // TODO: waiting for https://github.com/tokio-rs/tracing/pull/793
-// TODO: async tests waiting for https://github.com/tokio-rs/tracing/pull/808
+// TODO: async tests
 // TODO: tracing feature needs to be enable when testing
 // cargo test --features tracing
 #[test]

From ca744b58df76dd3901f150a942503d65af95d943 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian@legnitto.com>
Date: Wed, 28 Oct 2020 19:54:40 -0700
Subject: [PATCH 42/45] Fix email address

---
 examples/tracing_support/Cargo.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/tracing_support/Cargo.toml b/examples/tracing_support/Cargo.toml
index c7c8aa0ed..408536fdb 100644
--- a/examples/tracing_support/Cargo.toml
+++ b/examples/tracing_support/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 name = "tracing_support"
 version = "0.1.0"
-authors = ["Christian Legnitto <christian.legnitto@robinhood.com>"]
+authors = ["Christian Legnitto <christian@legnitto.com>"]
 edition = "2018"
 publish = false
 

From 62acd3f66b5e7e500307a9b00a84383d81a2cb2f Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian@legnitto.com>
Date: Wed, 28 Oct 2020 19:56:49 -0700
Subject: [PATCH 43/45] Standardize on snake case for tracing

---
 juniper/src/lib.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs
index 54a45d386..148795e10 100644
--- a/juniper/src/lib.rs
+++ b/juniper/src/lib.rs
@@ -359,7 +359,7 @@ where
         let errors = ctx.into_errors();
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {:?}", gql_error);
 
             return Err(gql_error);
         }
@@ -372,7 +372,7 @@ where
 
         if !errors.is_empty() {
             let gql_error = GraphQLError::ValidationError(errors);
-            __juniper_trace!("GraphQLError: {:?}", gql_error);
+            __juniper_trace!("validation_error: {:?}", gql_error);
 
             return Err(gql_error);
         }

From 72a28d4ebd0b0c4974ba2085fd87304ab11729c0 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian@legnitto.com>
Date: Wed, 28 Oct 2020 20:24:50 -0700
Subject: [PATCH 44/45] Remove rustfmt option causing breakage

---
 rustfmt.toml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/rustfmt.toml b/rustfmt.toml
index 8586c40cb..8a1751f67 100644
--- a/rustfmt.toml
+++ b/rustfmt.toml
@@ -1,2 +1 @@
-merge_imports = true
 use_field_init_shorthand = true

From 2977b1f375968e4cb0eabf4b36912906cefc1c07 Mon Sep 17 00:00:00 2001
From: Christian Legnitto <christian@legnitto.com>
Date: Wed, 28 Oct 2020 20:25:12 -0700
Subject: [PATCH 45/45] Remove subscription helper mod

---
 juniper/src/macros/mod.rs | 2 --
 1 file changed, 2 deletions(-)

diff --git a/juniper/src/macros/mod.rs b/juniper/src/macros/mod.rs
index c052a5eb2..ff6dd3d8a 100644
--- a/juniper/src/macros/mod.rs
+++ b/juniper/src/macros/mod.rs
@@ -5,6 +5,4 @@ pub mod helper;
 #[cfg(test)]
 mod tests;
 
-pub mod subscription_helpers;
-
 mod tracing;