Skip to content

Commit a385037

Browse files
committed
update semconv for appender log
1 parent 86f291b commit a385037

File tree

1 file changed

+6
-4
lines changed
  • opentelemetry-appender-log/src

1 file changed

+6
-4
lines changed

opentelemetry-appender-log/src/lib.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ use opentelemetry::{
116116
InstrumentationScope, Key,
117117
};
118118
#[cfg(feature = "experimental_metadata_attributes")]
119-
use opentelemetry_semantic_conventions::attribute::{CODE_FILEPATH, CODE_LINENO, CODE_NAMESPACE};
119+
use opentelemetry_semantic_conventions::attribute::{
120+
CODE_FILEPATH, CODE_LINE_NUMBER, CODE_NAMESPACE,
121+
};
120122

121123
pub struct OpenTelemetryLogBridge<P, L>
122124
where
@@ -158,7 +160,7 @@ where
158160
}
159161

160162
if let Some(line_no) = record.line() {
161-
log_record.add_attribute(Key::new(CODE_LINENO), AnyValue::from(line_no));
163+
log_record.add_attribute(Key::new(CODE_LINE_NUMBER), AnyValue::from(line_no));
162164
}
163165

164166
if let Some(module) = record.module_path() {
@@ -1171,7 +1173,7 @@ mod tests {
11711173
#[test]
11721174
fn logbridge_code_attributes() {
11731175
use opentelemetry_semantic_conventions::attribute::{
1174-
CODE_FILEPATH, CODE_LINENO, CODE_NAMESPACE,
1176+
CODE_FILEPATH, CODE_LINE_NUMBER, CODE_NAMESPACE,
11751177
};
11761178

11771179
let exporter = InMemoryLogExporter::default();
@@ -1212,7 +1214,7 @@ mod tests {
12121214
Some(AnyValue::String(StringValue::from("service"))),
12131215
get(CODE_NAMESPACE)
12141216
);
1215-
assert_eq!(Some(AnyValue::Int(101)), get(CODE_LINENO));
1217+
assert_eq!(Some(AnyValue::Int(101)), get(CODE_LINE_NUMBER));
12161218
}
12171219

12181220
#[test]

0 commit comments

Comments
 (0)