about summary refs log tree commit diff
path: root/tvix/store/Cargo.toml
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-02-28T23·37+0100
committerclbot <clbot@tvl.fyi>2024-01-01T17·27+0000
commit3307791855fcce717c9265fab8868e3d8b5443ea (patch)
tree6b659a9c7e486e51c14ac16b2c69267c1e21feb8 /tvix/store/Cargo.toml
parent597a6b6205c3455ac92d816ad5e85af9615f6063 (diff)
feat(tvix/store): add opentelemetry r/7308
This is behind the otlp feature flag (currently enabled by default).

By default, this will try to push traces to a OTLP collector running at
https://localhost:4317.

You can make one available by running:

```
docker run -d --name jaeger \
  -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
  -e COLLECTOR_OTLP_ENABLED=true \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 5778:5778 \
  -p 16686:16686 \
  -p 4317:4317 \
  -p 4318:4318 \
  -p 14250:14250 \
  -p 14268:14268 \
  -p 14269:14269 \
  -p 9411:9411 --rm \
  jaegertracing/all-in-one:1.42
```

Started like that, jaeger brings a web interface at
http://localhost:16686/search

As documented in
https://docs.rs/opentelemetry-otlp/latest/opentelemetry_otlp/, you can
point this to another location by setting `OTEL_EXPORTER_OTLP_ENDPOINT`.

Change-Id: Id1dca367d70027b2ea98bb70bcf99a68363ec2be
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8194
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: aaqaishtyaq <aaqaishtyaq@gmail.com>
Diffstat (limited to 'tvix/store/Cargo.toml')
-rw-r--r--tvix/store/Cargo.toml9
1 files changed, 7 insertions, 2 deletions
diff --git a/tvix/store/Cargo.toml b/tvix/store/Cargo.toml
index e6d17e0f6865..39bd0851bc54 100644
--- a/tvix/store/Cargo.toml
+++ b/tvix/store/Cargo.toml
@@ -16,6 +16,9 @@ lazy_static = "1.4.0"
 nix-compat = { path = "../nix-compat", features = ["async"] }
 pin-project-lite = "0.2.13"
 prost = "0.12.1"
+opentelemetry = { version = "0.21.0", optional = true}
+opentelemetry-otlp = { version = "0.14.0", optional = true }
+opentelemetry_sdk = { version = "0.21.0", features = ["rt-tokio"], optional = true}
 sha2 = "0.10.6"
 sled = { version = "0.34.7" }
 thiserror = "1.0.38"
@@ -26,6 +29,7 @@ tokio-util = { version = "0.7.9", features = ["io", "io-util", "compat"] }
 tonic = { version = "0.10.2", features = ["tls", "tls-roots"] }
 tower = "0.4.13"
 tracing = "0.1.37"
+tracing-opentelemetry = "0.22.0"
 tracing-subscriber = { version = "0.3.16", features = ["json"] }
 tvix-castore = { path = "../castore" }
 url = "2.4.0"
@@ -48,7 +52,8 @@ tempfile = "3.3.0"
 tokio-retry = "0.3.0"
 
 [features]
-default = ["fuse", "tonic-reflection"]
+default = ["fuse", "otlp", "tonic-reflection"]
 fuse = ["tvix-castore/fuse"]
-virtiofs = ["tvix-castore/virtiofs"]
+otlp = ["dep:opentelemetry", "dep:opentelemetry-otlp", "dep:opentelemetry_sdk"]
 tonic-reflection = ["dep:tonic-reflection", "tvix-castore/tonic-reflection"]
+virtiofs = ["tvix-castore/virtiofs"]