Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 1 addition & 84 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ opentelemetry_sdk = { version = "0.31", default-features = false, features = [
"logs",
"metrics",
] }
prometheus = "0.14"
s3s = "0.13.0-alpha.3"
s3s-aws = "0.13.0-alpha.3"
tokio = { version = "1", features = [
Expand Down
8 changes: 1 addition & 7 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ pub struct Config {
/// Export logs via OTLP gRPC (requires otel_grpc_endpoint_url)
#[arg(long, env = "OTEL_EXPORT_LOGS", default_value_t = false, action = clap::ArgAction::Set)]
pub otel_export_logs: bool,

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

impl Config {
Expand Down Expand Up @@ -141,7 +137,7 @@ impl Display for Config {
cache_max_entries: {}, cache_max_size_bytes: {}, cache_ttl_seconds: {}, \
max_cacheable_object_size: {}, otel_grpc_endpoint_url: {:?}, \
otel_export_metrics: {}, otel_export_logs: {}, cache_shards: {}, \
cache_dry_run: {}, worker_threads: {}, prometheus_textfile_dir: {:?} }}",
cache_dry_run: {}, worker_threads: {} }}",
self.listen_addr,
self.upstream_endpoint,
self.upstream_region,
Expand All @@ -155,7 +151,6 @@ impl Display for Config {
self.cache_shards,
self.cache_dry_run,
self.worker_threads,
self.prometheus_textfile_dir,
)
}
}
Expand Down Expand Up @@ -186,7 +181,6 @@ mod tests {
otel_grpc_endpoint_url: None,
otel_export_metrics: false,
otel_export_logs: false,
prometheus_textfile_dir: None,
}
}

Expand Down
27 changes: 1 addition & 26 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! - **Range Request Support**: Caches partial object reads (byte ranges)
//! - **Cache Invalidation**: Automatic invalidation on PUT/DELETE operations
//! - **Dry-run Mode**: Validate cache correctness without serving cached data
//! - **Telemetry**: OpenTelemetry metrics and Prometheus support
//! - **Telemetry**: OpenTelemetry metrics support

use std::sync::Arc;
use std::time::Duration;
Expand Down Expand Up @@ -41,7 +41,6 @@ mod auth;
mod config;
mod error;
mod fifo_cache;
mod metrics_writer;
mod proxy;
mod s3_cache;
mod s3_op;
Expand Down Expand Up @@ -157,24 +156,6 @@ where
S3CachingServiceProxy::new(b.build(), upstream_health_endpoint)
};

// Start Prometheus metrics writer if configured
let metrics_writer_handle = if let Some(textfile_dir) = config.prometheus_textfile_dir.clone() {
info!(
"Starting Prometheus textfile writer to {}/s3_cache.prom",
textfile_dir
);
Some(tokio::spawn({
async move {
if let Err(e) = metrics_writer::start_metrics_writer(textfile_dir).await {
error!("Metrics writer failed: {:?}", e);
}
}
}))
} else {
info!("Prometheus textfile writer disabled (PROMETHEUS_TEXTFILE_DIR not set)");
None
};

// Start hyper server
let listener = TcpListener::bind(config.listen_addr).await?;
// Report the bound address before entering the accept loop so callers using
Expand Down Expand Up @@ -223,12 +204,6 @@ where
}
}

// Abort metrics writer background task
if let Some(handle) = metrics_writer_handle {
handle.abort();
info!("Metrics writer task aborted");
}

telemetry::shutdown_metrics(metrics_provider);
telemetry::shutdown_logs(logs_provider);

Expand Down
76 changes: 0 additions & 76 deletions src/metrics_writer.rs

This file was deleted.

Loading