@@ -208,6 +208,7 @@ impl TelemetryCrashUploader {
208208 "runtime-id" => runtime_id,
209209 "service_version" => service_version,
210210 "service" => service_name,
211+ "process_tags" => process_tags,
211212 ) ;
212213
213214 let application = Application {
@@ -220,6 +221,7 @@ impl TelemetryCrashUploader {
220221 . to_owned ( ) ,
221222 env : env. map ( ToOwned :: to_owned) ,
222223 service_version : service_version. map ( ToOwned :: to_owned) ,
224+ process_tags : process_tags. map ( ToOwned :: to_owned) ,
223225 ..Default :: default ( )
224226 } ;
225227
@@ -458,6 +460,16 @@ mod tests {
458460 . unwrap ( )
459461 }
460462
463+ fn new_test_uploader_with_process_tags ( seed : u64 , process_tags : & str ) -> TelemetryCrashUploader {
464+ let mut metadata = Metadata :: test_instance ( seed) ;
465+ metadata. tags . push ( format ! ( "process_tags:{process_tags}" ) ) ;
466+ TelemetryCrashUploader :: new (
467+ & metadata,
468+ & Some ( Endpoint :: from_slice ( "http://localhost:8126" ) ) ,
469+ )
470+ . unwrap ( )
471+ }
472+
461473 #[ test]
462474 #[ cfg_attr( miri, ignore) ]
463475 fn test_profiler_config_extraction ( ) {
@@ -467,6 +479,7 @@ mod tests {
467479 assert_eq ! ( metadata. application. service_name, "foo" ) ;
468480 assert_eq ! ( metadata. application. service_version. as_deref( ) , Some ( "bar" ) ) ;
469481 assert_eq ! ( metadata. application. language_name, "native" ) ;
482+ assert_eq ! ( metadata. application. process_tags, None ) ;
470483 assert_eq ! ( metadata. runtime_id, "xyz" ) ;
471484 let cfg = t. cfg ;
472485 assert_eq ! (
@@ -486,7 +499,10 @@ mod tests {
486499 p
487500 } ;
488501 let seed = 1 ;
489- let mut t = new_test_uploader ( seed) ;
502+ let mut t = new_test_uploader_with_process_tags (
503+ seed,
504+ "entrypoint.name:cli,entrypoint.type:script" ,
505+ ) ;
490506
491507 t. cfg
492508 . set_host_from_url ( & format ! ( "file://{}" , output_filename. to_str( ) . unwrap( ) ) )
@@ -501,6 +517,10 @@ mod tests {
501517 assert_eq ! ( payload[ "application" ] [ "language_name" ] , "native" ) ;
502518 assert_eq ! ( payload[ "application" ] [ "service_name" ] , "foo" ) ;
503519 assert_eq ! ( payload[ "application" ] [ "service_version" ] , "bar" ) ;
520+ assert_eq ! (
521+ payload[ "application" ] [ "process_tags" ] ,
522+ "entrypoint.name:cli,entrypoint.type:script"
523+ ) ;
504524 assert_eq ! ( payload[ "request_type" ] , "logs" ) ;
505525 assert_eq ! ( payload[ "tracer_time" ] , 1568898000 ) ;
506526 assert_eq ! ( payload[ "origin" ] , "Crashtracker" ) ;
0 commit comments