Skip to content

Commit

Permalink
[core] neuter telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Nov 10, 2023
1 parent 2f8d189 commit 9fcc429
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 217 deletions.
126 changes: 2 additions & 124 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ members = [
"crates/diem-rosetta-cli",
"crates/diem-runtimes",
"crates/diem-speculative-state-helper",
"crates/diem-telemetry",
"crates/diem-telemetry-service",
# "crates/diem-telemetry",
# "crates/diem-telemetry-service",
"crates/diem-temppath",
"crates/diem-time-service",
"crates/diem-warp-webserver",
Expand Down Expand Up @@ -366,8 +366,8 @@ diem-storage-interface = { path = "storage/storage-interface" }
diem-storage-service-client = { path = "state-sync/storage-service/client" }
diem-storage-service-types = { path = "state-sync/storage-service/types" }
diem-storage-service-server = { path = "state-sync/storage-service/server" }
diem-telemetry = { path = "crates/diem-telemetry" }
diem-telemetry-service = { path = "crates/diem-telemetry-service" }
# diem-telemetry = { path = "crates/diem-telemetry" }
# diem-telemetry-service = { path = "crates/diem-telemetry-service" }
diem-temppath = { path = "crates/diem-temppath" }
diem-testcases = { path = "testsuite/testcases" }
diem-time-service = { path = "crates/diem-time-service", features = [
Expand Down
2 changes: 1 addition & 1 deletion crates/diem-inspection-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ diem-logger = { workspace = true }
diem-metrics-core = { workspace = true }
diem-network = { workspace = true }
diem-runtimes = { workspace = true }
diem-telemetry = { workspace = true }
# diem-telemetry = { workspace = true }
futures = { workspace = true }
hyper = { workspace = true }
once_cell = { workspace = true }
Expand Down
19 changes: 10 additions & 9 deletions crates/diem-inspection-service/src/server/system_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use crate::server::utils::{CONTENT_TYPE_JSON, CONTENT_TYPE_TEXT};
use diem_build_info::build_information;
// use diem_build_info::build_information;
use diem_config::config::NodeConfig;
use hyper::{Body, StatusCode};

Expand Down Expand Up @@ -30,13 +30,14 @@ pub fn handle_system_information_request(node_config: NodeConfig) -> (StatusCode

/// Returns a simple JSON formatted string with system information
fn get_system_information_json() -> String {
// Get the system and build information
let mut system_information = diem_telemetry::system_information::get_system_information();
system_information.extend(build_information!());
return "".to_string();
// // Get the system and build information
// let mut system_information = diem_telemetry::system_information::get_system_information();
// system_information.extend(build_information!());

// Return the system information as a JSON string
match serde_json::to_string(&system_information) {
Ok(system_information) => system_information,
Err(error) => format!("Failed to get system information! Error: {}", error),
}
// // Return the system information as a JSON string
// match serde_json::to_string(&system_information) {
// Ok(system_information) => system_information,
// Err(error) => format!("Failed to get system information! Error: {}", error),
// }
}
16 changes: 10 additions & 6 deletions crates/diem-telemetry/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ pub(crate) const ENV_GA_MEASUREMENT_ID: &str = "GA_MEASUREMENT_ID";
pub(crate) const ENV_GA_API_SECRET: &str = "GA_API_SECRET";
pub(crate) const ENV_TELEMETRY_SERVICE_URL: &str = "TELEMETRY_SERVICE_URL";

//////// 0L /////////
// silly rabbit

// Default Google Analytic values.
// TODO: Rotate these periodically.
pub(crate) const DIEM_GA_MEASUREMENT_ID: &str = "G-ZX4L6WPCFZ";
pub(crate) const DIEM_GA_API_SECRET: &str = "ArtslKPTTjeiMi1n-IR39g";
pub(crate) const DIEM_GA_MEASUREMENT_ID: &str = "silly...";
pub(crate) const DIEM_GA_API_SECRET: &str = "...rabbit";

// Useful URLS.
// Note: the measurement protocol requires HTTPS.
// See: https://developers.google.com/analytics/devguides/collection/protocol/v1/reference#transport
pub(crate) const GA4_URL: &str = "https://www.google-analytics.com/mp/collect";
pub(crate) const HTTPBIN_URL: &str = "https://httpbin.org/ip";
pub(crate) const TELEMETRY_SERVICE_URL: &str = "https://telemetry.diemlabs.com";
pub(crate) const MAINNET_TELEMETRY_SERVICE_URL: &str = "https://telemetry.mainnet.diemlabs.com";
pub(crate) const GA4_URL: &str = "https://lol";
pub(crate) const HTTPBIN_URL: &str = "https://lol";
pub(crate) const TELEMETRY_SERVICE_URL: &str = "https://lol";
pub(crate) const MAINNET_TELEMETRY_SERVICE_URL: &str = "https://lol";
//////// 0L ////////

// Frequencies for the various metrics and pushes
pub(crate) const NODE_BUILD_INFO_FREQ_SECS: u64 = 60 * 60; // 60 minutes
Expand Down
2 changes: 1 addition & 1 deletion crates/diem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ diem-node = { workspace = true }
diem-rest-client = { workspace = true }
diem-sdk = { workspace = true }
diem-storage-interface = { workspace = true }
diem-telemetry = { workspace = true }
# diem-telemetry = { workspace = true }
diem-temppath = { workspace = true }
diem-transactional-test-harness = { workspace = true }
diem-types = { workspace = true }
Expand Down
Loading

0 comments on commit 9fcc429

Please sign in to comment.