Skip to content

Commit

Permalink
chore: remove debug_secret who's usage was removed in reown-com#249 (r…
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 authored Aug 18, 2023
1 parent 4ab4222 commit dc7b9dc
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 26 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 25,5 @@ export TF_VAR_infura_project_id=""
export TF_VAR_pokt_project_id=""
export TF_VAR_grafana_endpoint=$(aws grafana list-workspaces | jq -r '.workspaces[] | select( .tags.Env == "prod") | select( .tags.Name == "grafana-9") | .endpoint')
export TF_VAR_registry_api_auth_token=""
export TF_VAR_debug_secret=""

export GRAFANA_AUTH="Grab one at https://$TF_VAR_grafana_endpoint"
6 changes: 3 additions & 3 deletions src/env/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
use {
crate::{
analytics::Config as AnalyticsConfig,
debug::DebugConfig,
error,
profiler::ProfilerConfig,
project::{storage::Config as StorageConfig, Config as RegistryConfig},
providers::{ProviderKind, Weight},
},
Expand Down Expand Up @@ -35,7 35,7 @@ pub struct Config {
pub registry: RegistryConfig,
pub storage: StorageConfig,
pub analytics: AnalyticsConfig,
pub debug: DebugConfig,
pub profiler: ProfilerConfig,
}

impl Config {
Expand All @@ -45,7 45,7 @@ impl Config {
registry: from_env("RPC_PROXY_REGISTRY_")?,
storage: from_env("RPC_PROXY_STORAGE_")?,
analytics: from_env("RPC_PROXY_ANALYTICS_")?,
debug: from_env("RPC_PROXY_DEBUG_")?,
profiler: from_env("RPC_PROXY_PROFILER_")?,
})
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 52,13 @@ const KEEPALIVE_INTERVAL: Duration = Duration::from_secs(5);
const KEEPALIVE_RETRIES: u32 = 1;

mod analytics;
pub mod debug;
pub mod env;
pub mod error;
mod extractors;
mod handlers;
mod json_rpc;
mod metrics;
pub mod profiler;
mod project;
mod providers;
mod state;
Expand Down Expand Up @@ -185,8 185,8 @@ pub async fn bootstrap(config: Config) -> RpcResult<()> {
}
};

let memory_debug_data_collector = async move {
if let Err(e) = tokio::spawn(debug::debug_metrics()).await {
let profiler = async move {
if let Err(e) = tokio::spawn(profiler::run()).await {
warn!("Memory debug stats collection failed with: {:?}", e);
}
Ok(())
Expand All @@ -196,7 196,7 @@ pub async fn bootstrap(config: Config) -> RpcResult<()> {
tokio::spawn(public_server),
tokio::spawn(private_server),
tokio::spawn(updater),
tokio::spawn(memory_debug_data_collector),
tokio::spawn(profiler),
];

if let Err(e) = futures_util::future::select_all(services).await.0 {
Expand Down
6 changes: 2 additions & 4 deletions src/debug/mod.rs → src/profiler/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 1,7 @@
#[derive(Debug, Clone, serde::Deserialize)]
pub struct DebugConfig {
pub secret: String,
}
pub struct ProfilerConfig {}

pub async fn debug_metrics() {
pub async fn run() {
loop {
if let Err(err) = wc::alloc::stats::update_jemalloc_metrics() {
tracing::warn!(?err, "failed to collect jemalloc stats");
Expand Down
2 changes: 0 additions & 2 deletions terraform/ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 87,6 @@ resource "aws_ecs_task_definition" "app_task" {
{ "name" : "RPC_PROXY_ANALYTICS_GEOIP_DB_BUCKET", "value" : var.analytics_geoip_db_bucket_name },
{ "name" : "RPC_PROXY_ANALYTICS_GEOIP_DB_KEY", "value" : var.analytics_geoip_db_key },

{ "name" : "RPC_PROXY_DEBUG_SECRET", "value" : var.debug_secret },

{ "name" : "SIG_PROXY_URL", "value" : "http://127.0.0.1:8080/workspaces/${var.prometheus_workspace_id}" },
{ "name" : "SIG_PROM_WORKSPACE_HEADER", "value" : "aps-workspaces.${var.region}.amazonaws.com" },
],
Expand Down
5 changes: 0 additions & 5 deletions terraform/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 144,3 @@ variable "analytics_geoip_db_bucket_name" {
description = "The name of the bucket containing the GeoIP database"
type = string
}

variable "debug_secret" {
description = "The secret used to run profiler endpoint"
type = string
}
2 changes: 0 additions & 2 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 116,6 @@ module "ecs" {
analytics_data_lake_bucket_name = local.analytics_data_lake_bucket_name
analytics_data_lake_kms_key_arn = var.analytics_data_lake_kms_key_arn
analytics_geoip_db_bucket_name = local.analytics_geoip_db_bucket_name

debug_secret = var.debug_secret
}

module "redis" {
Expand Down
5 changes: 0 additions & 5 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 51,3 @@ variable "analytics_data_lake_kms_key_arn" {
description = "The ARN of KMS encryption key for the data-lake bucket."
type = string
}

variable "debug_secret" {
description = "The secret used to run memory profile endpoint."
type = string
}

0 comments on commit dc7b9dc

Please sign in to comment.