Skip to content

Commit

Permalink
[Breaking] Mark prometheus config as experimental (#473)
Browse files Browse the repository at this point in the history
Since prometheus has known issues, in prep for the release, we are
flagging this config as experimental until we can fix the bugs.
  • Loading branch information
allada committed Dec 12, 2023
1 parent 3329d7c commit 931e721
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion deployment-examples/docker-compose/local-storage-cas.json
Expand Up @@ -65,7 +65,7 @@
// Only publish metrics on a private port.
"listen_address": "0.0.0.0:50061",
"services": {
"prometheus": {
"experimental_prometheus": {
"path": "/metrics"
}
}
Expand Down
2 changes: 1 addition & 1 deletion deployment-examples/terraform/AWS/scripts/scheduler.json
Expand Up @@ -143,7 +143,7 @@
}, {
"listen_address": "0.0.0.0:50061",
"services": {
"prometheus": {
"experimental_prometheus": {
"path": "/metrics"
},
// Note: This should be served on a different port, because it has
Expand Down
Expand Up @@ -42,7 +42,7 @@
// an external load balancer.
"listen_address": "0.0.0.0:50052",
"services": {
"prometheus": {
"experimental_prometheus": {
"path": "/metrics"
},
"cas": {
Expand Down
2 changes: 1 addition & 1 deletion deployment-examples/terraform/GCP/module/scripts/cas.json
Expand Up @@ -120,7 +120,7 @@
"http2_keep_alive_interval": 10
},
"services": {
"prometheus": {
"experimental_prometheus": {
"path": "/metrics"
},
"cas": {
Expand Down
Expand Up @@ -122,7 +122,7 @@
"http2_keep_alive_interval": 10
},
"services": {
"prometheus": {
"experimental_prometheus": {
"path": "/metrics"
},
"ac": {
Expand Down
Expand Up @@ -96,7 +96,7 @@
"http2_keep_alive_interval": 10
},
"services": {
"prometheus": {
"experimental_prometheus": {
"path": "/metrics"
}
}
Expand Down
2 changes: 1 addition & 1 deletion nativelink-config/examples/basic_cas.json
Expand Up @@ -128,7 +128,7 @@
"name": "private_workers_servers",
"listen_address": "0.0.0.0:50061",
"services": {
"prometheus": {
"experimental_prometheus": {
"path": "/metrics"
},
// Note: This should be served on a different port, because it has
Expand Down
6 changes: 3 additions & 3 deletions nativelink-config/src/cas_server.rs
Expand Up @@ -198,9 +198,9 @@ pub struct ServicesConfig {
/// that makes the remote execution/cache requests.
pub worker_api: Option<WorkerApiConfig>,

/// Prometheus metrics configuration. Metrics are gathered as a singleton
/// but may be served on multiple endpoints.
pub prometheus: Option<PrometheusConfig>,
/// Experimental - Prometheus metrics configuration. Metrics are gathered
/// as a singleton but may be served on multiple endpoints.
pub experimental_prometheus: Option<PrometheusConfig>,

/// This is the service for any administrative tasks.
/// It provides a REST API endpoint for administrative purposes.
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cas.rs
Expand Up @@ -350,7 +350,7 @@ async fn inner_main(cfg: CasConfig, server_start_timestamp: u64) -> Result<(), B
// This is a generic endpoint used to check if the server is up.
.route_service("/status", axum::routing::get(move || async move { "Ok".to_string() }));

if let Some(prometheus_cfg) = services.prometheus {
if let Some(prometheus_cfg) = services.experimental_prometheus {
fn error_to_response<E: std::error::Error>(e: E) -> Response<String> {
let mut response = Response::new(format!("Error: {e:?}"));
*response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR;
Expand Down Expand Up @@ -683,7 +683,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let Some(service) = &v.services else {
return true;
};
service.prometheus.is_none()
service.experimental_prometheus.is_none()
}),
default_digest_hash_function: None,
}
Expand Down

0 comments on commit 931e721

Please sign in to comment.