File tree Expand file tree Collapse file tree
datadog-sidecar/src/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -632,6 +632,8 @@ pub unsafe extern "C" fn ddog_sidecar_session_set_config(
632632 process_tags : & libdd_common_ffi:: Vec < Tag > ,
633633 hostname : ffi:: CharSlice ,
634634 root_service : ffi:: CharSlice ,
635+ root_session_id : ffi:: CharSlice ,
636+ parent_session_id : ffi:: CharSlice ,
635637) -> MaybeError {
636638 let session_id_str: String = session_id. to_utf8_lossy ( ) . into ( ) ;
637639 let session_config = SessionConfig {
@@ -676,6 +678,16 @@ pub unsafe extern "C" fn ddog_sidecar_session_set_config(
676678 span_kinds_stats_computed : vec ! [ ] ,
677679 hostname : hostname. to_utf8_lossy ( ) . into ( ) ,
678680 root_service : root_service. to_utf8_lossy ( ) . into ( ) ,
681+ root_session_id : if root_session_id. is_empty ( ) {
682+ None
683+ } else {
684+ Some ( root_session_id. to_utf8_lossy ( ) . into ( ) )
685+ } ,
686+ parent_session_id : if parent_session_id. is_empty ( ) {
687+ None
688+ } else {
689+ Some ( parent_session_id. to_utf8_lossy ( ) . into ( ) )
690+ } ,
679691 } ;
680692 #[ cfg( unix) ]
681693 try_c ! ( blocking:: set_session_config(
Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ fn test_ddog_sidecar_register_app() {
113113 & process_tags,
114114 "" . into ( ) ,
115115 "" . into ( ) ,
116+ None ,
117+ None ,
116118 )
117119 . unwrap_none ( ) ;
118120
@@ -167,6 +169,8 @@ fn test_ddog_sidecar_register_app() {
167169 & process_tags,
168170 "" . into ( ) ,
169171 "" . into ( ) ,
172+ None ,
173+ None ,
170174 )
171175 . unwrap_none ( ) ;
172176
Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ pub struct SessionConfig {
7373 pub hostname : String ,
7474 /// Process-level service name (from `DD_SERVICE`), used as the stats concentrator key.
7575 pub root_service : String ,
76+ pub root_session_id : Option < String > ,
77+ pub parent_session_id : Option < String > ,
7678}
7779
7880#[ derive( Debug , Deserialize , Serialize ) ]
Original file line number Diff line number Diff line change @@ -651,6 +651,9 @@ impl SidecarInterface for ConnectionSidecarHandler {
651651 cfg. telemetry_heartbeat_interval = config. telemetry_heartbeat_interval ;
652652 cfg. telemetry_extended_heartbeat_interval =
653653 config. telemetry_extended_heartbeat_interval ;
654+ cfg. session_id = Some ( session_id. clone ( ) ) ;
655+ cfg. parent_session_id = config. parent_session_id ;
656+ cfg. root_session_id = config. root_session_id ;
654657 } ) ;
655658 session. modify_trace_config ( |cfg| {
656659 let endpoint = get_product_endpoint (
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ impl TelemetryCachedClient {
103103 ) ;
104104
105105 builder. runtime_id = Some ( instance_id. runtime_id . clone ( ) ) ;
106+
106107 builder. application . env = Some ( env. to_string ( ) ) ;
107108 builder. application . process_tags = ( !process_tags. is_empty ( ) ) . then ( || {
108109 process_tags
You can’t perform that action at this time.
0 commit comments