Skip to content

Commit 69ceb62

Browse files
committed
fix
1 parent 9a9052a commit 69ceb62

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,10 @@ expression='
5252
"${SED[@]}" -E "${expression}" src/metric.rs
5353
"${SED[@]}" -E "${expression}" src/attribute.rs
5454

55+
# Fix unclosed HTML tag warnings for <key> in doc comments.
56+
# Rustdoc treats <key> as an unclosed HTML tag and fails the build with -D warnings.
57+
# We replace <key> with Markdown code formatting `key` to prevent the error.
58+
# TODO: This workaround should be removed once the upstream generator handles this correctly.
59+
"${SED[@]}" 's/<key>/`key`/g' src/attribute.rs
60+
5561
cargo fmt

opentelemetry-semantic-conventions/src/attribute.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ pub const CONTAINER_IMAGE_REPO_DIGESTS: &str = "container.image.repo_digests";
17591759
#[cfg(feature = "semconv_experimental")]
17601760
pub const CONTAINER_IMAGE_TAGS: &str = "container.image.tags";
17611761

1762-
/// Container labels, `<key>` being the label name, the value being the label value.
1762+
/// Container labels, ``key`` being the label name, the value being the label value.
17631763
///
17641764
/// ## Notes
17651765
///
@@ -2263,7 +2263,7 @@ pub const DB_OPERATION_BATCH_SIZE: &str = "db.operation.batch.size";
22632263
/// - `"SELECT"`
22642264
pub const DB_OPERATION_NAME: &str = "db.operation.name";
22652265

2266-
/// A database operation parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value.
2266+
/// A database operation parameter, with ``key`` being the parameter name, and the attribute value being a string representation of the parameter value.
22672267
///
22682268
/// ## Notes
22692269
///
@@ -2280,7 +2280,7 @@ pub const DB_OPERATION_NAME: &str = "db.operation.name";
22802280
#[cfg(feature = "semconv_experimental")]
22812281
pub const DB_OPERATION_PARAMETER: &str = "db.operation.parameter";
22822282

2283-
/// A database query parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value.
2283+
/// A database query parameter, with ``key`` being the parameter name, and the attribute value being a string representation of the parameter value.
22842284
///
22852285
/// ## Notes
22862286
///
@@ -4216,7 +4216,7 @@ pub const HTTP_METHOD: &str = "http.method";
42164216
#[cfg(feature = "semconv_experimental")]
42174217
pub const HTTP_REQUEST_BODY_SIZE: &str = "http.request.body.size";
42184218

4219-
/// HTTP request headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.
4219+
/// HTTP request headers, ``key`` being the normalized HTTP Header name (lowercase), the value being the header values.
42204220
///
42214221
/// ## Notes
42224222
///
@@ -4301,15 +4301,15 @@ pub const HTTP_REQUEST_RESEND_COUNT: &str = "http.request.resend_count";
43014301
#[cfg(feature = "semconv_experimental")]
43024302
pub const HTTP_REQUEST_SIZE: &str = "http.request.size";
43034303

4304-
/// Deprecated, use `http.request.header.<key>` instead.
4304+
/// Deprecated, use `http.request.header.`key`` instead.
43054305
///
43064306
/// ## Notes
43074307
///
43084308
/// # Examples
43094309
///
43104310
/// - `3495`
43114311
#[cfg(feature = "semconv_experimental")]
4312-
#[deprecated(note = "{note: Replaced by `http.request.header.<key>`., reason: uncategorized}")]
4312+
#[deprecated(note = "{note: Replaced by `http.request.header.`key``., reason: uncategorized}")]
43134313
pub const HTTP_REQUEST_CONTENT_LENGTH: &str = "http.request_content_length";
43144314

43154315
/// Deprecated, use `http.request.body.size` instead.
@@ -4334,7 +4334,7 @@ pub const HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: &str =
43344334
#[cfg(feature = "semconv_experimental")]
43354335
pub const HTTP_RESPONSE_BODY_SIZE: &str = "http.response.body.size";
43364336

4337-
/// HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.
4337+
/// HTTP response headers, ``key`` being the normalized HTTP Header name (lowercase), the value being the header values.
43384338
///
43394339
/// ## Notes
43404340
///
@@ -4379,15 +4379,15 @@ pub const HTTP_RESPONSE_SIZE: &str = "http.response.size";
43794379
/// - `200`
43804380
pub const HTTP_RESPONSE_STATUS_CODE: &str = "http.response.status_code";
43814381

4382-
/// Deprecated, use `http.response.header.<key>` instead.
4382+
/// Deprecated, use `http.response.header.`key`` instead.
43834383
///
43844384
/// ## Notes
43854385
///
43864386
/// # Examples
43874387
///
43884388
/// - `3495`
43894389
#[cfg(feature = "semconv_experimental")]
4390-
#[deprecated(note = "{note: Replaced by `http.response.header.<key>`., reason: uncategorized}")]
4390+
#[deprecated(note = "{note: Replaced by `http.response.header.`key``., reason: uncategorized}")]
43914391
pub const HTTP_RESPONSE_CONTENT_LENGTH: &str = "http.response_content_length";
43924392

43934393
/// Deprecated, use `http.response.body.size` instead.
@@ -4703,7 +4703,7 @@ pub const K8S_CONTAINER_RESTART_COUNT: &str = "k8s.container.restart_count";
47034703
pub const K8S_CONTAINER_STATUS_LAST_TERMINATED_REASON: &str =
47044704
"k8s.container.status.last_terminated_reason";
47054705

