Skip to content

Commit 8de3863

Browse files
committed
Remove Prometheus metrics, keeping only OTEL
1 parent 55e802f commit 8de3863

File tree

6 files changed

+36
-575
lines changed

6 files changed

+36
-575
lines changed

Cargo.lock

Lines changed: 1 addition & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ opentelemetry_sdk = { version = "0.31", default-features = false, features = [
4949
"logs",
5050
"metrics",
5151
] }
52-
prometheus = "0.14"
5352
s3s = "0.13.0-alpha.3"
5453
s3s-aws = "0.13.0-alpha.3"
5554
tokio = { version = "1", features = [

src/config.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ pub struct Config {
8888
#[arg(long, env = "OTEL_EXPORT_LOGS", default_value_t = false, action = clap::ArgAction::Set)]
8989
pub otel_export_logs: bool,
9090

91-
/// Prometheus textfile collector directory
92-
#[arg(long, env = "PROMETHEUS_TEXTFILE_DIR")]
93-
pub prometheus_textfile_dir: Option<String>,
9491
}
9592

9693
impl Config {
@@ -141,7 +138,7 @@ impl Display for Config {
141138
cache_max_entries: {}, cache_max_size_bytes: {}, cache_ttl_seconds: {}, \
142139
max_cacheable_object_size: {}, otel_grpc_endpoint_url: {:?}, \
143140
otel_export_metrics: {}, otel_export_logs: {}, cache_shards: {}, \
144-
cache_dry_run: {}, worker_threads: {}, prometheus_textfile_dir: {:?} }}",
141+
cache_dry_run: {}, worker_threads: {} }}",
145142
self.listen_addr,
146143
self.upstream_endpoint,
147144
self.upstream_region,
@@ -155,7 +152,6 @@ impl Display for Config {
155152
self.cache_shards,
156153
self.cache_dry_run,
157154
self.worker_threads,
158-
self.prometheus_textfile_dir,
159155
)
160156
}
161157
}
@@ -186,7 +182,6 @@ mod tests {
186182
otel_grpc_endpoint_url: None,
187183
otel_export_metrics: false,
188184
otel_export_logs: false,
189-
prometheus_textfile_dir: None,
190185
}
191186
}
192187

src/lib.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! - **Range Request Support**: Caches partial object reads (byte ranges)
1313
//! - **Cache Invalidation**: Automatic invalidation on PUT/DELETE operations
1414
//! - **Dry-run Mode**: Validate cache correctness without serving cached data
15-
//! - **Telemetry**: OpenTelemetry metrics and Prometheus support
15+
//! - **Telemetry**: OpenTelemetry metrics support
1616
1717
use std::sync::Arc;
1818
use std::time::Duration;
@@ -41,7 +41,6 @@ mod auth;
4141
mod config;
4242
mod error;
4343
mod fifo_cache;
44-
mod metrics_writer;
4544
mod proxy;
4645
mod s3_cache;
4746
mod s3_op;
@@ -157,24 +156,6 @@ where
157156
S3CachingServiceProxy::new(b.build(), upstream_health_endpoint)
158157
};
159158

160-
// Start Prometheus metrics writer if configured
161-
let metrics_writer_handle = if let Some(textfile_dir) = config.prometheus_textfile_dir.clone() {
162-
info!(
163-
"Starting Prometheus textfile writer to {}/s3_cache.prom",
164-
textfile_dir
165-
);
166-
Some(tokio::spawn({
167-
async move {
168-
if let Err(e) = metrics_writer::start_metrics_writer(textfile_dir).await {
169-
error!("Metrics writer failed: {:?}", e);
170-
}
171-
}
172-
}))
173-
} else {
174-
info!("Prometheus textfile writer disabled (PROMETHEUS_TEXTFILE_DIR not set)");
175-
None
176-
};
177-
178159
// Start hyper server
179160
let listener = TcpListener::bind(config.listen_addr).await?;
180161
// Report the bound address before entering the accept loop so callers using
@@ -223,12 +204,6 @@ where
223204
}
224205
}
225206

226-
// Abort metrics writer background task
227-
if let Some(handle) = metrics_writer_handle {
228-
handle.abort();
229-
info!("Metrics writer task aborted");
230-
}
231-
232207
telemetry::shutdown_metrics(metrics_provider);
233208
telemetry::shutdown_logs(logs_provider);
234209

src/metrics_writer.rs

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)