@@ -33,8 +33,6 @@ use std::task::{Context, Poll};
3333
3434// A tentative name for the error logs.
3535pub const NAME : & str = "experimental.client.request.error" ;
36- // A tentative target for the error logs.
37- pub const TARGET : & str = "experimental.client.request" ;
3836
3937/// A future instrumented to generate the client request logs.
4038///
@@ -104,11 +102,11 @@ where
104102 }
105103 } ) ;
106104
107- // TODO(#4795) - use the correct name and target
108105 tracing:: event!(
109106 name: NAME ,
110- target: TARGET ,
107+ target: NAME , // Default fallback target
111108 tracing:: Level :: WARN ,
109+ otel_target = snapshot. client_artifact( ) ,
112110 { RPC_SYSTEM_NAME } = snapshot. rpc_system( ) ,
113111 { RPC_SERVICE } = snapshot. service_name( ) ,
114112 { RPC_METHOD } = snapshot. rpc_method( ) ,
@@ -206,13 +204,14 @@ mod tests {
206204 assert ! ( object. remove( "timestamp" ) . is_some( ) , "{parsed:?}" ) ;
207205 let want = json ! ( {
208206 "level" : "WARN" ,
209- "target" : "experimental.client.request" ,
207+ "target" : NAME ,
210208 } ) ;
211209 assert_eq ! ( Some ( & object) , want. as_object( ) , "{parsed:?}" ) ;
212210
213211 // Don't care about the formatted message, this is not a test for Error formatting.
214212 assert ! ( fields. remove( "message" ) . is_some( ) , "{parsed:?}" ) ;
215213 let want = json ! ( {
214+ "otel_target" : "test-artifact" ,
216215 "error.type" : "CLIENT_CONNECTION_ERROR" ,
217216 "rpc.system.name" : "http" ,
218217 "rpc.method" : TEST_METHOD ,
@@ -268,13 +267,14 @@ mod tests {
268267 assert ! ( object. remove( "timestamp" ) . is_some( ) , "{parsed:?}" ) ;
269268 let want = json ! ( {
270269 "level" : "WARN" ,
271- "target" : "experimental.client.request" ,
270+ "target" : NAME ,
272271 } ) ;
273272 assert_eq ! ( Some ( & object) , want. as_object( ) , "{parsed:?}" ) ;
274273
275274 // Don't care about the formatted message, this is not a test for Error formatting.
276275 assert ! ( fields. remove( "message" ) . is_some( ) , "{parsed:?}" ) ;
277276 let want = json ! ( {
277+ "otel_target" : "test-artifact" ,
278278 "rpc.system.name" : "http" ,
279279 "rpc.method" : TEST_METHOD ,
280280 "rpc.service" : "test-service" ,
0 commit comments