Skip to content

Commit 9c8660d

Browse files
add start info message (#576)
* add start info message * import version properly * use only version without next, it could fall back to goagent still * use info log level for startup message * correct message * make variable public also fixed import --------- Co-authored-by: jordan gonzález <30836115+duncanista@users.noreply.github.com>
1 parent 35a7dbc commit 9c8660d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

bottlecap/src/bin/bottlecap/main.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ use bottlecap::{
2424
flusher::{build_fqdn_logs, Flusher as LogsFlusher},
2525
},
2626
secrets::decrypt,
27-
tags::{lambda, provider::Provider as TagProvider},
27+
tags::{
28+
lambda::{self, tags::EXTENSION_VERSION},
29+
provider::Provider as TagProvider,
30+
},
2831
telemetry::{
2932
self,
3033
client::TelemetryApiClient,
@@ -101,7 +104,7 @@ enum NextEventResponse {
101104
},
102105
}
103106

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

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

187190
enable_logging_subsystem(&config);
188-
let client = reqwest::Client::builder().no_proxy().build().map_err(|e| {
191+
let version_without_next = EXTENSION_VERSION.split('-').next().unwrap_or("NA");
192+
debug!("Starting Datadog Extension {version_without_next}");
193+
let client = Client::builder().no_proxy().build().map_err(|e| {
189194
Error::new(
190195
std::io::ErrorKind::InvalidData,
191196
format!("Failed to create client: {e:?}"),

bottlecap/src/tags/lambda/tags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const FUNCTION_TAGS_KEY: &str = "_dd.tags.function";
4545
// TODO(astuyve) decide what to do with the version
4646
const EXTENSION_VERSION_KEY: &str = "dd_extension_version";
4747
// TODO(duncanista) figure out a better way to not hardcode this
48-
const EXTENSION_VERSION: &str = "72-next";
48+
pub const EXTENSION_VERSION: &str = "72-next";
4949

5050
const REGION_KEY: &str = "region";
5151
const ACCOUNT_ID_KEY: &str = "account_id";

scripts/build_binary_and_layer_dockerized.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ function docker_build_zip {
6767
arch=$1
6868
suffix=$2
6969

70-
DOCKER_BUILDKIT=1
7170
docker buildx build --platform linux/${arch} \
7271
-t datadog/build-lambda-extension-${arch}:$VERSION \
7372
-f ./scripts/$BUILD_FILE \

0 commit comments

Comments
 (0)