Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions bottlecap/src/bin/bottlecap/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ use bottlecap::{
flusher::{build_fqdn_logs, Flusher as LogsFlusher},
},
secrets::decrypt,
tags::{lambda, provider::Provider as TagProvider},
tags::{
lambda::{self, tags::EXTENSION_VERSION},
provider::Provider as TagProvider,
},
telemetry::{
self,
client::TelemetryApiClient,
Expand Down Expand Up @@ -101,7 +104,7 @@ enum NextEventResponse {
},
}

async fn next_event(client: &reqwest::Client, ext_id: &str) -> Result<NextEventResponse> {
async fn next_event(client: &Client, ext_id: &str) -> Result<NextEventResponse> {
let base_url = base_url(EXTENSION_ROUTE)
.map_err(|e| Error::new(std::io::ErrorKind::InvalidData, e.to_string()))?;
let url = format!("{base_url}/event/next");
Expand Down Expand Up @@ -136,7 +139,7 @@ async fn next_event(client: &reqwest::Client, ext_id: &str) -> Result<NextEventR
})
}

async fn register(client: &reqwest::Client) -> Result<RegisterResponse> {
async fn register(client: &Client) -> Result<RegisterResponse> {
let mut map = HashMap::new();
let base_url = base_url(EXTENSION_ROUTE)
.map_err(|e| Error::new(std::io::ErrorKind::InvalidData, e.to_string()))?;
Expand Down Expand Up @@ -185,7 +188,9 @@ async fn main() -> Result<()> {
let (mut aws_config, config) = load_configs();

enable_logging_subsystem(&config);
let client = reqwest::Client::builder().no_proxy().build().map_err(|e| {
let version_without_next = EXTENSION_VERSION.split('-').next().unwrap_or("NA");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why without next?

Copy link
Copy Markdown
Contributor Author

@alexgallotta alexgallotta Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was because the print was done before the fallback code.
It might still be clearer to avoid adding the -next suffix since it's not how we present the versions, but I don't really have a strong opinion on that, happy to change if you think it's more clean

debug!("Starting Datadog Extension {version_without_next}");
let client = Client::builder().no_proxy().build().map_err(|e| {
Error::new(
std::io::ErrorKind::InvalidData,
format!("Failed to create client: {e:?}"),
Expand Down
2 changes: 1 addition & 1 deletion bottlecap/src/tags/lambda/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const FUNCTION_TAGS_KEY: &str = "_dd.tags.function";
// TODO(astuyve) decide what to do with the version
const EXTENSION_VERSION_KEY: &str = "dd_extension_version";
// TODO(duncanista) figure out a better way to not hardcode this
const EXTENSION_VERSION: &str = "72-next";
pub const EXTENSION_VERSION: &str = "72-next";

const REGION_KEY: &str = "region";
const ACCOUNT_ID_KEY: &str = "account_id";
Expand Down
1 change: 0 additions & 1 deletion scripts/build_binary_and_layer_dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function docker_build_zip {
arch=$1
suffix=$2

DOCKER_BUILDKIT=1
Comment thread
alexgallotta marked this conversation as resolved.
docker buildx build --platform linux/${arch} \
-t datadog/build-lambda-extension-${arch}:$VERSION \
-f ./scripts/$BUILD_FILE \
Expand Down
Loading