Skip to content

Commit 45f4d7c

Browse files
authored
chore: bump semantic convention 1.30.0 (#2572)
1 parent 3ec4c18 commit 45f4d7c

File tree

7 files changed

+1388
-331
lines changed

7 files changed

+1388
-331
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]

opentelemetry-semantic-conventions/scripts/generate-consts-from-spec.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55
CRATE_DIR="${SCRIPT_DIR}/../"
66

77
# freeze the spec version and generator version to make generation reproducible
8-
SPEC_VERSION=1.29.0
9-
WEAVER_VERSION=v0.11.0
8+
SPEC_VERSION=1.30.0
9+
WEAVER_VERSION=v0.12.0
1010

1111
cd "$CRATE_DIR"
1212

@@ -48,7 +48,14 @@ expression='
4848
s/\[([a-zA-Z0-9\.\s]+,[a-zA-Z0-9\.\s]+)\]/\\[\1\\]/g
4949
s/\\\[([^\]]+)\]\(([^)]+)\)/[\1](\2)/g
5050
'
51+
52+
# TODO - remove this with semconv 1.31.0. Refer: https://github.com/open-telemetry/semantic-conventions/pull/1827
53+
# Fix broken and malformed K8s JobSpec link
54+
link_fix_expression='s/\\\[K8s JobSpec\\\]\(https:\/\/kubernetes\.io\/docs\/reference\/generated\/kubernetes-api\/v1\.30\/#jobspec-v1-batch\./[K8s JobSpec](https:\/\/kubernetes\.io\/docs\/reference\/generated\/kubernetes-api\/v1\.30\/#jobspec-v1-batch)./g'
55+
5156
"${SED[@]}" -E "${expression}" src/metric.rs
5257
"${SED[@]}" -E "${expression}" src/attribute.rs
58+
"${SED[@]}" -E "${link_fix_expression}" src/metric.rs
59+
5360

5461
cargo fmt

opentelemetry-semantic-conventions/scripts/templates/registry/rust/weaver.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ comment_formats:
1414
default_comment_format: rust
1515

1616
params:
17-
schema_url: "https://opentelemetry.io/schemas/1.29.0"
17+
schema_url: "https://opentelemetry.io/schemas/1.30.0"
1818
exclude_root_namespace: []
1919
excluded_attributes: ["messaging.client_id"]
2020

0 commit comments

Comments
 (0)