feat(tvix/tracing): introduce common tvix-tracing crate

Introduce a new common crate that contains tracing boilerplate which then
can be used in the cli, tvix-store and tvix-build crates.
It has otlp as an optional feature, which is currently only used by
tvix-store.

Change-Id: I41468ac4d9c65174515d721513b96fea463d6ed2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11758
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Simon Hauser <simon.hauser@helsinki-systems.de>
This commit is contained in:
Simon Hauser 2024-06-06 15:44:11 +02:00 committed by clbot
parent 11a6ff7706
commit 825d498908
15 changed files with 271 additions and 203 deletions

View file

@ -119,6 +119,16 @@ rec {
packageId = "tvix-store";
};
# Debug support which might change between releases.
# File a bug if you depend on any for non-debug work!
debug = internal.debugCrate { inherit packageId; };
};
"tvix-tracing" = rec {
packageId = "tvix-tracing";
build = internal.buildRustCrateWithFeatures {
packageId = "tvix-tracing";
};
# Debug support which might change between releases.
# File a bug if you depend on any for non-debug work!
debug = internal.debugCrate { inherit packageId; };
@ -12953,14 +12963,14 @@ rec {
name = "tracing";
packageId = "tracing";
}
{
name = "tracing-subscriber";
packageId = "tracing-subscriber";
}
{
name = "tvix-castore";
packageId = "tvix-castore";
}
{
name = "tvix-tracing";
packageId = "tvix-tracing";
}
{
name = "url";
packageId = "url";
@ -13298,11 +13308,6 @@ rec {
{
name = "tracing";
packageId = "tracing";
features = [ "max_level_trace" "release_max_level_info" ];
}
{
name = "tracing-subscriber";
packageId = "tracing-subscriber";
}
{
name = "tvix-build";
@ -13325,6 +13330,10 @@ rec {
packageId = "tvix-store";
usesDefaultFeatures = false;
}
{
name = "tvix-tracing";
packageId = "tvix-tracing";
}
{
name = "wu-manber";
packageId = "wu-manber";
@ -13794,10 +13803,6 @@ rec {
name = "futures";
packageId = "futures";
}
{
name = "indicatif";
packageId = "indicatif";
}
{
name = "lazy_static";
packageId = "lazy_static";
@ -13811,22 +13816,6 @@ rec {
packageId = "nix-compat";
features = [ "async" ];
}
{
name = "opentelemetry";
packageId = "opentelemetry";
optional = true;
}
{
name = "opentelemetry-otlp";
packageId = "opentelemetry-otlp";
optional = true;
}
{
name = "opentelemetry_sdk";
packageId = "opentelemetry_sdk";
optional = true;
features = [ "rt-tokio" ];
}
{
name = "parking_lot";
packageId = "parking_lot 0.12.2";
@ -13916,19 +13905,14 @@ rec {
name = "tracing-indicatif";
packageId = "tracing-indicatif";
}
{
name = "tracing-opentelemetry";
packageId = "tracing-opentelemetry";
}
{
name = "tracing-subscriber";
packageId = "tracing-subscriber";
features = [ "env-filter" ];
}
{
name = "tvix-castore";
packageId = "tvix-castore";
}
{
name = "tvix-tracing";
packageId = "tvix-tracing";
}
{
name = "url";
packageId = "url";
@ -13974,12 +13958,72 @@ rec {
"cloud" = [ "dep:bigtable_rs" "tvix-castore/cloud" ];
"default" = [ "cloud" "fuse" "otlp" "tonic-reflection" ];
"fuse" = [ "tvix-castore/fuse" ];
"otlp" = [ "dep:opentelemetry" "dep:opentelemetry-otlp" "dep:opentelemetry_sdk" ];
"otlp" = [ "tvix-tracing/otlp" ];
"tonic-reflection" = [ "dep:tonic-reflection" "tvix-castore/tonic-reflection" ];
"virtiofs" = [ "tvix-castore/virtiofs" ];
};
resolvedDefaultFeatures = [ "cloud" "default" "fuse" "integration" "otlp" "tonic-reflection" "virtiofs" ];
};
"tvix-tracing" = rec {
crateName = "tvix-tracing";
version = "0.1.0";
edition = "2021";
# We can't filter paths with references in Nix 2.4
# See https://github.com/NixOS/nix/issues/5410
src =
if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
then lib.cleanSourceWith { filter = sourceFilter; src = ./tracing; }
else ./tracing;
dependencies = [
{
name = "indicatif";
packageId = "indicatif";
}
{
name = "lazy_static";
packageId = "lazy_static";
}
{
name = "opentelemetry";
packageId = "opentelemetry";
optional = true;
}
{
name = "opentelemetry-otlp";
packageId = "opentelemetry-otlp";
optional = true;
}
{
name = "opentelemetry_sdk";
packageId = "opentelemetry_sdk";
optional = true;
features = [ "rt-tokio" ];
}
{
name = "tracing";
packageId = "tracing";
features = [ "max_level_trace" "release_max_level_info" ];
}
{
name = "tracing-indicatif";
packageId = "tracing-indicatif";
}
{
name = "tracing-opentelemetry";
packageId = "tracing-opentelemetry";
optional = true;
}
{
name = "tracing-subscriber";
packageId = "tracing-subscriber";
features = [ "env-filter" ];
}
];
features = {
"otlp" = [ "dep:tracing-opentelemetry" "dep:opentelemetry" "dep:opentelemetry-otlp" "dep:opentelemetry_sdk" ];
};
resolvedDefaultFeatures = [ "default" "otlp" ];
};
"typenum" = rec {
crateName = "typenum";
version = "1.17.0";