4706-
/// The cronjob annotation placed on the CronJob, the `<key>` being the annotation name, the value being the annotation value.
4706+
/// The cronjob annotation placed on the CronJob, the ``key`` being the annotation name, the value being the annotation value.
47074707
///
47084708
/// ## Notes
47094709
///
@@ -4721,7 +4721,7 @@ pub const K8S_CONTAINER_STATUS_LAST_TERMINATED_REASON: &str =
47214721
#[cfg(feature = "semconv_experimental")]
47224722
pub const K8S_CRONJOB_ANNOTATION: &str = "k8s.cronjob.annotation";
47234723

4724-
/// The label placed on the CronJob, the `<key>` being the label name, the value being the label value.
4724+
/// The label placed on the CronJob, the ``key`` being the label name, the value being the label value.
47254725
///
47264726
/// ## Notes
47274727
///
@@ -4967,7 +4967,7 @@ pub const K8S_NAMESPACE_NAME: &str = "k8s.namespace.name";
49674967
#[cfg(feature = "semconv_experimental")]
49684968
pub const K8S_NAMESPACE_PHASE: &str = "k8s.namespace.phase";
49694969

4970-
/// The annotation placed on the Node, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.
4970+
/// The annotation placed on the Node, the ``key`` being the annotation name, the value being the annotation value, even if the value is empty.
49714971
///
49724972
/// ## Notes
49734973
///
@@ -4985,7 +4985,7 @@ pub const K8S_NAMESPACE_PHASE: &str = "k8s.namespace.phase";
49854985
#[cfg(feature = "semconv_experimental")]
49864986
pub const K8S_NODE_ANNOTATION: &str = "k8s.node.annotation";
49874987

4988-
/// The label placed on the Node, the `<key>` being the label name, the value being the label value, even if the value is empty.
4988+
/// The label placed on the Node, the ``key`` being the label name, the value being the label value, even if the value is empty.
49894989
///
49904990
/// ## Notes
49914991
///
@@ -5023,7 +5023,7 @@ pub const K8S_NODE_NAME: &str = "k8s.node.name";
50235023
#[cfg(feature = "semconv_experimental")]
50245024
pub const K8S_NODE_UID: &str = "k8s.node.uid";
50255025

5026-
/// The annotation placed on the Pod, the `<key>` being the annotation name, the value being the annotation value.
5026+
/// The annotation placed on the Pod, the ``key`` being the annotation name, the value being the annotation value.
50275027
///
50285028
/// ## Notes
50295029
///
@@ -5044,7 +5044,7 @@ pub const K8S_NODE_UID: &str = "k8s.node.uid";
50445044
#[cfg(feature = "semconv_experimental")]
50455045
pub const K8S_POD_ANNOTATION: &str = "k8s.pod.annotation";
50465046

5047-
/// The label placed on the Pod, the `<key>` being the label name, the value being the label value.
5047+
/// The label placed on the Pod, the ``key`` being the label name, the value being the label value.
50485048
///
50495049
/// ## Notes
50505050
///
@@ -6472,7 +6472,7 @@ pub const PROCESS_CPU_STATE: &str = "process.cpu.state";
64726472
#[cfg(feature = "semconv_experimental")]
64736473
pub const PROCESS_CREATION_TIME: &str = "process.creation.time";
64746474

6475-
/// Process environment variables, <key> being the environment variable name, the value being the environment variable value.
6475+
/// Process environment variables, `key` being the environment variable name, the value being the environment variable value.
64766476
///
64776477
/// ## Notes
64786478
///
@@ -6791,7 +6791,7 @@ pub const PROFILE_FRAME_TYPE: &str = "profile.frame.type";
67916791
#[cfg(feature = "semconv_experimental")]
67926792
pub const RPC_CONNECT_RPC_ERROR_CODE: &str = "rpc.connect_rpc.error_code";
67936793

6794-
/// Connect request metadata, `<key>` being the normalized Connect Metadata key (lowercase), the value being the metadata values.
6794+
/// Connect request metadata, ``key`` being the normalized Connect Metadata key (lowercase), the value being the metadata values.
67956795
///
67966796
/// ## Notes
67976797
///
@@ -6807,7 +6807,7 @@ pub const RPC_CONNECT_RPC_ERROR_CODE: &str = "rpc.connect_rpc.error_code";
68076807
#[cfg(feature = "semconv_experimental")]
68086808
pub const RPC_CONNECT_RPC_REQUEST_METADATA: &str = "rpc.connect_rpc.request.metadata";
68096809

6810-
/// Connect response metadata, `<key>` being the normalized Connect Metadata key (lowercase), the value being the metadata values.
6810+
/// Connect response metadata, ``key`` being the normalized Connect Metadata key (lowercase), the value being the metadata values.
68116811
///
68126812
/// ## Notes
68136813
///
@@ -6823,7 +6823,7 @@ pub const RPC_CONNECT_RPC_REQUEST_METADATA: &str = "rpc.connect_rpc.request.meta
68236823
#[cfg(feature = "semconv_experimental")]
68246824
pub const RPC_CONNECT_RPC_RESPONSE_METADATA: &str = "rpc.connect_rpc.response.metadata";
68256825

6826-
/// gRPC request metadata, `<key>` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.
6826+
/// gRPC request metadata, ``key`` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.
68276827
///
68286828
/// ## Notes
68296829
///
@@ -6839,7 +6839,7 @@ pub const RPC_CONNECT_RPC_RESPONSE_METADATA: &str = "rpc.connect_rpc.response.me
68396839
#[cfg(feature = "semconv_experimental")]
68406840
pub const RPC_GRPC_REQUEST_METADATA: &str = "rpc.grpc.request.metadata";
68416841

6842-
/// gRPC response metadata, `<key>` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.
6842+
/// gRPC response metadata, ``key`` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.
68436843
///
68446844
/// ## Notes
68456845
///

0 commit comments

Comments
 (0)