Skip to content

Commit

Permalink
fix(datadog_metrics sink): evaluate series v1 env var at runtime (vec…
Browse files Browse the repository at this point in the history
…tordotdev#19148)

fix(datadog_metrics sink): evaluate v1 env var at runtime
  • Loading branch information
neuronull authored and AndrooTheChen committed Sep 23, 2024
1 parent 5f48cae commit 091953b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sinks/datadog/metrics/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ impl SeriesApiVersion {
}
fn get_api_version_backwards_compatible() -> Self {
static API_VERSION: OnceLock<SeriesApiVersion> = OnceLock::new();
*API_VERSION.get_or_init(
|| match option_env!("VECTOR_TEMP_USE_DD_METRICS_SERIES_V1_API") {
Some(_) => Self::V1,
None => Self::V2,
},
)
*API_VERSION.get_or_init(|| {
match std::env::var("VECTOR_TEMP_USE_DD_METRICS_SERIES_V1_API") {
Ok(_) => Self::V1,
Err(_) => Self::V2,
}
})
}
}

Expand Down

0 comments on commit 091953b

Please sign in to comment.