aboutsummaryrefslogtreecommitdiff
path: root/src/garage/Cargo.toml
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2022-09-04 00:43:48 +0200
committerJakub Jirutka <jakub@jirutka.cz>2022-09-06 01:15:09 +0200
commitea36b9ff904a8300afb8fb1601cde88c915a810f (patch)
tree73dd84bba384a79cacdbd4bdec01c5c9485d2c6b /src/garage/Cargo.toml
parente7af006c1c8211bf83b5d8abb7490ef270dd8345 (diff)
downloadgarage-ea36b9ff904a8300afb8fb1601cde88c915a810f.tar.gz
garage-ea36b9ff904a8300afb8fb1601cde88c915a810f.zip
Allow building without Prometheus exporter (/metrics endpoint)
prometheus and opentelemetry-prometheus add 7 extra dependencies in total and increases the size of the garage binary by ~7 % (with fat LTO).
Diffstat (limited to 'src/garage/Cargo.toml')
-rw-r--r--src/garage/Cargo.toml8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml
index 8573e2fc..553ac57a 100644
--- a/src/garage/Cargo.toml
+++ b/src/garage/Cargo.toml
@@ -55,9 +55,9 @@ tokio = { version = "1.0", default-features = false, features = ["rt", "rt-multi
netapp = "0.4"
opentelemetry = { version = "0.17", features = [ "rt-tokio" ] }
-opentelemetry-prometheus = "0.10"
+opentelemetry-prometheus = { version = "0.10", optional = true }
opentelemetry-otlp = { version = "0.10", optional = true }
-prometheus = "0.13"
+prometheus = { version = "0.13", optional = true }
[dev-dependencies]
aws-sdk-s3 = "0.8"
@@ -74,9 +74,11 @@ base64 = "0.13"
[features]
-default = [ "bundled-libs" ]
+default = [ "bundled-libs", "metrics" ]
kubernetes-discovery = [ "garage_rpc/kubernetes-discovery" ]
k2v = [ "garage_util/k2v", "garage_api/k2v" ]
+# Prometheus exporter (/metrics endpoint).
+metrics = [ "garage_api/metrics", "opentelemetry-prometheus", "prometheus" ]
# Exporter for the OpenTelemetry Collector.
telemetry-otlp = [ "opentelemetry-otlp", "garage_api/telemetry-otlp" ]