Skip to content

Commit 10f803c

Browse files
authored
feat: Optionally disable proc enhanced metrics (#663)
Fixes #648 For customers using very very fast/small lambda functions (usually just rust), there can be a small 1-2ms increase in runtime duration when collecing metrics like open file descriptors or tmp file usage. We still enable these by default, but customers can now optionally disable them
1 parent 4c79f46 commit 10f803c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

bottlecap/src/config/env.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub struct Config {
3838
pub logs_config_logs_dd_url: String,
3939
pub serverless_flush_strategy: FlushStrategy,
4040
pub enhanced_metrics: bool,
41+
pub lambda_proc_enhanced_metrics: bool,
4142
/// Flush timeout in seconds
4243
pub flush_timeout: u64, //TODO go agent adds jitter too
4344
pub https_proxy: Option<String>,
@@ -129,6 +130,7 @@ impl Default for Config {
129130
logs_config_logs_dd_url: String::default(),
130131
// Metrics
131132
enhanced_metrics: true,
133+
lambda_proc_enhanced_metrics: true,
132134
https_proxy: None,
133135
capture_lambda_payload: false,
134136
capture_lambda_payload_max_depth: 10,

bottlecap/src/lifecycle/invocation/processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl Processor {
126126
.unwrap_or_default();
127127
self.set_init_tags();
128128

129-
if self.config.enhanced_metrics {
129+
if self.config.lambda_proc_enhanced_metrics {
130130
// Collect offsets for network and cpu metrics
131131
let network_offset: Option<NetworkData> = proc::get_network_data().ok();
132132
let cpu_offset: Option<CPUData> = proc::get_cpu_data().ok();

0 commit comments

Comments
 (0)