From 80d55d0829fbc82619ed511ed37af92571998d6b Mon Sep 17 00:00:00 2001 From: Jacob Marble Date: Fri, 2 Apr 2021 13:14:30 -0700 Subject: [PATCH] chore: rename tracing_deps to observability_deps OpenTelemetry makes this necessary. --- Cargo.lock | 62 +++++++++---------- Cargo.toml | 4 +- data_types/Cargo.toml | 2 +- data_types/src/error.rs | 2 +- generated_types/Cargo.toml | 2 +- generated_types/src/google.rs | 2 +- influxdb_line_protocol/Cargo.toml | 2 +- influxdb_line_protocol/src/lib.rs | 2 +- influxdb_tsm/Cargo.toml | 2 +- influxdb_tsm/src/mapper.rs | 2 +- ingest/Cargo.toml | 2 +- ingest/src/lib.rs | 2 +- ingest/src/parquet/stats.rs | 2 +- ingest/src/parquet/writer.rs | 2 +- internal_types/Cargo.toml | 2 +- internal_types/src/schema/builder.rs | 2 +- logfmt/Cargo.toml | 2 +- logfmt/src/lib.rs | 10 +-- logfmt/tests/logging.rs | 4 +- mem_qe/Cargo.toml | 2 +- mem_qe/src/bin/main.rs | 4 +- mem_qe/src/column.rs | 2 +- mem_qe/src/segment.rs | 2 +- mem_qe/src/sorter.rs | 2 +- mutable_buffer/Cargo.toml | 2 +- .../Cargo.toml | 5 +- .../src/lib.rs | 5 +- packers/Cargo.toml | 2 +- panic_logging/Cargo.toml | 2 +- panic_logging/src/lib.rs | 2 +- query/Cargo.toml | 2 +- query/src/exec/context.rs | 2 +- query/src/frontend/influxrpc.rs | 2 +- server/Cargo.toml | 2 +- server/src/buffer.rs | 2 +- server/src/config.rs | 2 +- server/src/db.rs | 2 +- server/src/db/chunk.rs | 2 +- server/src/db/lifecycle.rs | 2 +- server/src/lib.rs | 2 +- server/src/snapshot.rs | 2 +- server/src/tracker.rs | 2 +- server/src/tracker/history.rs | 2 +- server/src/tracker/registry.rs | 2 +- src/commands/convert.rs | 2 +- src/commands/logging.rs | 2 +- src/commands/meta.rs | 2 +- src/commands/metrics.rs | 4 +- src/commands/stats.rs | 2 +- src/influxdb_ioxd.rs | 2 +- src/influxdb_ioxd/http.rs | 4 +- src/influxdb_ioxd/rpc/error.rs | 2 +- src/influxdb_ioxd/rpc/flight.rs | 2 +- src/influxdb_ioxd/rpc/operations.rs | 2 +- src/influxdb_ioxd/rpc/storage/expr.rs | 2 +- src/influxdb_ioxd/rpc/storage/service.rs | 2 +- src/influxdb_ioxd/rpc/testing.rs | 2 +- src/influxdb_ioxd/rpc/write.rs | 2 +- src/main.rs | 2 +- test_helpers/Cargo.toml | 2 +- test_helpers/src/lib.rs | 2 +- test_helpers/src/tracing.rs | 4 +- wal/Cargo.toml | 2 +- wal/src/writer.rs | 2 +- 64 files changed, 107 insertions(+), 107 deletions(-) rename {tracing_deps => observability_deps}/Cargo.toml (74%) rename {tracing_deps => observability_deps}/src/lib.rs (65%) diff --git a/Cargo.lock b/Cargo.lock index 0bb3115454..1fc9b15332 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -773,6 +773,7 @@ dependencies = [ "chrono", "generated_types", "influxdb_line_protocol", + "observability_deps", "percent-encoding", "prost", "regex", @@ -781,7 +782,6 @@ dependencies = [ "snafu", "test_helpers", "tonic", - "tracing_deps", ] [[package]] @@ -1152,6 +1152,7 @@ dependencies = [ "flatbuffers", "futures", "google_types", + "observability_deps", "prost", "prost-build", "prost-types", @@ -1159,7 +1160,6 @@ dependencies = [ "serde_json", "tonic", "tonic-build", - "tracing_deps", ] [[package]] @@ -1461,6 +1461,7 @@ dependencies = [ "mem_qe", "mutable_buffer", "object_store", + "observability_deps", "once_cell", "packers", "panic_logging", @@ -1487,7 +1488,6 @@ dependencies = [ "tokio-util", "tonic", "tonic-health", - "tracing_deps", "wal", ] @@ -1515,10 +1515,10 @@ version = "0.1.0" dependencies = [ "influxdb2_client", "nom", + "observability_deps", "smallvec", "snafu", "test_helpers", - "tracing_deps", ] [[package]] @@ -1528,11 +1528,11 @@ dependencies = [ "flate2", "hex", "integer-encoding", + "observability_deps", "rand 0.8.3", "snafu", "snap", "test_helpers", - "tracing_deps", ] [[package]] @@ -1544,11 +1544,11 @@ dependencies = [ "influxdb_line_protocol", "influxdb_tsm", "internal_types", + "observability_deps", "packers", "parking_lot", "snafu", "test_helpers", - "tracing_deps", ] [[package]] @@ -1578,9 +1578,9 @@ dependencies = [ "flatbuffers", "generated_types", "influxdb_line_protocol", + "observability_deps", "ouroboros", "snafu", - "tracing_deps", ] [[package]] @@ -1720,10 +1720,10 @@ dependencies = [ name = "logfmt" version = "0.1.0" dependencies = [ + "observability_deps", "once_cell", "parking_lot", "regex", - "tracing_deps", ] [[package]] @@ -1777,9 +1777,9 @@ dependencies = [ "croaring", "crossbeam", "human_format", + "observability_deps", "packers", "snafu", - "tracing_deps", ] [[package]] @@ -1871,11 +1871,11 @@ dependencies = [ "generated_types", "influxdb_line_protocol", "internal_types", + "observability_deps", "snafu", "string-interner", "test_helpers", "tokio", - "tracing_deps", ] [[package]] @@ -2070,6 +2070,21 @@ dependencies = [ "walkdir", ] +[[package]] +name = "observability_deps" +version = "0.1.0" +dependencies = [ + "env_logger", + "opentelemetry", + "opentelemetry-jaeger", + "opentelemetry-prometheus", + "prometheus", + "tracing", + "tracing-futures", + "tracing-opentelemetry", + "tracing-subscriber", +] + [[package]] name = "once_cell" version = "1.7.2" @@ -2228,17 +2243,17 @@ dependencies = [ "human_format", "influxdb_tsm", "internal_types", + "observability_deps", "rand 0.8.3", "snafu", "test_helpers", - "tracing_deps", ] [[package]] name = "panic_logging" version = "0.1.0" dependencies = [ - "tracing_deps", + "observability_deps", ] [[package]] @@ -2615,13 +2630,13 @@ dependencies = [ "futures", "influxdb_line_protocol", "internal_types", + "observability_deps", "parking_lot", "snafu", "sqlparser", "test_helpers", "tokio", "tokio-stream", - "tracing_deps", ] [[package]] @@ -3237,6 +3252,7 @@ dependencies = [ "internal_types", "mutable_buffer", "object_store", + "observability_deps", "parking_lot", "parquet_file", "pin-project 1.0.6", @@ -3249,7 +3265,6 @@ dependencies = [ "test_helpers", "tokio", "tokio-util", - "tracing_deps", "uuid", ] @@ -3555,9 +3570,9 @@ name = "test_helpers" version = "0.1.0" dependencies = [ "dotenv", + "observability_deps", "parking_lot", "tempfile", - "tracing_deps", ] [[package]] @@ -3958,21 +3973,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "tracing_deps" -version = "0.1.0" -dependencies = [ - "env_logger", - "opentelemetry", - "opentelemetry-jaeger", - "opentelemetry-prometheus", - "prometheus", - "tracing", - "tracing-futures", - "tracing-opentelemetry", - "tracing-subscriber", -] - [[package]] name = "treeline" version = "0.1.0" @@ -4091,6 +4091,7 @@ dependencies = [ "crc32fast", "futures", "itertools 0.9.0", + "observability_deps", "once_cell", "regex", "serde", @@ -4099,7 +4100,6 @@ dependencies = [ "snap", "test_helpers", "tokio", - "tracing_deps", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 46d5747ac9..a7d48536fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ members = [ "read_buffer", "server", "test_helpers", - "tracing_deps", + "observability_deps", "wal", ] @@ -57,7 +57,7 @@ panic_logging = { path = "panic_logging" } query = { path = "query" } read_buffer = { path = "read_buffer" } server = { path = "server" } -tracing_deps = { path = "tracing_deps" } +observability_deps = { path = "observability_deps" } wal = { path = "wal" } # Crates.io dependencies, in alphabetical order diff --git a/data_types/Cargo.toml b/data_types/Cargo.toml index 17e43b0f6f..3bc511915a 100644 --- a/data_types/Cargo.toml +++ b/data_types/Cargo.toml @@ -17,7 +17,7 @@ serde = { version = "1.0", features = ["rc"] } serde_regex = "1.1" snafu = "0.6" tonic = { version = "0.4.0" } -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order test_helpers = { path = "../test_helpers" } diff --git a/data_types/src/error.rs b/data_types/src/error.rs index 13e76841dd..2b51153cbe 100644 --- a/data_types/src/error.rs +++ b/data_types/src/error.rs @@ -1,7 +1,7 @@ //! Common error utilities use std::fmt::Debug; -use tracing_deps::tracing::error; +use observability_deps::tracing::error; /// Add ability for Results to log error messages via `error!` logs. /// This is useful when using async tasks that may not have a natural diff --git a/generated_types/Cargo.toml b/generated_types/Cargo.toml index 879a4835d7..a8ee50d03f 100644 --- a/generated_types/Cargo.toml +++ b/generated_types/Cargo.toml @@ -13,7 +13,7 @@ futures = "0.3.1" prost = "0.7" prost-types = "0.7" tonic = "0.4" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } google_types = { path = "../google_types" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.44" diff --git a/generated_types/src/google.rs b/generated_types/src/google.rs index 68ed26f2dd..debfbe9e4a 100644 --- a/generated_types/src/google.rs +++ b/generated_types/src/google.rs @@ -12,6 +12,7 @@ pub mod longrunning { } use self::protobuf::Any; +use observability_deps::tracing::error; use prost::{ bytes::{Bytes, BytesMut}, Message, @@ -19,7 +20,6 @@ use prost::{ use std::convert::{TryFrom, TryInto}; use std::iter::FromIterator; use tonic::Status; -use tracing_deps::tracing::error; // A newtype struct to provide conversion into tonic::Status struct EncodeError(prost::EncodeError); diff --git a/influxdb_line_protocol/Cargo.toml b/influxdb_line_protocol/Cargo.toml index 8ae300a018..8157b697a0 100644 --- a/influxdb_line_protocol/Cargo.toml +++ b/influxdb_line_protocol/Cargo.toml @@ -9,7 +9,7 @@ influxdb2_client = { path = "../influxdb2_client" } nom = "5.1.1" smallvec = "1.2.0" snafu = "0.6.2" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order test_helpers = { path = "../test_helpers" } diff --git a/influxdb_line_protocol/src/lib.rs b/influxdb_line_protocol/src/lib.rs index 7eca28c68a..992b78bbd6 100644 --- a/influxdb_line_protocol/src/lib.rs +++ b/influxdb_line_protocol/src/lib.rs @@ -25,6 +25,7 @@ use nom::{ multi::many0, sequence::{preceded, separated_pair, terminated, tuple}, }; +use observability_deps::tracing::debug; use smallvec::SmallVec; use snafu::{ResultExt, Snafu}; use std::cmp::Ordering; @@ -35,7 +36,6 @@ use std::{ fmt, ops::Deref, }; -use tracing_deps::tracing::debug; #[derive(Debug, Snafu)] pub enum Error { diff --git a/influxdb_tsm/Cargo.toml b/influxdb_tsm/Cargo.toml index a73901b59f..586ed46cdf 100644 --- a/influxdb_tsm/Cargo.toml +++ b/influxdb_tsm/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" integer-encoding = "1.0.7" snafu = "0.6.2" snap = "1.0.0" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order flate2 = "1.0" diff --git a/influxdb_tsm/src/mapper.rs b/influxdb_tsm/src/mapper.rs index f9bc0d1793..b7c495c6c8 100644 --- a/influxdb_tsm/src/mapper.rs +++ b/influxdb_tsm/src/mapper.rs @@ -3,7 +3,7 @@ use crate::reader::{BlockData, BlockDecoder, TSMIndexReader, ValuePair}; use crate::{Block, BlockType, TSMError}; -use tracing_deps::tracing::warn; +use observability_deps::tracing::warn; use std::collections::{BTreeMap, BTreeSet}; use std::fmt::{Display, Formatter}; diff --git a/ingest/Cargo.toml b/ingest/Cargo.toml index d7186a6956..1af29ba6c0 100644 --- a/ingest/Cargo.toml +++ b/ingest/Cargo.toml @@ -11,7 +11,7 @@ influxdb_tsm = { path = "../influxdb_tsm" } internal_types = { path = "../internal_types" } packers = { path = "../packers" } snafu = "0.6.2" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order flate2 = "1.0" diff --git a/ingest/src/lib.rs b/ingest/src/lib.rs index 1f53072fad..9f5d996cfb 100644 --- a/ingest/src/lib.rs +++ b/ingest/src/lib.rs @@ -20,6 +20,7 @@ use influxdb_tsm::{ use internal_types::schema::{ builder::InfluxSchemaBuilder, InfluxFieldType, Schema, TIME_COLUMN_NAME, }; +use observability_deps::tracing::debug; use packers::{ ByteArray, Error as TableError, IOxTableWriter, IOxTableWriterSource, Packer, Packers, }; @@ -28,7 +29,6 @@ use std::{ collections::{BTreeMap, BTreeSet}, io::{Read, Seek}, }; -use tracing_deps::tracing::debug; pub mod parquet; diff --git a/ingest/src/parquet/stats.rs b/ingest/src/parquet/stats.rs index 61cd155bc1..904747bdf6 100644 --- a/ingest/src/parquet/stats.rs +++ b/ingest/src/parquet/stats.rs @@ -3,13 +3,13 @@ use arrow_deps::parquet::{ basic::{Compression, Encoding}, file::reader::{FileReader, SerializedFileReader}, }; +use observability_deps::tracing::debug; use packers::{ stats::{ColumnStatsBuilder, FileStats, FileStatsBuilder}, Name, }; use snafu::ResultExt; use std::{collections::BTreeMap, convert::TryInto}; -use tracing_deps::tracing::debug; use super::{ error::{ParquetLibraryError, Result}, diff --git a/ingest/src/parquet/writer.rs b/ingest/src/parquet/writer.rs index 39a80c01a0..9cdc565d6b 100644 --- a/ingest/src/parquet/writer.rs +++ b/ingest/src/parquet/writer.rs @@ -13,6 +13,7 @@ use arrow_deps::parquet::{ schema::types::{ColumnPath, Type}, }; use internal_types::schema::{InfluxColumnType, InfluxFieldType, Schema}; +use observability_deps::tracing::{debug, log::warn}; use parquet::file::writer::ParquetWriter; use snafu::{OptionExt, ResultExt, Snafu}; use std::{ @@ -21,7 +22,6 @@ use std::{ str::FromStr, sync::Arc, }; -use tracing_deps::tracing::{debug, log::warn}; use super::metadata::parquet_schema_as_string; use packers::{Error as TableError, IOxTableWriter, Packers}; diff --git a/internal_types/Cargo.toml b/internal_types/Cargo.toml index fdc20692e3..e98e27580a 100644 --- a/internal_types/Cargo.toml +++ b/internal_types/Cargo.toml @@ -18,7 +18,7 @@ generated_types = { path = "../generated_types" } influxdb_line_protocol = { path = "../influxdb_line_protocol" } ouroboros = "0.8.3" snafu = "0.6" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order criterion = "0.3" diff --git a/internal_types/src/schema/builder.rs b/internal_types/src/schema/builder.rs index 4d045d23ee..a244f2b9f1 100644 --- a/internal_types/src/schema/builder.rs +++ b/internal_types/src/schema/builder.rs @@ -1,9 +1,9 @@ +use observability_deps::tracing::warn; use snafu::{OptionExt, ResultExt, Snafu}; use std::{ collections::{HashMap, HashSet}, convert::TryInto, }; -use tracing_deps::tracing::warn; use arrow_deps::arrow::datatypes::{DataType as ArrowDataType, Field as ArrowField}; diff --git a/logfmt/Cargo.toml b/logfmt/Cargo.toml index f2ea85bb3c..5112922b7c 100644 --- a/logfmt/Cargo.toml +++ b/logfmt/Cargo.toml @@ -6,7 +6,7 @@ description="tracing_subscriber layer for writing out logfmt formatted events" edition = "2018" [dependencies] # In alphabetical order -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order once_cell = { version = "1.4.0", features = ["parking_lot"] } diff --git a/logfmt/src/lib.rs b/logfmt/src/lib.rs index 52df6da3a1..cda244768f 100644 --- a/logfmt/src/lib.rs +++ b/logfmt/src/lib.rs @@ -1,14 +1,14 @@ -use std::borrow::Cow; -use std::{io::Write, time::SystemTime}; -use tracing_deps::tracing::{ +use observability_deps::tracing::{ self, field::{Field, Visit}, subscriber::Interest, Id, Level, Subscriber, }; -use tracing_deps::tracing_subscriber::{ +use observability_deps::tracing_subscriber::{ fmt::MakeWriter, layer::Context, registry::LookupSpan, Layer, }; +use std::borrow::Cow; +use std::{io::Write, time::SystemTime}; /// Implements a `tracing_subscriber::Layer` which generates /// [logfmt] formatted log entries, suitable for log ingestion @@ -33,7 +33,7 @@ impl LogFmtLayer { /// For example: /// ``` /// use logfmt::LogFmtLayer; - /// use tracing_deps::tracing_subscriber::{EnvFilter, prelude::*, self}; + /// use observability_deps::tracing_subscriber::{EnvFilter, prelude::*, self}; /// /// // setup debug logging level /// std::env::set_var("RUST_LOG", "debug"); diff --git a/logfmt/tests/logging.rs b/logfmt/tests/logging.rs index dc22bad472..f549d5d672 100644 --- a/logfmt/tests/logging.rs +++ b/logfmt/tests/logging.rs @@ -3,6 +3,8 @@ // that.... So punting on that for now use logfmt::LogFmtLayer; +use observability_deps::tracing::{debug, error, info, span, trace, warn, Level}; +use observability_deps::tracing_subscriber::{self, fmt::MakeWriter, prelude::*}; use once_cell::sync::Lazy; use parking_lot::Mutex; use regex::Regex; @@ -11,8 +13,6 @@ use std::{ fmt, io::{self, Cursor}, }; -use tracing_deps::tracing::{debug, error, info, span, trace, warn, Level}; -use tracing_deps::tracing_subscriber::{self, fmt::MakeWriter, prelude::*}; /// Compares the captured messages with the expected messages, /// normalizing for time and location diff --git a/mem_qe/Cargo.toml b/mem_qe/Cargo.toml index 21197d0be3..133cf263ef 100644 --- a/mem_qe/Cargo.toml +++ b/mem_qe/Cargo.toml @@ -12,7 +12,7 @@ crossbeam = "0.8" human_format = "1.0.3" packers = { path = "../packers" } snafu = "0.6.8" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order criterion = "0.3" diff --git a/mem_qe/src/bin/main.rs b/mem_qe/src/bin/main.rs index e62e0aa3e0..253d562425 100644 --- a/mem_qe/src/bin/main.rs +++ b/mem_qe/src/bin/main.rs @@ -8,8 +8,8 @@ use std::{ }; use datatypes::TimeUnit; +use observability_deps::tracing::debug; use snafu::Snafu; -use tracing_deps::tracing::debug; use arrow_deps::arrow::record_batch::{RecordBatch, RecordBatchReader}; use arrow_deps::arrow::{array, array::Array, datatypes, ipc}; @@ -27,7 +27,7 @@ fn format_size(sz: usize) -> String { } fn main() { - tracing_deps::env_logger::init(); + observability_deps::env_logger::init(); let args: Vec = env::args().collect(); let path = &args[1]; diff --git a/mem_qe/src/column.rs b/mem_qe/src/column.rs index 2687eac69e..55db1abe2c 100644 --- a/mem_qe/src/column.rs +++ b/mem_qe/src/column.rs @@ -5,7 +5,7 @@ use arrow_deps::arrow; use super::encoding; -use tracing_deps::tracing::debug; +use observability_deps::tracing::debug; #[derive(Debug)] pub enum Set<'a> { diff --git a/mem_qe/src/segment.rs b/mem_qe/src/segment.rs index d4585f74cc..0af9bae863 100644 --- a/mem_qe/src/segment.rs +++ b/mem_qe/src/segment.rs @@ -1,6 +1,6 @@ use std::collections::{BTreeMap, BTreeSet}; -use tracing_deps::tracing::{debug, error, info}; +use observability_deps::tracing::{debug, error, info}; use super::column; use super::column::{AggregateType, Column}; diff --git a/mem_qe/src/sorter.rs b/mem_qe/src/sorter.rs index 31b1aa35b0..ae52adde18 100644 --- a/mem_qe/src/sorter.rs +++ b/mem_qe/src/sorter.rs @@ -17,9 +17,9 @@ use std::cmp::Ordering; use std::collections::BTreeSet; use std::ops::Range; +use observability_deps::tracing::debug; use snafu::ensure; use snafu::Snafu; -use tracing_deps::tracing::debug; use super::column; diff --git a/mutable_buffer/Cargo.toml b/mutable_buffer/Cargo.toml index 1d1688147e..7f5a3faafe 100644 --- a/mutable_buffer/Cargo.toml +++ b/mutable_buffer/Cargo.toml @@ -26,7 +26,7 @@ influxdb_line_protocol = { path = "../influxdb_line_protocol" } snafu = "0.6.2" string-interner = "0.12.2" tokio = { version = "1.0", features = ["macros"] } -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order test_helpers = { path = "../test_helpers" } diff --git a/tracing_deps/Cargo.toml b/observability_deps/Cargo.toml similarity index 74% rename from tracing_deps/Cargo.toml rename to observability_deps/Cargo.toml index d12940d8f2..a852d0b6bf 100644 --- a/tracing_deps/Cargo.toml +++ b/observability_deps/Cargo.toml @@ -1,10 +1,9 @@ [package] -# TODO(jacobmarble): rename to something like "observability_deps" -name = "tracing_deps" +name = "observability_deps" version = "0.1.0" authors = ["Paul Dix "] edition = "2018" -description = "Tracing ecosystem dependencies for InfluxDB IOx, to ensure consistent versions and unified updates" +description = "Observability ecosystem dependencies for InfluxDB IOx, to ensure consistent versions and unified updates" [dependencies] # In alphabetical order env_logger = "0.8.3" diff --git a/tracing_deps/src/lib.rs b/observability_deps/src/lib.rs similarity index 65% rename from tracing_deps/src/lib.rs rename to observability_deps/src/lib.rs index 79df3ecdf9..dd3eba8956 100644 --- a/tracing_deps/src/lib.rs +++ b/observability_deps/src/lib.rs @@ -1,5 +1,6 @@ -//! This crate exists to coordinate versions of `tracing` and related -//! crates so that we can manage their updates in a single crate. +//! This crate exists to coordinate versions of `opentelemetry`, `tracing`, +//! `prometheus` and related crates so that we can manage their updates in a +//! single crate. // Export these crates publicly so we can have a single reference pub use env_logger; diff --git a/packers/Cargo.toml b/packers/Cargo.toml index 11e702b900..e163886046 100644 --- a/packers/Cargo.toml +++ b/packers/Cargo.toml @@ -10,7 +10,7 @@ human_format = "1.0.3" influxdb_tsm = { path = "../influxdb_tsm" } internal_types = { path = "../internal_types" } snafu = "0.6.2" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order rand = "0.8.3" diff --git a/panic_logging/Cargo.toml b/panic_logging/Cargo.toml index cbbc9f22e5..451ddbda33 100644 --- a/panic_logging/Cargo.toml +++ b/panic_logging/Cargo.toml @@ -5,4 +5,4 @@ authors = ["Paul Dix "] edition = "2018" [dependencies] # In alphabetical order -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } diff --git a/panic_logging/src/lib.rs b/panic_logging/src/lib.rs index d523a4c24c..614b4c16ca 100644 --- a/panic_logging/src/lib.rs +++ b/panic_logging/src/lib.rs @@ -11,8 +11,8 @@ use std::{fmt, panic, sync::Arc}; +use observability_deps::tracing::{error, warn}; use panic::PanicInfo; -use tracing_deps::tracing::{error, warn}; type PanicFunctionPtr = Arc) + Sync + Send + 'static>>; diff --git a/query/Cargo.toml b/query/Cargo.toml index f347dad5bd..2f1bb79862 100644 --- a/query/Cargo.toml +++ b/query/Cargo.toml @@ -27,7 +27,7 @@ snafu = "0.6.2" sqlparser = "0.8.0" tokio = { version = "1.0", features = ["macros"] } tokio-stream = "0.1.2" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order test_helpers = { path = "../test_helpers" } diff --git a/query/src/exec/context.rs b/query/src/exec/context.rs index dc0fc3c2c6..a5d60f2e84 100644 --- a/query/src/exec/context.rs +++ b/query/src/exec/context.rs @@ -20,7 +20,7 @@ use arrow_deps::{ use crate::exec::schema_pivot::{SchemaPivotExec, SchemaPivotNode}; -use tracing_deps::tracing::debug; +use observability_deps::tracing::debug; // Reuse DataFusion error and Result types for this module pub use arrow_deps::datafusion::error::{DataFusionError as Error, Result}; diff --git a/query/src/frontend/influxrpc.rs b/query/src/frontend/influxrpc.rs index af4a615fa4..01aaa61d0f 100644 --- a/query/src/frontend/influxrpc.rs +++ b/query/src/frontend/influxrpc.rs @@ -18,8 +18,8 @@ use internal_types::{ schema::{InfluxColumnType, Schema, TIME_COLUMN_NAME}, selection::Selection, }; +use observability_deps::tracing::debug; use snafu::{ensure, OptionExt, ResultExt, Snafu}; -use tracing_deps::tracing::debug; use crate::{ exec::{field::FieldColumns, make_schema_pivot, stringset::StringSet}, diff --git a/server/Cargo.toml b/server/Cargo.toml index f0e183dd87..c8958d4177 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -32,7 +32,7 @@ snafu = "0.6" snap = "1.0.0" tokio = { version = "1.0", features = ["macros", "time"] } tokio-util = { version = "0.6.3" } -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } uuid = { version = "0.8", features = ["serde", "v4"] } [dev-dependencies] # In alphabetical order diff --git a/server/src/buffer.rs b/server/src/buffer.rs index 0af895b4cc..5a31b45bfc 100644 --- a/server/src/buffer.rs +++ b/server/src/buffer.rs @@ -21,9 +21,9 @@ use chrono::{DateTime, Utc}; use crc32fast::Hasher; use data_types::database_rules::WalBufferConfig; use data_types::wal::{SegmentPersistence, SegmentSummary, WriterSummary}; +use observability_deps::tracing::{error, info, warn}; use parking_lot::Mutex; use snafu::{ensure, OptionExt, ResultExt, Snafu}; -use tracing_deps::tracing::{error, info, warn}; #[derive(Debug, Snafu)] pub enum Error { diff --git a/server/src/config.rs b/server/src/config.rs index fd50f7a254..ca760ffd07 100644 --- a/server/src/config.rs +++ b/server/src/config.rs @@ -12,9 +12,9 @@ use read_buffer::Database as ReadBufferDb; /// This module contains code for managing the configuration of the server. use crate::{db::Db, Error, JobRegistry, Result}; +use observability_deps::tracing::{self, error, info, warn, Instrument}; use tokio::task::JoinHandle; use tokio_util::sync::CancellationToken; -use tracing_deps::tracing::{self, error, info, warn, Instrument}; pub(crate) const DB_RULES_FILE_NAME: &str = "rules.pb"; diff --git a/server/src/db.rs b/server/src/db.rs index 5bedaecff3..0ab46a6560 100644 --- a/server/src/db.rs +++ b/server/src/db.rs @@ -8,9 +8,9 @@ use std::sync::{ }; use async_trait::async_trait; +use observability_deps::tracing::{debug, info}; use parking_lot::{Mutex, RwLock}; use snafu::{OptionExt, ResultExt, Snafu}; -use tracing_deps::tracing::{debug, info}; use arrow_deps::{ datafusion::catalog::{catalog::CatalogProvider, schema::SchemaProvider}, diff --git a/server/src/db/chunk.rs b/server/src/db/chunk.rs index 4bb7d170e1..7e28e12c4f 100644 --- a/server/src/db/chunk.rs +++ b/server/src/db/chunk.rs @@ -2,11 +2,11 @@ use arrow_deps::datafusion::physical_plan::SendableRecordBatchStream; use data_types::chunk::{ChunkStorage, ChunkSummary}; use internal_types::{schema::Schema, selection::Selection}; use mutable_buffer::chunk::Chunk as MBChunk; +use observability_deps::tracing::debug; use parquet_file::chunk::Chunk as ParquetChunk; use query::{exec::stringset::StringSet, predicate::Predicate, PartitionChunk}; use read_buffer::Database as ReadBufferDb; use snafu::{ResultExt, Snafu}; -use tracing_deps::tracing::debug; use std::sync::Arc; diff --git a/server/src/db/lifecycle.rs b/server/src/db/lifecycle.rs index cd097b83df..4a6bd271d6 100644 --- a/server/src/db/lifecycle.rs +++ b/server/src/db/lifecycle.rs @@ -2,8 +2,8 @@ use std::convert::TryInto; use std::sync::Arc; use chrono::{DateTime, Utc}; +use observability_deps::tracing::{error, info}; use parking_lot::{RwLock, RwLockUpgradableReadGuard}; -use tracing_deps::tracing::{error, info}; use data_types::{database_rules::LifecycleRules, error::ErrorLogger, job::Job}; diff --git a/server/src/lib.rs b/server/src/lib.rs index e742854a4d..da49cc7354 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -75,9 +75,9 @@ use std::sync::{ use async_trait::async_trait; use bytes::BytesMut; use futures::stream::TryStreamExt; +use observability_deps::tracing::{error, info, warn}; use parking_lot::Mutex; use snafu::{OptionExt, ResultExt, Snafu}; -use tracing_deps::tracing::{error, info, warn}; use data_types::{ database_rules::{DatabaseRules, WriterId}, diff --git a/server/src/snapshot.rs b/server/src/snapshot.rs index 684cc76e87..beb4d1cb3a 100644 --- a/server/src/snapshot.rs +++ b/server/src/snapshot.rs @@ -15,10 +15,10 @@ use std::sync::Arc; use bytes::Bytes; use futures::StreamExt; +use observability_deps::tracing::{error, info}; use parking_lot::Mutex; use snafu::{ResultExt, Snafu}; use tokio::sync::oneshot; -use tracing_deps::tracing::{error, info}; use uuid::Uuid; #[derive(Debug, Snafu)] diff --git a/server/src/tracker.rs b/server/src/tracker.rs index e9960d2803..1afb5db0d2 100644 --- a/server/src/tracker.rs +++ b/server/src/tracker.rs @@ -84,8 +84,8 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use std::time::Instant; +use observability_deps::tracing::warn; use tokio_util::sync::CancellationToken; -use tracing_deps::tracing::warn; pub use future::{TrackedFuture, TrackedFutureExt}; pub use history::TrackerRegistryWithHistory; diff --git a/server/src/tracker/history.rs b/server/src/tracker/history.rs index ee59220f2c..643647e578 100644 --- a/server/src/tracker/history.rs +++ b/server/src/tracker/history.rs @@ -1,8 +1,8 @@ use super::{Tracker, TrackerId, TrackerRegistration, TrackerRegistry}; use hashbrown::hash_map::Entry; use hashbrown::HashMap; +use observability_deps::tracing::info; use std::hash::Hash; -use tracing_deps::tracing::info; /// A wrapper around a TrackerRegistry that automatically retains a history #[derive(Debug)] diff --git a/server/src/tracker/registry.rs b/server/src/tracker/registry.rs index fd54cd865d..fd5c4a4130 100644 --- a/server/src/tracker/registry.rs +++ b/server/src/tracker/registry.rs @@ -1,8 +1,8 @@ use super::{Tracker, TrackerRegistration}; use hashbrown::HashMap; +use observability_deps::tracing::debug; use std::str::FromStr; use std::sync::Arc; -use tracing_deps::tracing::debug; /// Every future registered with a `TrackerRegistry` is assigned a unique /// `TrackerId` diff --git a/src/commands/convert.rs b/src/commands/convert.rs index 95a3551095..6695c79e7d 100644 --- a/src/commands/convert.rs +++ b/src/commands/convert.rs @@ -4,6 +4,7 @@ use ingest::{ ConversionSettings, Error as IngestError, LineProtocolConverter, TSMFileConverter, }; use internal_types::schema::Schema; +use observability_deps::tracing::{debug, info, warn}; use packers::{Error as TableError, IOxTableWriter, IOxTableWriterSource}; use snafu::{OptionExt, ResultExt, Snafu}; use std::{ @@ -13,7 +14,6 @@ use std::{ io::{BufReader, Read}, path::{Path, PathBuf}, }; -use tracing_deps::tracing::{debug, info, warn}; use crate::commands::input::{FileType, InputReader}; diff --git a/src/commands/logging.rs b/src/commands/logging.rs index e92c337ca7..a500c98f17 100644 --- a/src/commands/logging.rs +++ b/src/commands/logging.rs @@ -1,6 +1,6 @@ //! Logging initization and setup -use tracing_deps::{ +use observability_deps::{ env_logger, opentelemetry_jaeger, tracing_opentelemetry, tracing_subscriber::{self, prelude::*, EnvFilter}, }; diff --git a/src/commands/meta.rs b/src/commands/meta.rs index ced5e17133..82b7f25726 100644 --- a/src/commands/meta.rs +++ b/src/commands/meta.rs @@ -1,11 +1,11 @@ use influxdb_tsm::{reader::IndexEntry, reader::TSMIndexReader, InfluxID, TSMError}; use ingest::parquet::metadata::print_parquet_metadata; +use observability_deps::tracing::{debug, info}; use snafu::{ResultExt, Snafu}; use std::{ collections::{BTreeMap, BTreeSet}, convert::TryInto, }; -use tracing_deps::tracing::{debug, info}; use crate::commands::input::{FileType, InputReader}; diff --git a/src/commands/metrics.rs b/src/commands/metrics.rs index 8b91b15fea..5cb0f198e2 100644 --- a/src/commands/metrics.rs +++ b/src/commands/metrics.rs @@ -1,9 +1,9 @@ use super::run::Config; -use parking_lot::{const_rwlock, RwLock}; -use tracing_deps::{ +use observability_deps::{ opentelemetry_prometheus, prometheus::{Encoder, TextEncoder}, }; +use parking_lot::{const_rwlock, RwLock}; // TODO(jacobmarble): better way to write-once-read-many without a lock // TODO(jacobmarble): generic OTel exporter, rather than just prometheus diff --git a/src/commands/stats.rs b/src/commands/stats.rs index 62e33af0d0..0cc41139c9 100644 --- a/src/commands/stats.rs +++ b/src/commands/stats.rs @@ -1,8 +1,8 @@ //! This module contains code to report compression statistics for storage files +use observability_deps::tracing::info; use snafu::{ResultExt, Snafu}; use structopt::StructOpt; -use tracing_deps::tracing::info; use ingest::parquet::{error::IOxParquetError, stats as parquet_stats}; use packers::{ diff --git a/src/influxdb_ioxd.rs b/src/influxdb_ioxd.rs index b1ecbeacc9..736ec2c086 100644 --- a/src/influxdb_ioxd.rs +++ b/src/influxdb_ioxd.rs @@ -8,11 +8,11 @@ use hyper::server::conn::AddrIncoming; use object_store::{ self, aws::AmazonS3, azure::MicrosoftAzure, gcp::GoogleCloudStorage, ObjectStore, }; +use observability_deps::tracing::{self, error, info, warn, Instrument}; use panic_logging::SendPanicsToTracing; use server::{ConnectionManagerImpl as ConnectionManager, Server as AppServer}; use snafu::{ResultExt, Snafu}; use std::{convert::TryFrom, fs, net::SocketAddr, path::PathBuf, sync::Arc}; -use tracing_deps::tracing::{self, error, info, warn, Instrument}; mod http; mod rpc; diff --git a/src/influxdb_ioxd/http.rs b/src/influxdb_ioxd/http.rs index a82b054e9e..775c607660 100644 --- a/src/influxdb_ioxd/http.rs +++ b/src/influxdb_ioxd/http.rs @@ -29,10 +29,10 @@ use bytes::{Bytes, BytesMut}; use futures::{self, StreamExt}; use http::header::{CONTENT_ENCODING, CONTENT_TYPE}; use hyper::{Body, Method, Request, Response, StatusCode}; +use observability_deps::tracing::{self, debug, error, info}; use routerify::{prelude::*, Middleware, RequestInfo, Router, RouterError, RouterService}; use serde::Deserialize; use snafu::{OptionExt, ResultExt, Snafu}; -use tracing_deps::tracing::{self, debug, error, info}; use data_types::http::WalMetadataResponse; use hyper::server::conn::AddrIncoming; @@ -413,7 +413,7 @@ async fn parse_body(req: hyper::Request) -> Result(req: Request) -> Result, ApplicationError> where M: ConnectionManager + Send + Sync + Debug + 'static, diff --git a/src/influxdb_ioxd/rpc/error.rs b/src/influxdb_ioxd/rpc/error.rs index b5d34a2128..20bdf63966 100644 --- a/src/influxdb_ioxd/rpc/error.rs +++ b/src/influxdb_ioxd/rpc/error.rs @@ -1,5 +1,5 @@ use generated_types::google::{FieldViolation, InternalError, NotFound, PreconditionViolation}; -use tracing_deps::tracing::error; +use observability_deps::tracing::error; /// map common `server::Error` errors to the appropriate tonic Status pub fn default_server_error_handler(error: server::Error) -> tonic::Status { diff --git a/src/influxdb_ioxd/rpc/flight.rs b/src/influxdb_ioxd/rpc/flight.rs index a2e043d349..47eacff0aa 100644 --- a/src/influxdb_ioxd/rpc/flight.rs +++ b/src/influxdb_ioxd/rpc/flight.rs @@ -1,10 +1,10 @@ use std::{pin::Pin, sync::Arc}; use futures::Stream; +use observability_deps::tracing::error; use serde::Deserialize; use snafu::{OptionExt, ResultExt, Snafu}; use tonic::{Request, Response, Streaming}; -use tracing_deps::tracing::error; use arrow_deps::{ arrow, diff --git a/src/influxdb_ioxd/rpc/operations.rs b/src/influxdb_ioxd/rpc/operations.rs index a5261db9d5..a79060a9d4 100644 --- a/src/influxdb_ioxd/rpc/operations.rs +++ b/src/influxdb_ioxd/rpc/operations.rs @@ -2,9 +2,9 @@ use std::fmt::Debug; use std::sync::Arc; use bytes::BytesMut; +use observability_deps::tracing::debug; use prost::Message; use tonic::Response; -use tracing_deps::tracing::debug; use data_types::job::Job; use generated_types::google::FieldViolationExt; diff --git a/src/influxdb_ioxd/rpc/storage/expr.rs b/src/influxdb_ioxd/rpc/storage/expr.rs index 75cfef3306..4a3e4fe3f9 100644 --- a/src/influxdb_ioxd/rpc/storage/expr.rs +++ b/src/influxdb_ioxd/rpc/storage/expr.rs @@ -19,10 +19,10 @@ use generated_types::{ }; use super::{TAG_KEY_FIELD, TAG_KEY_MEASUREMENT}; +use observability_deps::tracing::warn; use query::group_by::{Aggregate as QueryAggregate, WindowDuration}; use query::predicate::PredicateBuilder; use snafu::{ResultExt, Snafu}; -use tracing_deps::tracing::warn; #[derive(Debug, Snafu)] pub enum Error { diff --git a/src/influxdb_ioxd/rpc/storage/service.rs b/src/influxdb_ioxd/rpc/storage/service.rs index 87d09c70ae..d64037db83 100644 --- a/src/influxdb_ioxd/rpc/storage/service.rs +++ b/src/influxdb_ioxd/rpc/storage/service.rs @@ -20,6 +20,7 @@ use generated_types::{ ReadWindowAggregateRequest, StringValuesResponse, TagKeysRequest, TagValuesRequest, TimestampRange, }; +use observability_deps::tracing::{error, info}; use query::{ exec::fieldlist::FieldList, exec::seriesset::{Error as SeriesSetError, SeriesSetItem}, @@ -32,7 +33,6 @@ use std::{collections::HashMap, sync::Arc}; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; use tonic::Status; -use tracing_deps::tracing::{error, info}; #[derive(Debug, Snafu)] pub enum Error { diff --git a/src/influxdb_ioxd/rpc/testing.rs b/src/influxdb_ioxd/rpc/testing.rs index 2be764f25b..a4885a5f33 100644 --- a/src/influxdb_ioxd/rpc/testing.rs +++ b/src/influxdb_ioxd/rpc/testing.rs @@ -1,6 +1,6 @@ use generated_types::i_ox_testing_server::{IOxTesting, IOxTestingServer}; use generated_types::{TestErrorRequest, TestErrorResponse}; -use tracing_deps::tracing::warn; +use observability_deps::tracing::warn; /// Concrete implementation of the gRPC IOx testing service API struct IOxTestingService {} diff --git a/src/influxdb_ioxd/rpc/write.rs b/src/influxdb_ioxd/rpc/write.rs index 4901517ba4..ff715620b7 100644 --- a/src/influxdb_ioxd/rpc/write.rs +++ b/src/influxdb_ioxd/rpc/write.rs @@ -2,10 +2,10 @@ use std::sync::Arc; use generated_types::{google::FieldViolation, influxdata::iox::write::v1::*}; use influxdb_line_protocol::parse_lines; +use observability_deps::tracing::debug; use server::{ConnectionManager, Server}; use std::fmt::Debug; use tonic::Response; -use tracing_deps::tracing::debug; use super::error::default_server_error_handler; diff --git a/src/main.rs b/src/main.rs index bfb7eafecd..9a3dedcd6a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,9 +10,9 @@ use std::str::FromStr; use dotenv::dotenv; +use observability_deps::tracing::{debug, warn}; use structopt::StructOpt; use tokio::runtime::Runtime; -use tracing_deps::tracing::{debug, warn}; use commands::logging::LoggingLevel; use ingest::parquet::writer::CompressionLevel; diff --git a/test_helpers/Cargo.toml b/test_helpers/Cargo.toml index fa993c01eb..bdd6dcf087 100644 --- a/test_helpers/Cargo.toml +++ b/test_helpers/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" dotenv = "0.15.0" parking_lot = "0.11.1" tempfile = "3.1.0" -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } diff --git a/test_helpers/src/lib.rs b/test_helpers/src/lib.rs index c45427bad9..4cd9812cb6 100644 --- a/test_helpers/src/lib.rs +++ b/test_helpers/src/lib.rs @@ -99,7 +99,7 @@ pub fn start_logging() { // Configure the logger to write to stderr and install it let output_stream = std::io::stderr; - use tracing_deps::tracing_subscriber::{self, prelude::*, EnvFilter}; + use observability_deps::tracing_subscriber::{self, prelude::*, EnvFilter}; tracing_subscriber::registry() .with(EnvFilter::from_default_env()) diff --git a/test_helpers/src/tracing.rs b/test_helpers/src/tracing.rs index 161ef77c6a..5ef0b60a3a 100644 --- a/test_helpers/src/tracing.rs +++ b/test_helpers/src/tracing.rs @@ -1,14 +1,14 @@ //! Utilities for testing tracing use std::{fmt, sync::Arc}; -use parking_lot::Mutex; -use tracing_deps::tracing::{ +use observability_deps::tracing::{ self, field::Field, span::{Attributes, Id, Record}, subscriber::{DefaultGuard, Subscriber}, Event, }; +use parking_lot::Mutex; /// This struct captures tracing `Event`s as strings, and can be used /// to verify that messages are making it to logs correctly diff --git a/wal/Cargo.toml b/wal/Cargo.toml index c813562605..f952f2c288 100644 --- a/wal/Cargo.toml +++ b/wal/Cargo.toml @@ -16,7 +16,7 @@ serde_json = "1.0.44" snafu = "0.6.6" snap = "1.0.0" tokio = { version = "1.0", features=["macros", "fs"] } -tracing_deps = { path = "../tracing_deps" } +observability_deps = { path = "../observability_deps" } [dev-dependencies] # In alphabetical order test_helpers = { path = "../test_helpers" } diff --git a/wal/src/writer.rs b/wal/src/writer.rs index bb97d94379..125a36ff45 100644 --- a/wal/src/writer.rs +++ b/wal/src/writer.rs @@ -9,8 +9,8 @@ use crate::{Error as WalError, SequenceNumber, WalBuilder, WritePayload}; use futures::{channel::mpsc, SinkExt, StreamExt}; use snafu::{ResultExt, Snafu}; +use observability_deps::tracing::{error, info}; use serde::{Deserialize, Serialize}; -use tracing_deps::tracing::{error, info}; use std::path::PathBuf;