diff --git a/auth/src/main.rs b/auth/src/main.rs index 48c7688f6..83f1f5de1 100644 --- a/auth/src/main.rs +++ b/auth/src/main.rs @@ -1,7 +1,7 @@ use std::io; use clap::Parser; -use shuttle_common::{backends::tracing::setup_tracing, claims::AccountTier, log::Backend}; +use shuttle_common::{backends::trace::setup_tracing, claims::AccountTier, log::Backend}; use sqlx::migrate::Migrator; use tracing::trace; diff --git a/builder/src/main.rs b/builder/src/main.rs index 3e5da8b4f..a96517f36 100644 --- a/builder/src/main.rs +++ b/builder/src/main.rs @@ -5,7 +5,7 @@ use shuttle_builder::{args::Args, Service}; use shuttle_common::{ backends::{ auth::{AuthPublicKey, JwtAuthenticationLayer}, - tracing::{setup_tracing, ExtractPropagationLayer}, + trace::{setup_tracing, ExtractPropagationLayer}, }, log::Backend, }; diff --git a/common/src/backends/client/gateway.rs b/common/src/backends/client/gateway.rs index 51e66a519..79809a906 100644 --- a/common/src/backends/client/gateway.rs +++ b/common/src/backends/client/gateway.rs @@ -1,5 +1,6 @@ use headers::Authorization; use http::{Method, Uri}; +use tracing::instrument; use crate::models; @@ -55,6 +56,7 @@ pub trait ProjectsDal { } impl ProjectsDal for Client { + #[instrument(skip_all)] async fn get_user_projects( &self, user_token: &str, diff --git a/common/src/backends/client/resource_recorder.rs b/common/src/backends/client/resource_recorder.rs index c34722fe4..06eaac5ac 100644 --- a/common/src/backends/client/resource_recorder.rs +++ b/common/src/backends/client/resource_recorder.rs @@ -1,4 +1,5 @@ use async_trait::async_trait; +use tracing::instrument; use crate::{database, resource}; @@ -41,6 +42,7 @@ impl ResourceDal for &mut T where T: ResourceDal, { + #[instrument(skip_all, fields(shuttle.project_id = project_id))] async fn get_project_resources( &mut self, project_id: &str, diff --git a/common/src/backends/mod.rs b/common/src/backends/mod.rs index 66a2fd634..9fbfd712f 100644 --- a/common/src/backends/mod.rs +++ b/common/src/backends/mod.rs @@ -1,3 +1,5 @@ +use tracing::instrument; + use crate::claims::{Claim, Scope}; use self::client::{ProjectsDal, ResourceDal}; @@ -9,7 +11,7 @@ mod future; pub mod headers; pub mod metrics; mod otlp_tracing_bridge; -pub mod tracing; +pub mod trace; #[allow(async_fn_in_trait)] pub trait ClaimExt { @@ -34,6 +36,7 @@ impl ClaimExt for Claim { self.is_admin() || self.limits.project_limit() > current_count } + #[instrument(skip_all)] async fn can_provision_rds( &self, projects_dal: &G, diff --git a/common/src/backends/tracing.rs b/common/src/backends/trace.rs similarity index 100% rename from common/src/backends/tracing.rs rename to common/src/backends/trace.rs diff --git a/deployer/src/main.rs b/deployer/src/main.rs index b682eea8a..543b47bf2 100644 --- a/deployer/src/main.rs +++ b/deployer/src/main.rs @@ -2,7 +2,7 @@ use std::process::exit; use clap::Parser; use shuttle_common::{ - backends::tracing::setup_tracing, + backends::trace::setup_tracing, claims::{ClaimLayer, InjectPropagationLayer}, log::{Backend, DeploymentLogLayer}, }; diff --git a/gateway/src/main.rs b/gateway/src/main.rs index af239d7ea..126e79722 100644 --- a/gateway/src/main.rs +++ b/gateway/src/main.rs @@ -2,7 +2,7 @@ use async_posthog::ClientOptions; use clap::Parser; use futures::prelude::*; -use shuttle_common::backends::tracing::setup_tracing; +use shuttle_common::backends::trace::setup_tracing; use shuttle_common::log::Backend; use shuttle_gateway::acme::{AcmeClient, CustomDomain}; use shuttle_gateway::api::latest::{ApiBuilder, SVC_DEGRADED_THRESHOLD}; diff --git a/logger/src/main.rs b/logger/src/main.rs index 1ae2a876b..6a3d499b3 100644 --- a/logger/src/main.rs +++ b/logger/src/main.rs @@ -4,7 +4,7 @@ use clap::Parser; use shuttle_common::{ backends::{ auth::{AuthPublicKey, JwtAuthenticationLayer}, - tracing::{setup_tracing, ExtractPropagationLayer}, + trace::{setup_tracing, ExtractPropagationLayer}, }, log::Backend, }; diff --git a/provisioner/src/main.rs b/provisioner/src/main.rs index a2f541012..8432f7658 100644 --- a/provisioner/src/main.rs +++ b/provisioner/src/main.rs @@ -4,7 +4,7 @@ use clap::Parser; use shuttle_common::{ backends::{ auth::{AuthPublicKey, JwtAuthenticationLayer}, - tracing::{setup_tracing, ExtractPropagationLayer}, + trace::{setup_tracing, ExtractPropagationLayer}, }, log::Backend, }; diff --git a/resource-recorder/src/main.rs b/resource-recorder/src/main.rs index 0814dd749..02d7dcf9e 100644 --- a/resource-recorder/src/main.rs +++ b/resource-recorder/src/main.rs @@ -4,7 +4,7 @@ use clap::Parser; use shuttle_common::{ backends::{ auth::{AuthPublicKey, JwtAuthenticationLayer}, - tracing::{setup_tracing, ExtractPropagationLayer}, + trace::{setup_tracing, ExtractPropagationLayer}, }, log::Backend, }; diff --git a/runtime/src/alpha/mod.rs b/runtime/src/alpha/mod.rs index 0b6d294d4..70df821bd 100644 --- a/runtime/src/alpha/mod.rs +++ b/runtime/src/alpha/mod.rs @@ -14,7 +14,7 @@ use core::future::Future; use shuttle_common::{ backends::{ auth::{AuthPublicKey, JwtAuthenticationLayer}, - tracing::ExtractPropagationLayer, + trace::ExtractPropagationLayer, }, claims::{Claim, ClaimLayer, InjectPropagationLayer}, resource, diff --git a/runtime/src/bin/shuttle-next.rs b/runtime/src/bin/shuttle-next.rs index 33f3a7a7d..05026dbab 100644 --- a/runtime/src/bin/shuttle-next.rs +++ b/runtime/src/bin/shuttle-next.rs @@ -3,7 +3,7 @@ use std::{ time::Duration, }; -use shuttle_common::backends::tracing::ExtractPropagationLayer; +use shuttle_common::backends::trace::ExtractPropagationLayer; use shuttle_proto::runtime::runtime_server::RuntimeServer; use shuttle_runtime::__internals::{print_version, AxumWasm, NextArgs}; use tonic::transport::Server;