Skip to content

Commit

Permalink
update profile environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Jul 22, 2024
1 parent 596a183 commit cb7b9a1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/profiler/elastic_apm_profiler/src/profiler/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const ELASTIC_OTEL_LOG_TARGETS_ENV_VAR: &str = "ELASTIC_OTEL_LOG_TARGETS";
const ELASTIC_APM_PROFILER_LOG_DIR_ENV_VAR: &str = "ELASTIC_APM_PROFILER_LOG_DIR";
const ELASTIC_APM_PROFILER_LOG_ENV_VAR: &str = "ELASTIC_APM_PROFILER_LOG";

const ELASTIC_OTEL_LOG_LEVEL_ENV_VAR: &str = "ELASTIC_OTEL_LOG_LEVEL";
const ELASTIC_OTEL_LOG_DIRECTORY_ENV_VAR: &str = "ELASTIC_OTEL_LOG_DIRECTORY";
const OTEL_LOG_LEVEL_ENV_VAR: &str = "OTEL_LOG_LEVEL";
const OTEL_DOTNET_AUTO_LOG_DIRECTORY_ENV_VAR: &str = "OTEL_DOTNET_AUTO_LOG_DIRECTORY";

const ELASTIC_APM_LOG_LEVEL_ENV_VAR: &str = "ELASTIC_APM_LOG_LEVEL";
const ELASTIC_APM_LOG_DIRECTORY_ENV_VAR: &str = "ELASTIC_APM_LOG_DIRECTORY";
Expand Down Expand Up @@ -106,6 +106,7 @@ pub fn get_env_vars() -> String {
let key = k.to_uppercase();
if key.starts_with("ELASTIC_")
|| key.starts_with("CORECLR_")
|| key.starts_with("OTEL_")
|| key.starts_with("COR_")
|| key == APP_POOL_ID_ENV_VAR
|| key == DOTNET_CLI_TELEMETRY_PROFILE_ENV_VAR
Expand Down Expand Up @@ -207,7 +208,7 @@ fn read_log_targets_from_env_var() -> HashSet<String> {

pub fn read_log_level_from_env_var(default: LevelFilter) -> LevelFilter {
match (
std::env::var(ELASTIC_OTEL_LOG_LEVEL_ENV_VAR),
std::env::var(OTEL_LOG_LEVEL_ENV_VAR),
std::env::var(ELASTIC_APM_PROFILER_LOG_ENV_VAR),
std::env::var(ELASTIC_APM_LOG_DIRECTORY_ENV_VAR)
) {
Expand Down Expand Up @@ -311,7 +312,7 @@ fn get_home_log_dir() -> PathBuf {

fn get_log_dir() -> PathBuf {
match (
std::env::var(ELASTIC_OTEL_LOG_DIRECTORY_ENV_VAR),
std::env::var(OTEL_DOTNET_AUTO_LOG_DIRECTORY_ENV_VAR),
std::env::var(ELASTIC_APM_PROFILER_LOG_DIR_ENV_VAR),
std::env::var(ELASTIC_APM_LOG_DIRECTORY_ENV_VAR),
) {
Expand Down

0 comments on commit cb7b9a1

Please sign in to comment.