@@ -117,7 +117,7 @@ use opentelemetry::{
117
117
} ;
118
118
#[ cfg( feature = "experimental_metadata_attributes" ) ]
119
119
use opentelemetry_semantic_conventions:: attribute:: {
120
- CODE_FILEPATH , CODE_LINE_NUMBER , CODE_NAMESPACE ,
120
+ CODE_FILE_PATH , CODE_FUNCTION_NAME , CODE_LINE_NUMBER ,
121
121
} ;
122
122
123
123
pub struct OpenTelemetryLogBridge < P , L >
@@ -156,7 +156,7 @@ where
156
156
{
157
157
if let Some ( filepath) = record. file ( ) {
158
158
log_record. add_attribute (
159
- Key :: new ( CODE_FILEPATH ) ,
159
+ Key :: new ( CODE_FILE_PATH ) ,
160
160
AnyValue :: from ( filepath. to_string ( ) ) ,
161
161
) ;
162
162
}
@@ -167,7 +167,7 @@ where
167
167
168
168
if let Some ( module) = record. module_path ( ) {
169
169
log_record. add_attribute (
170
- Key :: new ( CODE_NAMESPACE ) ,
170
+ Key :: new ( CODE_FUNCTION_NAME ) ,
171
171
AnyValue :: from ( module. to_string ( ) ) ,
172
172
) ;
173
173
}
@@ -1180,7 +1180,7 @@ mod tests {
1180
1180
#[ test]
1181
1181
fn logbridge_code_attributes ( ) {
1182
1182
use opentelemetry_semantic_conventions:: attribute:: {
1183
- CODE_FILEPATH , CODE_LINE_NUMBER , CODE_NAMESPACE ,
1183
+ CODE_FILE_PATH , CODE_FUNCTION_NAME , CODE_LINE_NUMBER ,
1184
1184
} ;
1185
1185
1186
1186
let exporter = InMemoryLogExporter :: default ( ) ;
@@ -1219,11 +1219,11 @@ mod tests {
1219
1219
1220
1220
assert_eq ! (
1221
1221
Some ( AnyValue :: String ( StringValue :: from( "src/main.rs" ) ) ) ,
1222
- get( CODE_FILEPATH )
1222
+ get( CODE_FILE_PATH )
1223
1223
) ;
1224
1224
assert_eq ! (
1225
1225
Some ( AnyValue :: String ( StringValue :: from( "service" ) ) ) ,
1226
- get( CODE_NAMESPACE )
1226
+ get( CODE_FUNCTION_NAME )
1227
1227
) ;
1228
1228
assert_eq ! ( Some ( AnyValue :: Int ( 101 ) ) , get( CODE_LINE_NUMBER ) ) ;
1229
1229
}
0 commit comments