@@ -34,8 +34,10 @@ public static final <T> T runBlocking(CoroutineContext context, Function2<? supe
3434 String name = Utils .getCoroutineName (context );
3535 if (name != null ) {
3636 NewRelic .getAgent ().getTracedMethod ().setMetricName ("Custom" ,"Builders" ,"runBlocking" ,name );
37+ NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("CoroutineName" , name );
3738 } else {
3839 NewRelic .getAgent ().getTracedMethod ().setMetricName ("Custom" ,"Builders" ,"runBlocking" );
40+ NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("CoroutineName" , "Could not determine" );
3941 }
4042 NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("Block" , block .toString ());
4143
@@ -50,14 +52,18 @@ public static final <T> T runBlocking(CoroutineContext context, Function2<? supe
5052 @ Trace (dispatcher = true )
5153 public static final <T > Deferred <T > async (CoroutineScope scope , CoroutineContext context , CoroutineStart cStart , Function2 <? super CoroutineScope , ? super Continuation <? super T >, ? extends Object > block ) {
5254 if (!Utils .ignoreScope (scope )) {
55+ NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("CoroutineStart" , cStart .name ());
56+ NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("CoroutineScope-Class" , scope .getClass ().getName ());
5357 String name = Utils .getCoroutineName (context );
5458 if (name == null ) {
5559 name = Utils .getCoroutineName (scope .getCoroutineContext ());
5660 }
5761 if (name != null ) {
5862 NewRelic .getAgent ().getTracedMethod ().setMetricName ("Custom" ,"Builders" ,"async" ,name );
63+ NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("CoroutineName" , name );
5964 } else {
6065 NewRelic .getAgent ().getTracedMethod ().setMetricName ("Custom" ,"Builders" ,"async" );
66+ NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("CoroutineName" , "Could not determine" );
6167 }
6268
6369 Token token = Utils .getToken (context );
@@ -111,8 +117,10 @@ public static final kotlinx.coroutines.Job launch(CoroutineScope scope, Coroutin
111117 }
112118 if (name != null ) {
113119 NewRelic .getAgent ().getTracedMethod ().setMetricName ("Custom" , "Builders" , "launch" , name );
120+ NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("CoroutineName" , name );
114121 } else {
115122 NewRelic .getAgent ().getTracedMethod ().setMetricName ("Custom" , "Builders" , "launch" );
123+ NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("CoroutineName" , "Could not determine" );
116124 }
117125 NewRelic .getAgent ().getTracedMethod ().addCustomAttribute ("Block" , block .toString ());
118126 Token token = Utils .getToken (context );
0 commit comments