Skip to content

Commit

Permalink
Make flush interval in telemetry configurable via sidecar (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
cataphract authored Jul 11, 2024
1 parent ccc5efc commit 6a145ea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sidecar-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ pub unsafe extern "C" fn ddog_sidecar_session_set_config(
agent_endpoint: &Endpoint,
dogstatsd_endpoint: &Endpoint,
flush_interval_milliseconds: u64,
telemetry_heartbeat_interval_millis: u64,
force_flush_size: usize,
force_drop_size: usize,
log_level: ffi::CharSlice,
Expand All @@ -442,6 +443,9 @@ pub unsafe extern "C" fn ddog_sidecar_session_set_config(
endpoint: agent_endpoint.clone(),
dogstatsd_endpoint: dogstatsd_endpoint.clone(),
flush_interval: Duration::from_millis(flush_interval_milliseconds),
telemetry_heartbeat_interval: Duration::from_millis(
telemetry_heartbeat_interval_millis
),
force_flush_size,
force_drop_size,
log_level: log_level.to_utf8_lossy().into(),
Expand Down
2 changes: 2 additions & 0 deletions sidecar-ffi/tests/sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ fn test_ddog_sidecar_register_app() {
},
&Endpoint::default(),
1000,
60000,
1000000,
10000000,
"".into(),
Expand Down Expand Up @@ -134,6 +135,7 @@ fn test_ddog_sidecar_register_app() {
},
&Endpoint::default(),
1000,
60000,
1000000,
10000000,
"".into(),
Expand Down
1 change: 1 addition & 0 deletions sidecar/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub struct SessionConfig {
pub endpoint: Endpoint,
pub dogstatsd_endpoint: Endpoint,
pub flush_interval: Duration,
pub telemetry_heartbeat_interval: Duration,
pub force_flush_size: usize,
pub force_drop_size: usize,
pub log_level: String,
Expand Down
1 change: 1 addition & 0 deletions sidecar/src/service/sidecar_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ impl SidecarInterface for SidecarServer {
let endpoint =
get_product_endpoint(ddtelemetry::config::PROD_INTAKE_SUBDOMAIN, &config.endpoint);
cfg.set_endpoint(endpoint).ok();
cfg.telemetry_hearbeat_interval = config.telemetry_heartbeat_interval;
});
session.modify_trace_config(|cfg| {
let endpoint = get_product_endpoint(
Expand Down

0 comments on commit 6a145ea

Please sign in to comment.