diff --git a/CHANGELOG.md b/CHANGELOG.md index b7590d96..044c641c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,38 @@ All notable changes to this project will be documented in this file. +## [0.7.0] - 2024-07-22 + +What's Changed + +* Add support for new custom semconv JQ filters by @lquerel. +* Update Weaver Forge documentation and include a step-by-step guide for codegen authors by @lquerel. + +The following new filters have been added to the Weaver Forge: + +* `semconv_group_attributes_by_root_namespace`: Groups the attributes by their root namespace. +* `semconv_attributes($options)`: Extracts and processes semantic convention attributes based on provided options. $options is an object that can contain: + * `exclude_stability`: a list of stability statuses to exclude. + * `exclude_deprecated`: a boolean to exclude deprecated metrics. + * `exclude_root_namespace`: a list of root namespaces to exclude. +* `semconv_attributes`: Convenience function to extract all attributes without any filtering options. +* `semconv_grouped_attributes($options)`: Groups the processed attributes by their root namespace based on provided options. $options is an object that can contain: + * `exclude_stability`: a list of stability statuses to exclude. + * `exclude_deprecated`: a boolean to exclude deprecated metrics. + * `exclude_root_namespace`: a list of root namespaces to exclude. +* `semconv_grouped_attributes`: Convenience function to group all attributes by their root namespace without any filtering options. +* `semconv_group_metrics_by_root_namespace`: Groups the metrics by their root namespace. +* `semconv_metrics($options)`: Extracts and processes semantic convention metrics based on provided options. $options is an object that can contain: + * `exclude_stability`: a list of stability statuses to exclude. + * `exclude_deprecated`: a boolean to exclude deprecated metrics. + * `exclude_root_namespace`: a list of root namespaces to exclude. +* `semconv_metrics`: Convenience function to extract all metrics without any filtering options. +* `semconv_grouped_metrics($options)`: Groups the processed metrics by their root namespace based on provided options. $options is an object that can contain: + * `exclude_stability`: a list of stability statuses to exclude. + * `exclude_deprecated`: a boolean to exclude deprecated metrics. + * `exclude_root_namespace`: a list of root namespaces to exclude. +* `semconv_grouped_metrics`: Convenience function to group all metrics by their root namespace without any filtering options. + ## [0.6.0] - 2024-07-16 What's Changed diff --git a/Cargo.lock b/Cargo.lock index 91a35c17..aca807af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -293,18 +293,18 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "castaway" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" dependencies = [ "rustversion", ] [[package]] name = "cc" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" +checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" [[package]] name = "cfg-if" @@ -1338,9 +1338,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca987128ffb056d732bd545db5db3d8b103d252fbf083c2567bb0796876619a4" +checksum = "8d23d5bbda31344d8abc8de7c075b3cf26e5873feba7c4a15d916bce67382bd9" dependencies = [ "bstr", "gix-trace", @@ -1925,15 +1925,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -2075,9 +2066,9 @@ dependencies = [ [[package]] name = "kstring" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" +checksum = "e703acfd696000db3f6d1238e23b3d1f889192e1e439969c44e8423bb7a5655e" dependencies = [ "static_assertions", ] @@ -2462,9 +2453,9 @@ dependencies = [ [[package]] name = "opentelemetry_sdk" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a48618fd69580af9aeb349369c07f7ca9d3c30c3cd91dc274f2882a7a5a18599" +checksum = "692eac490ec80f24a17828d49b40b60f5aeaccdfe6a503f939713afd22bc28df" dependencies = [ "async-trait", "futures-channel", @@ -2736,14 +2727,13 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", "socket2", - "tracing", "windows-sys 0.52.0", ] @@ -3085,9 +3075,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ "ring", "rustls-pki-types", @@ -3269,9 +3259,9 @@ dependencies = [ [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -3322,9 +3312,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "simple_asn1" @@ -3383,9 +3373,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "stability" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" +checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" dependencies = [ "quote", "syn", @@ -3454,9 +3444,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -3609,9 +3599,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", @@ -3817,11 +3807,12 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-truncate" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5fbabedabe362c618c714dbefda9927b5afc8e2a8102f47f081089a9019226" +checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" dependencies = [ - "itertools 0.12.1", + "itertools 0.13.0", + "unicode-segmentation", "unicode-width", ] @@ -4020,7 +4011,7 @@ dependencies = [ [[package]] name = "weaver" -version = "0.6.0" +version = "0.7.0" dependencies = [ "assert_cmd", "clap", @@ -4051,7 +4042,7 @@ dependencies = [ [[package]] name = "weaver_cache" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dirs", "gix", @@ -4064,7 +4055,7 @@ dependencies = [ [[package]] name = "weaver_checker" -version = "0.6.0" +version = "0.7.0" dependencies = [ "globset", "miette", @@ -4079,7 +4070,7 @@ dependencies = [ [[package]] name = "weaver_codegen_test" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dirs", "opentelemetry 0.23.0", @@ -4093,7 +4084,7 @@ dependencies = [ [[package]] name = "weaver_common" -version = "0.6.0" +version = "0.7.0" dependencies = [ "miette", "paris", @@ -4104,7 +4095,7 @@ dependencies = [ [[package]] name = "weaver_diff" -version = "0.6.0" +version = "0.7.0" dependencies = [ "similar", "walkdir", @@ -4112,7 +4103,7 @@ dependencies = [ [[package]] name = "weaver_forge" -version = "0.6.0" +version = "0.7.0" dependencies = [ "convert_case", "dirs", @@ -4124,6 +4115,7 @@ dependencies = [ "jaq-interpret", "jaq-parse", "jaq-std", + "jaq-syn", "markdown", "miette", "minijinja", @@ -4148,7 +4140,7 @@ dependencies = [ [[package]] name = "weaver_resolved_schema" -version = "0.6.0" +version = "0.7.0" dependencies = [ "ordered-float", "schemars", @@ -4161,7 +4153,7 @@ dependencies = [ [[package]] name = "weaver_resolver" -version = "0.6.0" +version = "0.7.0" dependencies = [ "glob", "miette", @@ -4179,7 +4171,7 @@ dependencies = [ [[package]] name = "weaver_semconv" -version = "0.6.0" +version = "0.7.0" dependencies = [ "glob", "miette", @@ -4194,7 +4186,7 @@ dependencies = [ [[package]] name = "weaver_semconv_gen" -version = "0.6.0" +version = "0.7.0" dependencies = [ "itertools 0.13.0", "miette", @@ -4212,7 +4204,7 @@ dependencies = [ [[package]] name = "weaver_version" -version = "0.6.0" +version = "0.7.0" dependencies = [ "schemars", "semver", @@ -4421,9 +4413,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index c82dc912..e48adcad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver" -version = "0.6.0" +version = "0.7.0" authors = ["OpenTelemetry"] edition = "2021" repository = "https://github.com/open-telemetry/weaver" diff --git a/crates/weaver_cache/Cargo.toml b/crates/weaver_cache/Cargo.toml index ef08dde4..7acd11a3 100644 --- a/crates/weaver_cache/Cargo.toml +++ b/crates/weaver_cache/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_cache" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_checker/Cargo.toml b/crates/weaver_checker/Cargo.toml index 9104b6d5..fc114933 100644 --- a/crates/weaver_checker/Cargo.toml +++ b/crates/weaver_checker/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_checker" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_codegen_test/Cargo.toml b/crates/weaver_codegen_test/Cargo.toml index eb3feaba..dae1928b 100644 --- a/crates/weaver_codegen_test/Cargo.toml +++ b/crates/weaver_codegen_test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_codegen_test" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_codegen_test/build.rs b/crates/weaver_codegen_test/build.rs index 0a958927..9f82f2ac 100644 --- a/crates/weaver_codegen_test/build.rs +++ b/crates/weaver_codegen_test/build.rs @@ -16,7 +16,7 @@ use weaver_common::{in_memory, Logger}; use weaver_forge::config::{Params, WeaverConfig}; use weaver_forge::file_loader::FileSystemFileLoader; use weaver_forge::registry::ResolvedRegistry; -use weaver_forge::{OutputDirective, TemplateEngine}; +use weaver_forge::{OutputDirective, TemplateEngine, SEMCONV_JQ}; use weaver_resolver::SchemaResolver; use weaver_semconv::path::RegistryPath; use weaver_semconv::registry::SemConvRegistry; @@ -53,7 +53,10 @@ fn main() { .unwrap_or_else(|e| process_error(&logger, e)); let config = WeaverConfig::try_from_path("./templates/registry/rust") .unwrap_or_else(|e| process_error(&logger, e)); - let engine = TemplateEngine::new(config, loader, Params::default()); + let mut engine = TemplateEngine::new(config, loader, Params::default()); + engine + .import_jq_package(SEMCONV_JQ) + .unwrap_or_else(|e| process_error(&logger, e)); let template_registry = ResolvedRegistry::try_from_resolved_registry( schema .registry(REGISTRY_ID) diff --git a/crates/weaver_codegen_test/templates/registry/alt_weaver.yaml b/crates/weaver_codegen_test/templates/registry/alt_weaver.yaml index 21edcbda..c0380e85 100644 --- a/crates/weaver_codegen_test/templates/registry/alt_weaver.yaml +++ b/crates/weaver_codegen_test/templates/registry/alt_weaver.yaml @@ -2,4 +2,4 @@ params: attributes: true metrics: false # With this alternate configuration, the metrics are disabled - registry_prefix: "registry." + exclude_deprecated: true \ No newline at end of file diff --git a/crates/weaver_codegen_test/templates/registry/rust/attribute_macros.j2 b/crates/weaver_codegen_test/templates/registry/rust/attribute_macros.j2 index 447c6b74..93074674 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/attribute_macros.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/attribute_macros.j2 @@ -1,60 +1,60 @@ {%- macro comments(attribute, prefix) -%} -{%- if attribute.brief %} + {% if attribute.brief %} {{ attribute.brief | comment_with_prefix(prefix ~ " ") }} -{%- endif %} -{%- if attribute.note %} + {% endif %} + {% if attribute.note %} {{ prefix }} {{ prefix }} Notes: {{ attribute.note | comment_with_prefix(prefix ~ " ") }} -{%- endif %} -{%- if attribute.examples %} -{%- if attribute.examples is sequence %} + {% endif %} + {% if attribute.examples %} + {% if attribute.examples is sequence %} {{ prefix }} {{ prefix }} Examples: -{%- for example in attribute.examples %} + {% for example in attribute.examples %} {{ example | comment_with_prefix(prefix ~ " - ") }} -{%- endfor %} -{%- else %} + {% endfor %} + {% else %} {{ prefix }} {{ prefix }} Example: {{ attribute.examples | trim }} -{%- endif %} -{%- endif %} -{%- endmacro %} + {% endif %} + {% endif %} +{% endmacro %} {%- macro attributes_to_key_values(required_attributes, not_required_attributes) -%} let mut attributes = vec![ - {%- for attribute in required_attributes | attribute_sort %} - {%- if attribute is experimental %} + {% for attribute in required_attributes | attribute_sort %} + {% if attribute is experimental %} #[cfg(feature = "semconv_experimental")] - {%- endif %} - {%- if attribute.type.members is defined %} + {% endif %} + {% if attribute.type.members is defined %} crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | screaming_snake_case }}.value(&required_attributes.{{ attribute.name | snake_case }}), - {%- elif attribute.type == "string" %} + {% elif attribute.type == "string" %} crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | screaming_snake_case }}.value(required_attributes.{{ attribute.name | snake_case }}.to_owned().into()), - {%- else %} + {% else %} crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | screaming_snake_case }}.value(required_attributes.{{ attribute.name | snake_case }}), - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} ]; if let Some(value) = ¬_required_attributes { - {%- for attribute in not_required_attributes | attribute_sort %} - {%- if attribute is experimental %} + {% for attribute in not_required_attributes | attribute_sort %} + {% if attribute is experimental %} #[cfg(feature = "semconv_experimental")] - {%- endif %} - {%- if attribute.type.members is defined %} + {% endif %} + {% if attribute.type.members is defined %} if let Some({{ attribute.name | snake_case }}) = &value.{{ attribute.name | snake_case }} { attributes.push(crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | screaming_snake_case }}.value({{ attribute.name | snake_case }})); } - {%- elif attribute.type == "string" %} + {% elif attribute.type == "string" %} if let Some({{ attribute.name | snake_case }}) = &value.{{ attribute.name | snake_case }} { attributes.push(crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | screaming_snake_case }}.value({{ attribute.name | snake_case }}.to_owned().into())); } - {%- else %} + {% else %} if let Some({{ attribute.name | snake_case }}) = value.{{ attribute.name | snake_case }} { attributes.push(crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | screaming_snake_case }}.value({{ attribute.name | snake_case }})); } - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {%- endmacro %} \ No newline at end of file diff --git a/crates/weaver_codegen_test/templates/registry/rust/attributes/attributes.rs.j2 b/crates/weaver_codegen_test/templates/registry/rust/attributes/attributes.rs.j2 index ee6de050..4d84ccd9 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/attributes/attributes.rs.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/attributes/attributes.rs.j2 @@ -1,4 +1,4 @@ -{%- set file_name = ctx.id | attribute_registry_namespace | snake_case -%} +{%- set file_name = ctx.root_namespace | snake_case -%} {{- template.set_file_name("attributes/" ~ file_name ~ ".rs") -}} {%- import 'attribute_macros.j2' as attribute_macros -%} @@ -7,42 +7,41 @@ * SPDX-License-Identifier: Apache-2.0 */ -{{ ctx.brief | comment_with_prefix("//! ") }} -{%- if ctx.note %} -//! -//! Notes: -{{ ctx.note | comment_with_prefix("//! ") }} -{%- endif %} //! DO NOT EDIT, THIS FILE HAS BEEN GENERATED BY WEAVER -{%- for attribute in ctx.attributes | attribute_sort %} -{{ attribute_macros.comments(attribute, "///") }} -{%- if attribute is experimental %} +{% for attribute in ctx.attributes | attribute_sort %} +{{ attribute_macros.comments(attribute, "///") -}} + {% if attribute is experimental %} #[cfg(feature = "semconv_experimental")] -{%- endif %} -{%- if attribute is deprecated %} + {% endif %} + {% if attribute is deprecated %} #[deprecated(note="{{ attribute.deprecated }}")] -{%- endif %} -{%- if attribute.type.allow_custom_values is defined %} + {% endif %} + {% if attribute.type.allow_custom_values is defined %} pub const {{ attribute.name | screaming_snake_case }}: crate::attributes::AttributeKey<{{ attribute.name | pascal_case }}> = crate::attributes::AttributeKey::new("{{ attribute.name }}"); -{%- elif attribute.type == "string" %} + {% elif attribute.type == "string" %} pub const {{ attribute.name | screaming_snake_case }}: crate::attributes::AttributeKey = crate::attributes::AttributeKey::new("{{ attribute.name }}"); -{%- else %} + {% else %} pub const {{ attribute.name | screaming_snake_case }}: crate::attributes::AttributeKey<{{ attribute.type | map_text("rust_types") }}> = crate::attributes::AttributeKey::new("{{ attribute.name }}"); -{%- endif %} -{%- if attribute.type.members is defined %} + {% endif %} -{% if attribute.brief %}{{ attribute.brief | comment_with_prefix("/// ") }}{%- endif %} + {% if attribute.type.members is defined %} + {% if attribute.brief %} +{{ attribute.brief | comment_with_prefix("/// ") }} + {% endif %} #[derive(Debug, Clone)] #[non_exhaustive] pub enum {{ attribute.name | pascal_case }} { -{%- for variant in attribute.type.members %} - {{ variant.brief | default("No brief") | comment_with_prefix(" /// ") }} - {%- if variant.note %}{{ variant.note | comment_with_prefix(" /// ") }}{% endif %} - {%- if variant is experimental %} - #[cfg(feature = "semconv_experimental")] {% endif %} + {% for variant in attribute.type.members %} + {{ variant.brief | default("No brief") | comment_with_prefix("/// ") }} + {% if variant.note %} + {{ variant.note | comment_with_prefix("/// ") }} + {% endif %} + {% if variant is experimental %} + #[cfg(feature = "semconv_experimental")] + {% endif %} {{ variant.id | pascal_case }}, -{%- endfor %} + {% endfor %} /// This variant allows defining a custom entry in the enum. _Custom(String), } @@ -52,11 +51,12 @@ impl {{ attribute.name | pascal_case }} { #[must_use] pub fn as_str(&self) -> &str { match self { - {%- for variant in attribute.type.members %} - {%- if variant is experimental %} - #[cfg(feature = "semconv_experimental")] {% endif %} + {% for variant in attribute.type.members %} + {% if variant is experimental %} + #[cfg(feature = "semconv_experimental")] + {% endif %} {{ attribute.name | pascal_case }}::{{ variant.id | pascal_case }} => "{{ variant.value }}", - {%- endfor %} + {% endfor %} {{ attribute.name | pascal_case }}::_Custom(v) => v.as_str(), // Without this default case, the match expression would not // contain any variants if all variants are annotated with the @@ -81,5 +81,6 @@ impl crate::attributes::AttributeKey<{{ attribute.name | pascal_case }}> { opentelemetry::KeyValue::new(self.key.clone(), v.to_string()) } } -{%- endif %} -{%- endfor %} \ No newline at end of file + + {% endif %} +{% endfor %} \ No newline at end of file diff --git a/crates/weaver_codegen_test/templates/registry/rust/attributes/mod.rs.j2 b/crates/weaver_codegen_test/templates/registry/rust/attributes/mod.rs.j2 index d5dc5f2d..1f19b39b 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/attributes/mod.rs.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/attributes/mod.rs.j2 @@ -12,10 +12,10 @@ use opentelemetry::{Key, KeyValue, StringValue}; pub const ATTRIBUTES_PARAM: bool = {{ params.attributes }}; -{% for group in ctx %} -/// Attributes for the `{{ group.id | attribute_registry_namespace }}` namespace. -pub mod {{ group.id | attribute_registry_namespace | snake_case }}; -{%- endfor %} +{% for attributes_root_namespace in ctx %} +/// Attributes for the `{{ attributes_root_namespace.root_namespace }}` namespace. +pub mod {{ attributes_root_namespace.root_namespace | snake_case }}; +{% endfor %} /// A typed attribute key. pub struct AttributeKey { diff --git a/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/counter.j2 b/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/counter.j2 index aa6fc758..6e6416a3 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/counter.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/counter.j2 @@ -1,10 +1,10 @@ -{%- import 'attribute_macros.j2' as attribute_macros %} -{%- if metric.brief %} +{% import 'attribute_macros.j2' as attribute_macros %} +{% if metric.brief %} {{ metric.brief | comment_with_prefix("/// ") }} -{%- endif %} -{%- if metric is experimental %} +{% endif %} +{% if metric is experimental %} #[cfg(feature = "semconv_experimental")] -{%- endif %} +{% endif %} #[must_use] pub fn create_{{ metric.metric_name | snake_case }}(meter: &opentelemetry::metrics::Meter) -> opentelemetry::metrics::Counter where opentelemetry::metrics::Meter: crate::metrics::CounterProvider { @@ -21,17 +21,18 @@ pub struct {{ metric.metric_name | pascal_case }}(opentelemetry::metrics::Cou {%- set not_required_attributes = metric.attributes | not_required %} {% if required_attributes %} + /// Required attributes for the `{{ metric.metric_name }}` metric. #[derive(Debug, Clone)] pub struct {{ metric.metric_name | pascal_case }}ReqAttributes { - {%- for attribute in required_attributes | attribute_sort %} - {{ attribute_macros.comments(attribute, " ///") }} - {%- if attribute.type.members is defined %} + {% for attribute in required_attributes | attribute_sort %} + {{- attribute_macros.comments(attribute, " ///") }} + {%- if attribute.type.members is defined %} pub {{ attribute.name | snake_case }}: crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | pascal_case }}, - {%- else %} + {%- else %} pub {{ attribute.name | snake_case }}: {{ attribute.type | map_text("rust_types") }}, - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {% endif %} @@ -39,14 +40,14 @@ pub struct {{ metric.metric_name | pascal_case }}ReqAttributes { /// Not required attributes for the `{{ metric.metric_name }}` metric. #[derive(Debug, Clone, Default)] pub struct {{ metric.metric_name | pascal_case }}OptAttributes { - {%- for attribute in not_required_attributes | attribute_sort %} - {{ attribute_macros.comments(attribute, " ///") }} - {%- if attribute.type.members is defined %} + {% for attribute in not_required_attributes | attribute_sort %} +{{ attribute_macros.comments(attribute, " ///") }} + {%- if attribute.type.members is defined %} pub {{ attribute.name | snake_case }}: Option, - {%- else %} + {%- else %} pub {{ attribute.name | snake_case }}: Option<{{ attribute.type | map_text("rust_types") }}>, - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {% endif %} @@ -62,8 +63,12 @@ impl {{ metric.metric_name | pascal_case }} { pub fn add( &self, value: T, - {% if required_attributes %}required_attributes: &{{ metric.metric_name | pascal_case }}ReqAttributes,{% endif %} - {% if not_required_attributes %}not_required_attributes: Option<&{{ metric.metric_name | pascal_case }}OptAttributes>,{% endif %} + {% if required_attributes %} + required_attributes: &{{ metric.metric_name | pascal_case }}ReqAttributes, + {% endif %} + {% if not_required_attributes %} + not_required_attributes: Option<&{{ metric.metric_name | pascal_case }}OptAttributes>, + {% endif %} ) { {{ attribute_macros.attributes_to_key_values(required_attributes, not_required_attributes) }} self.0.add(value, &attributes); diff --git a/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/gauge.j2 b/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/gauge.j2 index 8a477a5f..7bfb194b 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/gauge.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/gauge.j2 @@ -1,10 +1,10 @@ {%- import 'attribute_macros.j2' as attribute_macros %} -{%- if metric.brief %} +{% if metric.brief %} {{ metric.brief | comment_with_prefix("/// ") }} -{%- endif %} -{%- if metric is experimental %} +{% endif %} +{% if metric is experimental %} #[cfg(feature = "semconv_experimental")] -{%- endif %} +{% endif %} #[must_use] pub fn create_{{ metric.metric_name | snake_case }}(meter: &opentelemetry::metrics::Meter) -> opentelemetry::metrics::Gauge where opentelemetry::metrics::Meter: crate::metrics::GaugeProvider { @@ -24,14 +24,14 @@ pub struct {{ metric.metric_name | pascal_case }}(opentelemetry::metrics::Gau /// Required attributes for the `{{ metric.metric_name }}` metric. #[derive(Debug, Clone)] pub struct {{ metric.metric_name | pascal_case }}ReqAttributes { - {%- for attribute in required_attributes | attribute_sort %} + {% for attribute in required_attributes | attribute_sort %} {{ attribute_macros.comments(attribute, " ///") }} {%- if attribute.type.members is defined %} pub {{ attribute.name | snake_case }}: crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | pascal_case }}, {%- else %} pub {{ attribute.name | snake_case }}: {{ attribute.type | map_text("rust_types") }}, - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {% endif %} @@ -39,14 +39,14 @@ pub struct {{ metric.metric_name | pascal_case }}ReqAttributes { /// Not required attributes for the `{{ metric.metric_name }}` metric. #[derive(Debug, Clone, Default)] pub struct {{ metric.metric_name | pascal_case }}OptAttributes { - {%- for attribute in not_required_attributes | attribute_sort %} - {{ attribute_macros.comments(attribute, " ///") }} + {% for attribute in not_required_attributes | attribute_sort %} + {{- attribute_macros.comments(attribute, " ///") }} {%- if attribute.type.members is defined %} pub {{ attribute.name | snake_case }}: Option, {%- else %} pub {{ attribute.name | snake_case }}: Option<{{ attribute.type | map_text("rust_types") }}>, - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {% endif %} @@ -62,8 +62,12 @@ impl {{ metric.metric_name | pascal_case }} { pub fn record( &self, value: T, - {% if required_attributes %}required_attributes: &{{ metric.metric_name | pascal_case }}ReqAttributes,{% endif %} - {% if not_required_attributes %}not_required_attributes: Option<&{{ metric.metric_name | pascal_case }}OptAttributes>,{% endif %} + {% if required_attributes %} + required_attributes: &{{ metric.metric_name | pascal_case }}ReqAttributes, + {% endif %} + {% if not_required_attributes %} + not_required_attributes: Option<&{{ metric.metric_name | pascal_case }}OptAttributes>, + {% endif %} ) { {{ attribute_macros.attributes_to_key_values(required_attributes, not_required_attributes) }} self.0.record(value, &attributes); diff --git a/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/histogram.j2 b/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/histogram.j2 index cd6342d9..ab95ebbe 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/histogram.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/histogram.j2 @@ -1,10 +1,10 @@ {%- import 'attribute_macros.j2' as attribute_macros %} -{%- if metric.brief %} +{% if metric.brief %} {{ metric.brief | comment_with_prefix("/// ") }} -{%- endif %} -{%- if metric is experimental %} +{% endif %} +{% if metric is experimental %} #[cfg(feature = "semconv_experimental")] -{%- endif %} +{% endif %} #[must_use] pub fn create_{{ metric.metric_name | snake_case }}(meter: &opentelemetry::metrics::Meter) -> opentelemetry::metrics::Histogram where opentelemetry::metrics::Meter: crate::metrics::HistogramProvider { @@ -21,17 +21,18 @@ pub struct {{ metric.metric_name | pascal_case }}(opentelemetry::metrics::His {%- set not_required_attributes = metric.attributes | not_required %} {% if required_attributes %} + /// Required attributes for the `{{ metric.metric_name }}` metric. #[derive(Debug, Clone)] pub struct {{ metric.metric_name | pascal_case }}ReqAttributes { - {%- for attribute in required_attributes | attribute_sort %} - {{ attribute_macros.comments(attribute, " ///") }} - {%- if attribute.type.members is defined %} + {% for attribute in required_attributes | attribute_sort %} + {{- attribute_macros.comments(attribute, " ///") }} + {%- if attribute.type.members is defined %} pub {{ attribute.name | snake_case }}: crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | pascal_case }}, - {%- else %} + {%- else %} pub {{ attribute.name | snake_case }}: {{ attribute.type | map_text("rust_types") }}, - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {% endif %} @@ -39,14 +40,14 @@ pub struct {{ metric.metric_name | pascal_case }}ReqAttributes { /// Not required attributes for the `{{ metric.metric_name }}` metric. #[derive(Debug, Clone, Default)] pub struct {{ metric.metric_name | pascal_case }}OptAttributes { - {%- for attribute in not_required_attributes | attribute_sort %} - {{ attribute_macros.comments(attribute, " ///") }} - {%- if attribute.type.members is defined %} + {% for attribute in not_required_attributes | attribute_sort %} + {{- attribute_macros.comments(attribute, " ///") }} + {%- if attribute.type.members is defined %} pub {{ attribute.name | snake_case }}: Option, - {%- else %} + {%- else %} pub {{ attribute.name | snake_case }}: Option<{{ attribute.type | map_text("rust_types") }}>, - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {% endif %} @@ -62,8 +63,12 @@ impl {{ metric.metric_name | pascal_case }} { pub fn record( &self, value: T, - {% if required_attributes %}required_attributes: &{{ metric.metric_name | pascal_case }}ReqAttributes,{% endif %} - {% if not_required_attributes %}not_required_attributes: Option<&{{ metric.metric_name | pascal_case }}OptAttributes>,{% endif %} + {% if required_attributes %} + required_attributes: &{{ metric.metric_name | pascal_case }}ReqAttributes, + {% endif %} + {% if not_required_attributes %} + not_required_attributes: Option<&{{ metric.metric_name | pascal_case }}OptAttributes>, + {% endif %} ) { {{ attribute_macros.attributes_to_key_values(required_attributes, not_required_attributes) }} self.0.record(value, &attributes); diff --git a/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/updowncounter.j2 b/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/updowncounter.j2 index f44b5bd4..7fbd388e 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/updowncounter.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/metrics/instruments/updowncounter.j2 @@ -1,10 +1,10 @@ {%- import 'attribute_macros.j2' as attribute_macros %} -{%- if metric.brief %} +{% if metric.brief %} {{ metric.brief | comment_with_prefix("/// ") }} -{%- endif %} -{%- if metric is experimental %} +{% endif %} +{% if metric is experimental %} #[cfg(feature = "semconv_experimental")] -{%- endif %} +{% endif %} #[must_use] pub fn create_{{ metric.metric_name | snake_case }}(meter: &opentelemetry::metrics::Meter) -> opentelemetry::metrics::UpDownCounter where opentelemetry::metrics::Meter: crate::metrics::UpDownCounterProvider { @@ -25,14 +25,14 @@ pub struct {{ metric.metric_name | pascal_case }}(opentelemetry::metrics::UpD /// Attributes for the `{{ metric.metric_name }}` metric. #[derive(Debug, Clone)] pub struct {{ metric.metric_name | pascal_case }}ReqAttributes { - {%- for attribute in required_attributes | attribute_sort %} + {% for attribute in required_attributes | attribute_sort %} {{ attribute_macros.comments(attribute, " ///") }} {%- if attribute.type.members is defined %} pub {{ attribute.name | snake_case }}: crate::attributes::{{ attribute.name | attribute_namespace }}::{{ attribute.name | pascal_case }}, {%- else %} pub {{ attribute.name | snake_case }}: {{ attribute.type | map_text("rust_types") }}, - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {% endif %} @@ -40,14 +40,14 @@ pub struct {{ metric.metric_name | pascal_case }}ReqAttributes { /// Not required attributes for the `{{ metric.metric_name }}` metric. #[derive(Debug, Clone, Default)] pub struct {{ metric.metric_name | pascal_case }}OptAttributes { - {%- for attribute in not_required_attributes | attribute_sort %} - {{ attribute_macros.comments(attribute, " ///") }} + {% for attribute in not_required_attributes | attribute_sort %} + {{- attribute_macros.comments(attribute, " ///") }} {%- if attribute.type.members is defined %} pub {{ attribute.name | snake_case }}: Option, {%- else %} pub {{ attribute.name | snake_case }}: Option<{{ attribute.type | map_text("rust_types") }}>, - {%- endif %} - {%- endfor %} + {% endif %} + {% endfor %} } {% endif %} @@ -63,8 +63,12 @@ impl {{ metric.metric_name | pascal_case }} { pub fn add( &self, value: T, - {% if required_attributes %}required_attributes: &{{ metric.metric_name | pascal_case }}ReqAttributes,{% endif %} - {% if not_required_attributes %}not_required_attributes: Option<&{{ metric.metric_name | pascal_case }}OptAttributes>,{% endif %} + {% if required_attributes %} + required_attributes: &{{ metric.metric_name | pascal_case }}ReqAttributes, + {% endif %} + {% if not_required_attributes %} + not_required_attributes: Option<&{{ metric.metric_name | pascal_case }}OptAttributes>, + {% endif %} ) { {{ attribute_macros.attributes_to_key_values(required_attributes, not_required_attributes) }} self.0.add(value, &attributes); diff --git a/crates/weaver_codegen_test/templates/registry/rust/metrics/metrics.rs.j2 b/crates/weaver_codegen_test/templates/registry/rust/metrics/metrics.rs.j2 index 0b23820a..bb948997 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/metrics/metrics.rs.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/metrics/metrics.rs.j2 @@ -1,4 +1,4 @@ -{%- set file_name = ctx.prefix | snake_case -%} +{%- set file_name = ctx.root_namespace | snake_case -%} {{- template.set_file_name("metrics/" ~ file_name ~ ".rs") -}} /* @@ -8,6 +8,7 @@ //! DO NOT EDIT, THIS FILE HAS BEEN GENERATED BY WEAVER -{%- for metric in ctx.groups %} +{% for metric in ctx.metrics %} {% include "metrics/instruments/" ~ metric.instrument ~ ".j2" %} -{%- endfor %} \ No newline at end of file + +{% endfor %} \ No newline at end of file diff --git a/crates/weaver_codegen_test/templates/registry/rust/metrics/mod.rs.j2 b/crates/weaver_codegen_test/templates/registry/rust/metrics/mod.rs.j2 index 1e9be895..b7ee0c6f 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/metrics/mod.rs.j2 +++ b/crates/weaver_codegen_test/templates/registry/rust/metrics/mod.rs.j2 @@ -10,10 +10,10 @@ pub const METRICS_PARAM: bool = {{ params.metrics }}; -{% for group in ctx %} -/// Metrics for the `{{ group.id | metric_namespace }}` namespace. -pub mod {{ group.id | metric_namespace | snake_case }}; -{%- endfor %} +{% for attributes_root_namespace in ctx %} +/// Metrics for the `{{ attributes_root_namespace.root_namespace }}` namespace. +pub mod {{ attributes_root_namespace.root_namespace | snake_case }}; +{% endfor %} /// A trait implemented by histogram providers (e.g. `Meter`). pub trait HistogramProvider { diff --git a/crates/weaver_codegen_test/templates/registry/rust/weaver.yaml b/crates/weaver_codegen_test/templates/registry/rust/weaver.yaml index 47b4ad4a..fa9226f8 100644 --- a/crates/weaver_codegen_test/templates/registry/rust/weaver.yaml +++ b/crates/weaver_codegen_test/templates/registry/rust/weaver.yaml @@ -8,6 +8,11 @@ text_maps: template[string]: String # Not yet properly handled in codegen template[string[]]: Vec # Not yet properly handled in codegen +# Whitespace control settings to simplify the definition of templates +whitespace_control: + trim_blocks: true + lstrip_blocks: true + templates: - pattern: README.md filter: . @@ -15,159 +20,35 @@ templates: - pattern: lib.rs filter: . application_mode: single - - # Templates for the `attribute_group` group type - pattern: attributes/mod.rs.j2 - # The following JQ filter extracts the id, type, brief, and prefix of groups matching the following criteria: - # - groups with an id starting with the prefix `registry.` - # - groups of the type `attribute_group`. - # - groups are deduplicated by namespace. - # - groups are sorted by namespace. filter: > if $attributes then - .groups - | map(select(.id | startswith($registry_prefix))) - | map(select(.type == "attribute_group") - | { - id, - type, - brief, - prefix}) - | unique_by(.id | split(".") | .[1]) - | sort_by(.id | split(".") | .[1]) + semconv_grouped_attributes($params) else empty end application_mode: single - pattern: attributes/attributes.rs.j2 - # The following JQ filter extracts the id, type, brief, prefix, and attributes of groups matching the following - # criteria: - # - groups with an id starting with the prefix `registry.` - # - groups of the type `attribute_group`. - # - groups are sorted by namespace. filter: > if $attributes then - .groups - | map(select(.id | startswith($registry_prefix))) - | map(select(.type == "attribute_group") - | { - id, - type, - brief, - prefix, - attributes}) - | group_by(.id | split(".") | .[1]) - | map({ - id: (map(select(.id | endswith(".deprecated") | not)) | first).id, - type: (map(select(.id | endswith(".deprecated") | not)) | first).type, - brief: (map(select(.id | endswith(".deprecated") | not)) | first).brief, - prefix: (map(select(.id | endswith(".deprecated") | not)) | first).prefix, - attributes: map(.attributes) | add - }) - | sort_by(.id | split(".") | .[1]) + semconv_grouped_attributes($params) else empty end application_mode: each - - # Templates for the `metric` group type - pattern: metrics/mod.rs.j2 - # The following JQ filter extracts the id, type, brief, and prefix of groups matching the following criteria: - # - groups with an id starting with the prefix `metric.` - # - groups of the type `metric`. - # - groups are deduplicated by namespace. - # - groups are sorted by prefix. filter: > if $metrics then - .groups - | map(select(.id | startswith("metric."))) - | map(select(.type == "metric") - | { - id, - type, - brief, - prefix}) - | unique_by(.id | split(".") | .[1]) - | sort_by(.id | split(".") | .[1]) + semconv_grouped_metrics else empty end application_mode: single - pattern: metrics/metrics.rs.j2 - # The following JQ filter extracts the id, type, brief, prefix, and attributes of groups matching the following - # criteria: - # - groups with an id starting with the prefix `metric.` - # - groups of the type `metric`. - # - groups are sorted by namespace. filter: > if $metrics then - .groups - | map(select(.id | startswith("metric."))) - | group_by(.id | split(".") | .[1]) - | map({ - prefix: .[0].id | split(".") | .[1], - groups: . - }) + semconv_grouped_metrics else empty end - application_mode: each - - -# .groups -# | map(select(.type == "attribute_group")) -# | map(select(.id | startswith("registry"))) -# | group_by(.id | split(".") | .[1]) -# | map({id: .[0].id | split(".") | .[1], groups: .}) - -# Other examples of filters - -# The following JQ filter extracts the id, type, brief, and prefix of groups matching the following criteria: -# - groups with an id starting with the prefix `registry.` -# - groups of the type `attribute_group`. -# - groups with a well-defined prefix. -# - groups with a non-empty list of attributes that are neither deprecated nor experimental. -# - groups are deduplicated by prefix. -# - groups are sorted by prefix. -# filter: > -# .groups -# | map(select(.id | startswith("registry."))) -# | map(select(.type == "attribute_group" and .prefix != null and .prefix != "") -# | { -# id, -# type, -# brief, -# prefix, -# attributes: (.attributes -# | map(select(.stability == "experimental" and .deprecated | not)))}) -# | map(select(.attributes | length > 0)) -# | map( -# { -# id, -# type, -# brief, -# prefix -# } -# ) -# | unique_by(.prefix) -# | sort_by(.prefix) - - -# The following JQ filter extracts the id, type, brief, prefix, and attributes of groups matching the following -# criteria: -# - groups with an id starting with the prefix `registry.` -# - groups of the type `attribute_group`. -# - groups with a well-defined prefix. -# - groups with a non-empty list of attributes that are neither deprecated nor experimental. -# - groups are sorted by prefix. -# filter: > -# .groups -# | map(select(.id | startswith("registry."))) -# | map(select(.type == "attribute_group" and .prefix != null and .prefix != "") -# | { -# id, -# type, -# brief, -# prefix, -# attributes: (.attributes | map(select(.stability == "experimental" and .deprecated | not)))}) -# | sort_by(.prefix // empty) \ No newline at end of file + application_mode: each \ No newline at end of file diff --git a/crates/weaver_codegen_test/templates/registry/weaver.yaml b/crates/weaver_codegen_test/templates/registry/weaver.yaml index 1361e29d..2dcabac0 100644 --- a/crates/weaver_codegen_test/templates/registry/weaver.yaml +++ b/crates/weaver_codegen_test/templates/registry/weaver.yaml @@ -2,4 +2,4 @@ params: attributes: true metrics: true - registry_prefix: "registry." + exclude_deprecated: true \ No newline at end of file diff --git a/crates/weaver_common/Cargo.toml b/crates/weaver_common/Cargo.toml index 7b91b030..1456510c 100644 --- a/crates/weaver_common/Cargo.toml +++ b/crates/weaver_common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_common" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_diff/Cargo.toml b/crates/weaver_diff/Cargo.toml index bd47846b..0b3590de 100644 --- a/crates/weaver_diff/Cargo.toml +++ b/crates/weaver_diff/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_diff" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_forge/Cargo.toml b/crates/weaver_forge/Cargo.toml index 3116bc2d..c92a6631 100644 --- a/crates/weaver_forge/Cargo.toml +++ b/crates/weaver_forge/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_forge" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true @@ -21,10 +21,11 @@ weaver_semconv = { path = "../weaver_semconv" } minijinja = { version = "2.0.3", features = ["loader", "custom_syntax", "debug", "json", "urlencode", "macros"] } minijinja-contrib = { version="2.0.3", features = ["pycompat"] } convert_case = "0.6.0" -jaq-core = "1.2.1" +jaq-core = "1.5.0" jaq-std = "1.5.1" -jaq-interpret = "1.2.1" +jaq-interpret = "1.5.0" jaq-parse = "1.0.2" +jaq-syn = "1.1.0" indexmap = "2.2.6" regex = "1.10.5" markdown = "=1.0.0-alpha.18" diff --git a/crates/weaver_forge/README.md b/crates/weaver_forge/README.md index 4d6407c3..ea832e37 100644 --- a/crates/weaver_forge/README.md +++ b/crates/weaver_forge/README.md @@ -1,156 +1,443 @@ -# Weaver Forge - Template Engine +# Weaver Forge - A Jinja-based Doc/Code Generation Engine +## Table of Contents - [Introduction](#introduction) -- [Template Directory Structure and Naming Conventions](#template-directory-structure-and-naming-conventions) -- [Configuration File - `weaver.yaml`](#configuration-file---weaveryaml) -- [Jinja Filters](#jinja-filters) -- [Jinja Functions](#jinja-functions) -- [Jinja Tests](#jinja-tests) +- [General Concepts](#general-concepts) + - [Template Directory Structure and Naming Conventions](#template-directory-structure-and-naming-conventions) + - [Configuration File - `weaver.yaml`](#configuration-file---weaveryaml) + - [Global Variables](#global-variables) + - [JQ Filters](#jq-filters) +- [Step-by-Step Guide](#step-by-step-guide) + - [Step 1: Setting Up Your Template Directory](#step-1-setting-up-your-template-directory) + - [Step 2: Creating and Configuring `weaver.yaml`](#step-2-creating-and-configuring-weaveryaml) + - [Step 3: Writing Your First Template](#step-3-writing-your-first-template) +- [In-Depth Features](#in-depth-features) + - [JQ Filters Reference](#jq-filters-reference) + - [Jinja Filters Reference](#jinja-filters-reference) + - [Jinja Functions Reference](#jinja-functions-reference) + - [Jinja Tests Reference](#jinja-tests-reference) ## Introduction -OTel Weaver is capable of generating documentation or code from a semantic -convention registry or a telemetry schema (phase 2). To do this, -OTel Weaver uses a template engine compatible with the Jinja2 syntax (see the -[MiniJinja](https://github.com/mitsuhiko/minijinja) project for more details). -A set of filters, functions, tests, and naming conventions have been added to -the classic Jinja logic to make the task easier for template authors. - -The following diagram illustrates the documentation and code generation pipeline -using the OTel Weaver tool: +Weaver Forge is a component of OTEL Weaver that facilitates documentation and +code generation from a semantic convention registry. It uses MiniJinja, a +template engine compatible with Jinja2 syntax, which provides extensive +customization options (refer to this [GitHub repository](https://github.com/mitsuhiko/minijinja) +for more details). To streamline template creation for semantic conventions, +additional filters, functions, tests, and naming conventions have been +integrated with the standard Jinja logic. + +Weaver Forge also incorporates a YAML/JSON processor compatible with JQ to +preprocess resolved registries before they are processed by Jinja templates. +This integration helps avoid complex logic within the templates. A set of +specialized JQ filters is available to extract and organize attributes and +metrics, making them directly usable by the templates. This allows +template authors to focus on rendering rather than filtering, transforming, or +ordering logic in Jinja. + +The following diagram illustrates the documentation and code generation pipeline using the OTEL +Weaver tool: ![Weaver Forge](images/artifact-generation-pipeline.svg) -## Template Directory Structure and Naming Conventions +Weaver's resolution process simplifies the semantic conventions by eliminating +references, extend statements, and other complex constructs, creating a fully +resolved, easy-to-use, self-contained version of the registry. This resolved +registry can be optionally filtered, grouped, sorted, and processed using a +JQ-based transformation before being used by the Jinja-based template engine +for documentation and code generation. Additionally, a set of templates and a +configuration file, stored alongside these templates, are processed by the +template engine to generate the desired artifacts. + +## General Concepts -By default, Weaver expects to find the `templates/` directory in the current directory -with the following structure. The location of this directory can be redefined using -the `-t` or `--templates` CLI parameter. +### Template Directory Structure and Naming Conventions + +By default, Weaver looks for a directory named `templates/`, which contains +several collection of templates, also referred to as targets (e.g. go, html, +markdown, rust, ...). The hierarchical structure of the `templates` directory +is detailed below. Note that this location can be changed using the `-t` or +`--templates` CLI parameter. ```plaintext templates/ - registry/ <-- All templates related to the semantic convention registries - go/ <-- Templates to generate the semantic conventions in Go - ... - html/ <-- Templates to generate the semantic conventions in HTML + registry/ + go/ ... - markdown/ <-- Templates to generate the semantic conventions in markdown + html/ ... - rust/ <-- Templates to generate the semantic conventions in Rust + markdown/ ... - schema/ - sdk-go/ <-- Templates to generate a Go Client SDK derived from the telemetry schema - ... - sdk-rust/ <-- Templates to generate a Rust Client SDK derived from the telemetry schema + rust/ ... + .../ ``` -The command `weaver generate registry markdown` will generate the markdown -files based on the templates located in the `templates/registry/markdown`. - -When the name of a file (excluding the extension) matches a recognized pattern -(e.g., attribute_group, groups, ...), OTel Weaver extracts the objects from the -registry and passes them to the template at the time of its evaluation. -Depending on the nature of the pattern, the template is evaluated as many times -as there are objects that match or only once if the pattern corresponds to a -set of objects. By default, the name of the file that will be generated from -the template will be that of the template, but it is possible within the -template to dynamically redefine the name of the produced file. +In this example, all templates for the `go` target are located in +`templates/registry/go`, and all templates for the `rust` target are in +`templates/registry/rust`. Similarly, other targets such as `html` have their +respective templates in designated folders. These targets (`go`, `html`, and +`rust`) are used for code and documentation generation via the +`weaver registry generate ` command. For instance, running +`weaver registry generate rust` will generate Rust files based on the templates +in `templates/registry/rust`. The intermediary `registry` directory groups +targets that convert a semantic convention registry into generated artifacts. +In a future version of Weaver, a new class of targets will be introduced to +generate artifacts from application telemetry schemas (`templates/schema/`). + +### Configuration File - `weaver.yaml` + +Weaver searches for a `weaver.yaml` file in the `templates/registry/` +directory. This file guides Weaver on which Jinja templates to use, the context +to provide during evaluation, and how to apply them. The template input can be +applied to the entire document with `application_mode` set to `single`, or to +each part of the document (if it is an array of objects) with `application_mode` +set to `multiple`. The file also configures filters (e.g., `map_text` or `acronym` +filters), controls whitespace handling, and includes other configurations +detailed in the in-depth section. The complete syntax for this configuration +file is described [here](/docs/weaver-config.md). + +Weaver supports sharing common configuration parts through an overriding +mechanism, loading configuration files in this order: + +- `$HOME/.weaver/weaver.yaml` +- `/weaver.yaml` and any intermediate directories containing a `weaver.yaml` +file up to the `templates/registry/` directory. +- `templates/registry//weaver.yaml` -For example, the following snippet redefine the name of the file that will be -produced from the template: +Each subsequent configuration file overrides the previous ones, up to the +`weaver.yaml` in the home directory (if it exists). To define your own +configuration file list, use the `--config` CLI parameter. -```jinja -{%- set file_name = group.id | snake_case -%} -{{- template.set_file_name("span/" ~ file_name ~ ".md") -}} -``` +A common use of this configuration hierarchy is to share configuration +segments across multiple targets. -This mechanism allows the template to dynamically generate the name of the file -to be produced and to organize the generated files in a directory structure of -its choice. +### JQ Filters -## Configuration File - `weaver.yaml` +JQ filters are a powerful tool integrated into Weaver to preprocess the data before it is passed +to the templates. Each template in the `templates/registry/` directory can be associated +with a JQ filter, defined in the `weaver.yaml` configuration file. These filters are applied to +the resolved semantic convention registry, allowing you to transform and manipulate the data as +needed before to being processed in the template. -In the simplest case, a configuration file named `weaver.yaml` is searched for by -the tool within the folder containing the templates. The syntax of this configuration -file is described here [Weaver Configuration File](/docs/weaver-config.md). +For example, you can group attributes by root namespace or filter out specific stability levels. This +preprocessing ensures that the data is in the correct format and structure when it is accessed +within the corresponding Jinja templates. -It is possible to utilize the hierarchy of folders containing the targets to share -segments of the configuration common to all targets. Similarly, you can define -Weaver configuration segments in your home directory, i.e., $HOME/.weaver/weaver.yaml. +In the following example, the `attributes.j2` template is associated with the `semconv_grouped_attributes` +JQ filter. This filter is applied to each object selected by the JQ filter before being delivered +to the template. `semconv_grouped_attributes` returns an array of objects containing the attributes +grouped by root namespace. The `application_mode` is set to `each` so that the template is applied to +each object in the array, i.e., to each group of attributes for a given root namespace. -By default, the `weaver.yaml` files are loaded in the following order: +```yaml +templates: + - pattern: "attributes.j2" # glob patterns are supported + filter: semconv_grouped_attributes + application_mode: each + - ... +``` -- $HOME/.weaver/weaver.yaml -- /weaver.yaml, all intermediate directories containing a `weaver.yaml` file up to the -`templates/registry/` directory. -- `templates/registry//weaver.yaml` +More details [here](#jq-filters-reference). -The last configuration file loaded will override the previous ones. +### Global Variables -For the most complex cases, it is possible to define explicitly the list configuration -files to load using the `--config` CLI n-ary parameter. +All templates have access to the following global variables: -## Global Variables +- `ctx`: The context object that contains the resolved registry or the output of the JQ filter +if defined in the `weaver.yaml` configuration file. +- `params`: The parameters defined in the `weaver.yaml` configuration file or overridden by the +command line `--param`, `-D`, or `--params` arguments. +- `template`: An object exposing various helper functions such as the `set_file_name` method to +redefine the name of the file that will be produced from the template. -All templates have access to the following global variables: +## Step-by-Step Guide -- `ctx`: The context object that contains the resolved registry or the output of -the JQ filter if defined in the `weaver.yaml` configuration file. -- `params`: The parameters defined in the `weaver.yaml` configuration file or overridden -by the command line `--param`, `-D`, or `--params` arguments. -- `template`: An object exposing the `set_file_name` method to redefine the name of the -file that will be produced from the template. +### Step 1: Setting Up Your Template Directory -In the following example, the parameters `incubating` and `excluded` are passed via the command line: +Create the directory for your target language: ```shell -weaver registry generate --param incubating=true +mkdir -p templates/registry/rust ``` -The `weaver.yaml` configuration file can specify default values for the parameters and can also -access the parameters in the JQ filters: +In this guide, we will use the Rust target as an example. + +### Step 2: Creating and Configuring `weaver.yaml` + +1. **Create a `weaver.yaml` file in the target directory:** ```yaml +text_maps: + rust_types: + int: i64 + double: f64 + boolean: bool + string: String + string[]: Vec + template[string]: String + template[string[]]: Vec + params: - incubating: false - registry_prefix: "registry." + incubating: true + # ... + +# Jinja Engine Whitespace Control Settings +# With both trim_blocks and lstrip_blocks enabled, you can put block tags on +# their own lines, and the entire block line will be removed when rendered, +# preserving the whitespace of the contents. +whitespace_control: + trim_blocks: true + lstrip_blocks: true templates: - - pattern: - filter: > - if $incubating then - .groups - | map(select(.type == "attribute_group")) - | map(select(.id | startswith($registry_prefix))) - | map({ id: .id, group_id: .id | split(".") | .[1], attributes: .attributes }) - | group_by(.group_id) - | map({ id: .[0].group_id, attributes: [.[].attributes[]] | sort_by(.id), output: "_incubating/attributes/", stable_package_name: "opentelemetry.semconv.attributes" }) - | map(select(.id as $id | any($excluded[]; . == $id) | not)) - | map(select(.attributes | length > 0)) - else - empty - end - application_mode: single | each + - pattern: "attributes.j2" + filter: semconv_grouped_attributes + application_mode: each + # ... +``` + +In this configuration, we define a set of text maps that map semantic convention types to Rust +types. We also define a set of parameters that can be used in the templates. + +More details on the structure of the configuration file [here](/docs/weaver-config.md). + +2. **Define templates and JQ filters in your `weaver.yaml` file:** + +```yaml +# ... + +templates: + - pattern: "attributes.j2" + filter: semconv_grouped_attributes + application_mode: each + - pattern: "metrics.j2" + filter: semconv_grouped_metrics + application_mode: each + +# ... ``` -Jinja templates can also access the parameters: +In this example, the `attributes.j2` template is feed with the output of the `semconv_grouped_attributes` +and `metrics.j2` with the output of the `semconv_grouped_metrics` JQ filter. + +More details on the JQ syntax and custom semconv filters [here](#jq-filters-reference). + +### Step 3: Writing Your First Template + +1. **Create a template file `attributes.j2` in the appropriate directory:** ```jinja +{%- set file_name = ctx.root_namespace | snake_case -%} +{{- template.set_file_name("attributes/" ~ file_name ~ ".md") -}} +... +a valid jinja template ... +``` + +The first two lines (optional) specify the name of the file generated from the evaluation of the +current template and the inputs provided by Weaver. In this specific example, an object +containing a `root_namespace` and an array of `attributes`. + +2. **Use Jinja syntax to define the content and structure of the generated files.** + +Most of the Jinja syntax is supported, as well as a set of common Python functions and custom +filters, function, and tests. See the section [In-Depth Features](#in-depth-features) for more +explanations. + +Use predefined Jinja filters to format and transform data within templates: + +```jinja +{{ attribute.name | snake_case }} +``` + +Access global variables and parameters in your templates: + +```jinja {% if params.incubating %} ... generate incubating code ... {% endif %} -... ``` -## Jinja Filters +Use custom Jinja tests to apply logic based on data attributes: -All the filters available in the MiniJinja template engine are available (see -this online [documentation](https://docs.rs/minijinja/latest/minijinja/filters/index.html)) and the [py_compat](https://github.com/mitsuhiko/minijinja/blob/e8a7ec5198deef7638267f2667714198ef64a1db/minijinja-contrib/src/pycompat.rs) compatibility extensions -that are also enabled in Weaver. +```jinja +{% if attribute is experimental %} +... generate experimental attribute documentation ... +{% endif %} +``` -In addition, OTel Weaver provides a set of custom filters to facilitate the +## In-Depth Features + +### JQ Filters Reference + +JQ filters allow template authors to manipulate the data before it is passed to the templates. +The filters can be defined in the `weaver.yaml` configuration file and are applied to the +resolved semantic convention registry. + +Example configuration for JQ filters in `weaver.yaml`: + +```yaml +templates: + - pattern: "attributes.j2" + filter: semconv_grouped_attributes + application_mode: each + - pattern: "metrics.j2" + filter: semconv_grouped_metrics + application_mode: each + # ... +``` + +In this example, the `attributes.j2` and `metrics.j2` templates are associated with the +`semconv_grouped_attributes` and `semconv_grouped_metrics` JQ filters respectively. These +filters are applied to each object selected by the JQ filter before being delivered to the +template. `semconv_grouped_attributes` returns an array of objects containing the attributes +grouped by root namespace. The `application_mode` is set to `each` so that the template is +applied to each object in the array, i.e., to each group of attributes for a given root namespace. + +A series of JQ filters dedicated to the manipulation of semantic conventions registries is +available to template authors. + +**Process Registry Attributes** + +The following JQ filter extracts the registry attributes from the resolved registry and +returns a list of registry attributes grouped by root namespace and sorted by attribute names. + +```yaml +templates: + - pattern: attributes.j2 + filter: semconv_grouped_attributes + application_mode: each +``` + +The output of the JQ filter has the following structure: + +```json5 +[ + { + "root_namespace": "user_agent", + "attributes": [ + { + "brief": "Value of the HTTP User-Agent", + "examples": [ ... ], + "name": "user_agent.original", + "namespace": "user_agent", + "requirement_level": "recommended", + "stability": "stable", + "type": "string", + // ... other fields + }, + // ... other attributes in the same root namespace + ] + }, + // ... other root namespaces +] +``` + +The `semconv_grouped_attributes` function also supports options to exclude specified root namespaces, +specific stability levels, and deprecated entities. The following syntax is supported: + +```yaml +templates: + - pattern: attributes.j2 + filter: > + semconv_grouped_attributes({ + "exclude_root_namespace": ["url", "network"], + "exclude_stability": ["experimental"], + "exclude_deprecated": true + }) + application_mode: each +``` + +The structure of the output of `semconv_grouped_attributes` with these options is exactly the +same as without the options. The JSON object passed as a parameter describes a series of +options that can easily be extended if needed. Each of these options is optional. + +Technically, the `semconv_grouped_attributes` function is a combination of two semconv +JQ functions: + +```jq +def semconv_grouped_attributes($options): + semconv_attributes($options) + | semconv_group_attributes_by_root_namespace; + +def semconv_grouped_attributes: semconv_grouped_attributes({}); +``` + +The `semconv_attributes` function extracts the registry attributes and applies the given options. +The `semconv_group_attributes_by_root_namespace` function groups the attributes by root namespace. It's +possible to combine these two functions with your own JQ filters if needed. + +**Process Metrics** + +The following JQ filter extracts the metrics from the resolved registry, sorted by group +root namespace and sorted by metric names. + +```yaml +templates: + - pattern: metrics.j2 + filter: semconv_grouped_metrics + application_mode: each +``` + +The output of the JQ filter has the following structure: + +```json5 +[ + { + "root_namespace": "jvm", + "metrics": [ + { + "attributes": [ ... ], + "brief": "Recent CPU utilization for the process as reported by the JVM.", + "id": "metric.jvm.cpu.recent_utilization", + "instrument": "gauge", + "metric_name": "jvm.cpu.recent_utilization", + "root_namespace": "jvm", + "note": "The value range is [0.0,1.0]. ...", + "stability": "stable", + "type": "metric", + "unit": "1", + // ... other fields + }, + // ... other metrics in the same root namespace + ] + }, + // ... other root namespaces +] +``` + +The same options are supported by `semconv_grouped_metrics`, as shown in the following example: + +```yaml +templates: + - pattern: metrics.j2 + filter: > + semconv_grouped_metrics({ + "exclude_root_namespace": ["url", "network"], + "exclude_stability": ["experimental"], + "exclude_deprecated": true + }) + application_mode: each +``` + +All the `semconv_grouped_<...>` functions are the composition of two functions: +`semconv_<...>` and `semconv_group_<...>_by_root_namespace`. + +> Note: JQ is a language for querying and transforming structured data. For more +> information, see [JQ Manual](https://jqlang.github.io/jq/manual/). The +> integration into Weaver is done through the Rust library `jaq`, which is a +> reimplementation of JQ in Rust. Most JQ filters are supported. For more +> information, see [jaq GitHub repository](https://github.com/01mf02/jaq). + +### Jinja Filters Reference + +All the filters available in the MiniJinja template engine are available (see +this online [documentation](https://docs.rs/minijinja/latest/minijinja/filters/index.html)) and +the [py_compat](https://github.com/mitsuhiko/minijinja/blob/e8a7ec5198deef7638267f2667714198ef64a1db/minijinja-contrib/src/pycompat.rs) +compatibility extensions that are also enabled in Weaver. + +In addition, OTel Weaver provides a set of custom filters to facilitate the generation of documentation and code. The following filters are available: @@ -173,8 +460,8 @@ The following filters are available: - `acronym`: Replaces acronyms in the input string with the full name defined in the `acronyms` section of the `weaver.yaml` configuration file. - `split_id`: Splits a string by '.' creating a list of nested ids. - `comment_with_prefix(prefix)`: Outputs a multiline comment with the given prefix. -- `flatten`: Converts a List of Lists into a single list with all elements. -e.g. \[\[a,b\],\[c\]\] => \[a,b,c\] +- `flatten`: Converts a List of Lists into a single list with all elements. + e.g. \[\[a,b\],\[c\]\] => \[a,b,c\] - `attribute_sort`: Sorts a list of `Attribute`s by requirement level, then name. - `metric_namespace`: Converts registry.{namespace}.{other}.{components} to {namespace}. - `attribute_registry_file`: Converts registry.{namespace}.{other}.{components} to attributes-registry/{namespace}.md (kebab-case namespace). @@ -186,9 +473,9 @@ e.g. \[\[a,b\],\[c\]\] => \[a,b,c\] - `instantiated_type`: Filters a type to return the instantiated type. - `enum_type`: Filters a type to return the enum type or an error if the type is not an enum. - `markdown_to_html`: Converts a markdown string to an HTML string. -- `map_text`: Converts an input into a string based on the `text_maps` section of the `weaver.yaml` configuration file -and a named text_map. The first parameter is the name of the text_map (required). The second parameter is the default -value if the name of the text map or the input are not found in the `text_maps` section (optional). +- `map_text`: Converts an input into a string based on the `text_maps` section of the `weaver.yaml` configuration file + and a named text_map. The first parameter is the name of the text_map (required). The second parameter is the default + value if the name of the text map or the input are not found in the `text_maps` section (optional). - `ansi_black`: Format a text using the black ansi code. - `ansi_red`: Format a text using the red ansi code. - `ansi_green`: Format a text using the green ansi code. @@ -228,20 +515,20 @@ value if the name of the text map or the input are not found in the `text_maps` > Please open an issue if you have any suggestions for new filters. They are easy to implement. -## Jinja Functions +### Jinja Functions Reference -All the functions available in the MiniJinja template engine are available (see +All the functions available in the MiniJinja template engine are available (see this online [documentation](https://docs.rs/minijinja/latest/minijinja/functions/index.html)). -Right now, OTel Weaver does not provide any custom functions but feel free to +Right now, OTel Weaver does not provide any custom functions but feel free to open an issue if you have any suggestions. They are easy to implement. -## Jinja Tests +### Jinja Tests Reference -All the tests available in the MiniJinja template engine are available (see +All the tests available in the MiniJinja template engine are available (see this online [documentation](https://docs.rs/minijinja/latest/minijinja/tests/index.html)). -In addition, OTel Weaver provides a set of custom tests to facilitate the +In addition, OTel Weaver provides a set of custom tests to facilitate the generation of assets. - `stable`: Tests if an `Attribute` is stable. @@ -252,4 +539,4 @@ generation of assets. - `template_type`: Tests if a type is a template type (i.e.: template[]). - `enum_type`: Tests if a type is an enum type. -> Please open an issue if you have any suggestions for new tests. They are easy to implement. +> Please open an issue if you have any suggestions for new tests. They are easy to implement. \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_attributes.json b/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_attributes.json new file mode 100644 index 00000000..f3b7465b --- /dev/null +++ b/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_attributes.json @@ -0,0 +1 @@ +[{"brief":"The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n","name":"db.cassandra.consistency_level","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":{"allow_custom_values":true,"members":[{"brief":null,"deprecated":null,"id":"all","note":null,"stability":null,"value":"all"},{"brief":null,"deprecated":null,"id":"each_quorum","note":null,"stability":null,"value":"each_quorum"},{"brief":null,"deprecated":null,"id":"quorum","note":null,"stability":null,"value":"quorum"},{"brief":null,"deprecated":null,"id":"local_quorum","note":null,"stability":null,"value":"local_quorum"},{"brief":null,"deprecated":null,"id":"one","note":null,"stability":null,"value":"one"},{"brief":null,"deprecated":null,"id":"two","note":null,"stability":null,"value":"two"},{"brief":null,"deprecated":null,"id":"three","note":null,"stability":null,"value":"three"},{"brief":null,"deprecated":null,"id":"local_one","note":null,"stability":null,"value":"local_one"},{"brief":null,"deprecated":null,"id":"any","note":null,"stability":null,"value":"any"},{"brief":null,"deprecated":null,"id":"serial","note":null,"stability":null,"value":"serial"},{"brief":null,"deprecated":null,"id":"local_serial","note":null,"stability":null,"value":"local_serial"}]}},{"brief":"The data center of the coordinating node for a query.\n","examples":"us-west-2","name":"db.cassandra.coordinator.dc","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"The ID of the coordinating node for a query.\n","examples":"be13faa2-8574-4d71-926d-27f16cf8a7af","name":"db.cassandra.coordinator.id","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"Whether or not the query is idempotent.\n","name":"db.cassandra.idempotence","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"boolean"},{"brief":"The fetch size used for paging, i.e. how many rows will be returned at once.\n","examples":[5000],"name":"db.cassandra.page_size","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"int"},{"brief":"The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.\n","examples":[0,2],"name":"db.cassandra.speculative_execution_count","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"int"},{"brief":"The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable).","examples":"mytable","name":"db.cassandra.table","note":"This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"The connection string used to connect to the database. It is recommended to remove embedded credentials.\n","examples":"Server=(localdb)\\v11.0;Integrated Security=true;","name":"db.connection_string","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"Unique Cosmos client instance id.","examples":"3ba4827d-4422-483f-b59f-85b74211c11d","name":"db.cosmosdb.client_id","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"string"},{"brief":"Cosmos client connection mode.","name":"db.cosmosdb.connection_mode","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":{"allow_custom_values":false,"members":[{"brief":"Gateway (HTTP) connections mode","deprecated":null,"id":"gateway","note":null,"stability":null,"value":"gateway"},{"brief":"Direct connection.","deprecated":null,"id":"direct","note":null,"stability":null,"value":"direct"}]}},{"brief":"Cosmos DB container name.","examples":"anystring","name":"db.cosmosdb.container","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"string"},{"brief":"CosmosDB Operation Type.","name":"db.cosmosdb.operation_type","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":{"allow_custom_values":true,"members":[{"brief":null,"deprecated":null,"id":"invalid","note":null,"stability":null,"value":"Invalid"},{"brief":null,"deprecated":null,"id":"create","note":null,"stability":null,"value":"Create"},{"brief":null,"deprecated":null,"id":"patch","note":null,"stability":null,"value":"Patch"},{"brief":null,"deprecated":null,"id":"read","note":null,"stability":null,"value":"Read"},{"brief":null,"deprecated":null,"id":"read_feed","note":null,"stability":null,"value":"ReadFeed"},{"brief":null,"deprecated":null,"id":"delete","note":null,"stability":null,"value":"Delete"},{"brief":null,"deprecated":null,"id":"replace","note":null,"stability":null,"value":"Replace"},{"brief":null,"deprecated":null,"id":"execute","note":null,"stability":null,"value":"Execute"},{"brief":null,"deprecated":null,"id":"query","note":null,"stability":null,"value":"Query"},{"brief":null,"deprecated":null,"id":"head","note":null,"stability":null,"value":"Head"},{"brief":null,"deprecated":null,"id":"head_feed","note":null,"stability":null,"value":"HeadFeed"},{"brief":null,"deprecated":null,"id":"upsert","note":null,"stability":null,"value":"Upsert"},{"brief":null,"deprecated":null,"id":"batch","note":null,"stability":null,"value":"Batch"},{"brief":null,"deprecated":null,"id":"query_plan","note":null,"stability":null,"value":"QueryPlan"},{"brief":null,"deprecated":null,"id":"execute_javascript","note":null,"stability":null,"value":"ExecuteJavaScript"}]}},{"brief":"RU consumed for that operation","examples":[46.18,1.0],"name":"db.cosmosdb.request_charge","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"double"},{"brief":"Request payload size in bytes","name":"db.cosmosdb.request_content_length","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Cosmos DB status code.","examples":[200,201],"name":"db.cosmosdb.status_code","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Cosmos DB sub status code.","examples":[1000,1002],"name":"db.cosmosdb.sub_status_code","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Represents the identifier of an Elasticsearch cluster.\n","examples":["e9106fc68e3044f0b1475b04bf4ffd5f"],"name":"db.elasticsearch.cluster.name","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"string"},{"brief":"Represents the human-readable identifier of the node/instance to which a request was routed.\n","examples":["instance-0000000001"],"name":"db.elasticsearch.node.name","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"string"},{"brief":"A dynamic value in the url path.\n","examples":["db.elasticsearch.path_parts.index=test-index","db.elasticsearch.path_parts.doc_id=123"],"name":"db.elasticsearch.path_parts","note":"Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.\u003ckey\u003e`, where `\u003ckey\u003e` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"template[string]"},{"brief":"An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`.\n","examples":"mysql-e26b99z.example.com","name":"db.instance.id","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.\n","examples":["org.postgresql.Driver","com.microsoft.sqlserver.jdbc.SQLServerDriver"],"name":"db.jdbc.driver_classname","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-jdbc","type":"string"},{"brief":"The MongoDB collection being accessed within the database stated in `db.name`.\n","examples":["customers","products"],"name":"db.mongodb.collection","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-mongodb","type":"string"},{"brief":"The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.\n","examples":"MSSQLSERVER","name":"db.mssql.instance_name","note":"If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard).\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-mssql","type":"string"},{"brief":"This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).\n","examples":["customers","main"],"name":"db.name","note":"In some SQL databases, the database name to be used is called \"schema name\". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name).\n","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.\n","examples":["findAndModify","HMSET","SELECT"],"name":"db.operation","note":"When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.\n","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.\n","examples":[0,1,15],"name":"db.redis.database_index","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-redis","type":"int"},{"brief":"The name of the primary table that the operation is acting upon, including the database name (if applicable).","examples":["public.users","customers"],"name":"db.sql.table","note":"It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-sql","type":"string"},{"brief":"The database statement being executed.\n","examples":["SELECT * FROM wuser_table","SET mykey \"WuValue\""],"name":"db.statement","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.","name":"db.system","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":{"allow_custom_values":true,"members":[{"brief":"Some other SQL database. Fallback only. See notes.","deprecated":null,"id":"other_sql","note":null,"stability":null,"value":"other_sql"},{"brief":"Microsoft SQL Server","deprecated":null,"id":"mssql","note":null,"stability":null,"value":"mssql"},{"brief":"Microsoft SQL Server Compact","deprecated":null,"id":"mssqlcompact","note":null,"stability":null,"value":"mssqlcompact"},{"brief":"MySQL","deprecated":null,"id":"mysql","note":null,"stability":null,"value":"mysql"},{"brief":"Oracle Database","deprecated":null,"id":"oracle","note":null,"stability":null,"value":"oracle"},{"brief":"IBM Db2","deprecated":null,"id":"db2","note":null,"stability":null,"value":"db2"},{"brief":"PostgreSQL","deprecated":null,"id":"postgresql","note":null,"stability":null,"value":"postgresql"},{"brief":"Amazon Redshift","deprecated":null,"id":"redshift","note":null,"stability":null,"value":"redshift"},{"brief":"Apache Hive","deprecated":null,"id":"hive","note":null,"stability":null,"value":"hive"},{"brief":"Cloudscape","deprecated":null,"id":"cloudscape","note":null,"stability":null,"value":"cloudscape"},{"brief":"HyperSQL DataBase","deprecated":null,"id":"hsqldb","note":null,"stability":null,"value":"hsqldb"},{"brief":"Progress Database","deprecated":null,"id":"progress","note":null,"stability":null,"value":"progress"},{"brief":"SAP MaxDB","deprecated":null,"id":"maxdb","note":null,"stability":null,"value":"maxdb"},{"brief":"SAP HANA","deprecated":null,"id":"hanadb","note":null,"stability":null,"value":"hanadb"},{"brief":"Ingres","deprecated":null,"id":"ingres","note":null,"stability":null,"value":"ingres"},{"brief":"FirstSQL","deprecated":null,"id":"firstsql","note":null,"stability":null,"value":"firstsql"},{"brief":"EnterpriseDB","deprecated":null,"id":"edb","note":null,"stability":null,"value":"edb"},{"brief":"InterSystems Caché","deprecated":null,"id":"cache","note":null,"stability":null,"value":"cache"},{"brief":"Adabas (Adaptable Database System)","deprecated":null,"id":"adabas","note":null,"stability":null,"value":"adabas"},{"brief":"Firebird","deprecated":null,"id":"firebird","note":null,"stability":null,"value":"firebird"},{"brief":"Apache Derby","deprecated":null,"id":"derby","note":null,"stability":null,"value":"derby"},{"brief":"FileMaker","deprecated":null,"id":"filemaker","note":null,"stability":null,"value":"filemaker"},{"brief":"Informix","deprecated":null,"id":"informix","note":null,"stability":null,"value":"informix"},{"brief":"InstantDB","deprecated":null,"id":"instantdb","note":null,"stability":null,"value":"instantdb"},{"brief":"InterBase","deprecated":null,"id":"interbase","note":null,"stability":null,"value":"interbase"},{"brief":"MariaDB","deprecated":null,"id":"mariadb","note":null,"stability":null,"value":"mariadb"},{"brief":"Netezza","deprecated":null,"id":"netezza","note":null,"stability":null,"value":"netezza"},{"brief":"Pervasive PSQL","deprecated":null,"id":"pervasive","note":null,"stability":null,"value":"pervasive"},{"brief":"PointBase","deprecated":null,"id":"pointbase","note":null,"stability":null,"value":"pointbase"},{"brief":"SQLite","deprecated":null,"id":"sqlite","note":null,"stability":null,"value":"sqlite"},{"brief":"Sybase","deprecated":null,"id":"sybase","note":null,"stability":null,"value":"sybase"},{"brief":"Teradata","deprecated":null,"id":"teradata","note":null,"stability":null,"value":"teradata"},{"brief":"Vertica","deprecated":null,"id":"vertica","note":null,"stability":null,"value":"vertica"},{"brief":"H2","deprecated":null,"id":"h2","note":null,"stability":null,"value":"h2"},{"brief":"ColdFusion IMQ","deprecated":null,"id":"coldfusion","note":null,"stability":null,"value":"coldfusion"},{"brief":"Apache Cassandra","deprecated":null,"id":"cassandra","note":null,"stability":null,"value":"cassandra"},{"brief":"Apache HBase","deprecated":null,"id":"hbase","note":null,"stability":null,"value":"hbase"},{"brief":"MongoDB","deprecated":null,"id":"mongodb","note":null,"stability":null,"value":"mongodb"},{"brief":"Redis","deprecated":null,"id":"redis","note":null,"stability":null,"value":"redis"},{"brief":"Couchbase","deprecated":null,"id":"couchbase","note":null,"stability":null,"value":"couchbase"},{"brief":"CouchDB","deprecated":null,"id":"couchdb","note":null,"stability":null,"value":"couchdb"},{"brief":"Microsoft Azure Cosmos DB","deprecated":null,"id":"cosmosdb","note":null,"stability":null,"value":"cosmosdb"},{"brief":"Amazon DynamoDB","deprecated":null,"id":"dynamodb","note":null,"stability":null,"value":"dynamodb"},{"brief":"Neo4j","deprecated":null,"id":"neo4j","note":null,"stability":null,"value":"neo4j"},{"brief":"Apache Geode","deprecated":null,"id":"geode","note":null,"stability":null,"value":"geode"},{"brief":"Elasticsearch","deprecated":null,"id":"elasticsearch","note":null,"stability":null,"value":"elasticsearch"},{"brief":"Memcached","deprecated":null,"id":"memcached","note":null,"stability":null,"value":"memcached"},{"brief":"CockroachDB","deprecated":null,"id":"cockroachdb","note":null,"stability":null,"value":"cockroachdb"},{"brief":"OpenSearch","deprecated":null,"id":"opensearch","note":null,"stability":null,"value":"opensearch"},{"brief":"ClickHouse","deprecated":null,"id":"clickhouse","note":null,"stability":null,"value":"clickhouse"},{"brief":"Cloud Spanner","deprecated":null,"id":"spanner","note":null,"stability":null,"value":"spanner"},{"brief":"Trino","deprecated":null,"id":"trino","note":null,"stability":null,"value":"trino"}]}},{"brief":"Username for accessing the database.\n","examples":["readonly_user","reporting_user"],"name":"db.user","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.\n","examples":3495,"name":"http.request.body.size","requirement_level":"recommended","root_namespace":"http","stability":"experimental","type":"int"},{"brief":"HTTP request headers, `\u003ckey\u003e` being the normalized HTTP Header name (lowercase), the value being the header values.\n","examples":["http.request.header.content-type=[\"application/json\"]","http.request.header.x-forwarded-for=[\"1.2.3.4\", \"1.2.3.5\"]"],"name":"http.request.header","note":"Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\nThe `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended.\nThe attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"template[string[]]"},{"brief":"HTTP request method.","examples":["GET","POST","HEAD"],"name":"http.request.method","note":"HTTP request method value SHOULD be \"known\" to the instrumentation.\nBy default, this convention defines \"known\" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)\nand the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).\n\nIf the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.\n\nIf the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override\nthe list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named\nOTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods\n(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults).\n\nHTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly.\nInstrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent.\nTracing instrumentations that do so, MUST also set `http.request.method_original` to the original value.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":{"allow_custom_values":true,"members":[{"brief":"CONNECT method.","deprecated":null,"id":"connect","note":null,"stability":null,"value":"CONNECT"},{"brief":"DELETE method.","deprecated":null,"id":"delete","note":null,"stability":null,"value":"DELETE"},{"brief":"GET method.","deprecated":null,"id":"get","note":null,"stability":null,"value":"GET"},{"brief":"HEAD method.","deprecated":null,"id":"head","note":null,"stability":null,"value":"HEAD"},{"brief":"OPTIONS method.","deprecated":null,"id":"options","note":null,"stability":null,"value":"OPTIONS"},{"brief":"PATCH method.","deprecated":null,"id":"patch","note":null,"stability":null,"value":"PATCH"},{"brief":"POST method.","deprecated":null,"id":"post","note":null,"stability":null,"value":"POST"},{"brief":"PUT method.","deprecated":null,"id":"put","note":null,"stability":null,"value":"PUT"},{"brief":"TRACE method.","deprecated":null,"id":"trace","note":null,"stability":null,"value":"TRACE"},{"brief":"Any HTTP method that the instrumentation has no prior knowledge of.","deprecated":null,"id":"other","note":null,"stability":null,"value":"_OTHER"}]}},{"brief":"Original HTTP method sent by the client in the request line.","examples":["GeT","ACL","foo"],"name":"http.request.method_original","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"string"},{"brief":"The ordinal number of request resending attempt (for any reason, including redirects).\n","examples":3,"name":"http.request.resend_count","note":"The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"int"},{"brief":"The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.\n","examples":3495,"name":"http.response.body.size","requirement_level":"recommended","root_namespace":"http","stability":"experimental","type":"int"},{"brief":"HTTP response headers, `\u003ckey\u003e` being the normalized HTTP Header name (lowercase), the value being the header values.\n","examples":["http.response.header.content-type=[\"application/json\"]","http.response.header.my-custom-header=[\"abc\", \"def\"]"],"name":"http.response.header","note":"Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\nUsers MAY explicitly configure instrumentations to capture them even though it is not recommended.\nThe attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"template[string[]]"},{"brief":"[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).","examples":[200],"name":"http.response.status_code","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"int"},{"brief":"The matched route, that is, the path template in the format used by the respective server framework.\n","examples":["/users/:userID?","{controller}/{action}/{id?}"],"name":"http.route","note":"MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.\nSHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"string"},{"brief":"The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.","examples":"DE","name":"network.carrier.icc","requirement_level":"recommended","root_namespace":"network","type":"string"},{"brief":"The mobile carrier country code.","examples":"310","name":"network.carrier.mcc","requirement_level":"recommended","root_namespace":"network","type":"string"},{"brief":"The mobile carrier network code.","examples":"001","name":"network.carrier.mnc","requirement_level":"recommended","root_namespace":"network","type":"string"},{"brief":"The name of the mobile carrier.","examples":"sprint","name":"network.carrier.name","requirement_level":"recommended","root_namespace":"network","type":"string"},{"brief":"This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.","examples":"LTE","name":"network.connection.subtype","requirement_level":"recommended","root_namespace":"network","type":{"allow_custom_values":true,"members":[{"brief":"GPRS","deprecated":null,"id":"gprs","note":null,"stability":null,"value":"gprs"},{"brief":"EDGE","deprecated":null,"id":"edge","note":null,"stability":null,"value":"edge"},{"brief":"UMTS","deprecated":null,"id":"umts","note":null,"stability":null,"value":"umts"},{"brief":"CDMA","deprecated":null,"id":"cdma","note":null,"stability":null,"value":"cdma"},{"brief":"EVDO Rel. 0","deprecated":null,"id":"evdo_0","note":null,"stability":null,"value":"evdo_0"},{"brief":"EVDO Rev. A","deprecated":null,"id":"evdo_a","note":null,"stability":null,"value":"evdo_a"},{"brief":"CDMA2000 1XRTT","deprecated":null,"id":"cdma2000_1xrtt","note":null,"stability":null,"value":"cdma2000_1xrtt"},{"brief":"HSDPA","deprecated":null,"id":"hsdpa","note":null,"stability":null,"value":"hsdpa"},{"brief":"HSUPA","deprecated":null,"id":"hsupa","note":null,"stability":null,"value":"hsupa"},{"brief":"HSPA","deprecated":null,"id":"hspa","note":null,"stability":null,"value":"hspa"},{"brief":"IDEN","deprecated":null,"id":"iden","note":null,"stability":null,"value":"iden"},{"brief":"EVDO Rev. B","deprecated":null,"id":"evdo_b","note":null,"stability":null,"value":"evdo_b"},{"brief":"LTE","deprecated":null,"id":"lte","note":null,"stability":null,"value":"lte"},{"brief":"EHRPD","deprecated":null,"id":"ehrpd","note":null,"stability":null,"value":"ehrpd"},{"brief":"HSPAP","deprecated":null,"id":"hspap","note":null,"stability":null,"value":"hspap"},{"brief":"GSM","deprecated":null,"id":"gsm","note":null,"stability":null,"value":"gsm"},{"brief":"TD-SCDMA","deprecated":null,"id":"td_scdma","note":null,"stability":null,"value":"td_scdma"},{"brief":"IWLAN","deprecated":null,"id":"iwlan","note":null,"stability":null,"value":"iwlan"},{"brief":"5G NR (New Radio)","deprecated":null,"id":"nr","note":null,"stability":null,"value":"nr"},{"brief":"5G NRNSA (New Radio Non-Standalone)","deprecated":null,"id":"nrnsa","note":null,"stability":null,"value":"nrnsa"},{"brief":"LTE CA","deprecated":null,"id":"lte_ca","note":null,"stability":null,"value":"lte_ca"}]}},{"brief":"The internet connection type.","examples":"wifi","name":"network.connection.type","requirement_level":"recommended","root_namespace":"network","type":{"allow_custom_values":true,"members":[{"brief":null,"deprecated":null,"id":"wifi","note":null,"stability":null,"value":"wifi"},{"brief":null,"deprecated":null,"id":"wired","note":null,"stability":null,"value":"wired"},{"brief":null,"deprecated":null,"id":"cell","note":null,"stability":null,"value":"cell"},{"brief":null,"deprecated":null,"id":"unavailable","note":null,"stability":null,"value":"unavailable"},{"brief":null,"deprecated":null,"id":"unknown","note":null,"stability":null,"value":"unknown"}]}},{"brief":"The network IO operation direction.","examples":["transmit"],"name":"network.io.direction","requirement_level":"recommended","root_namespace":"network","type":{"allow_custom_values":false,"members":[{"brief":null,"deprecated":null,"id":"transmit","note":null,"stability":null,"value":"transmit"},{"brief":null,"deprecated":null,"id":"receive","note":null,"stability":null,"value":"receive"}]}},{"brief":"Local address of the network connection - IP address or Unix domain socket name.","examples":["10.1.2.80","/tmp/my.sock"],"name":"network.local.address","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"string"},{"brief":"Local port number of the network connection.","examples":[65123],"name":"network.local.port","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"int"},{"brief":"Peer address of the network connection - IP address or Unix domain socket name.","examples":["10.1.2.80","/tmp/my.sock"],"name":"network.peer.address","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"string"},{"brief":"Peer port number of the network connection.","examples":[65123],"name":"network.peer.port","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"int"},{"brief":"[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.","examples":["amqp","http","mqtt"],"name":"network.protocol.name","note":"The value SHOULD be normalized to lowercase.","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"string"},{"brief":"Version of the protocol specified in `network.protocol.name`.","examples":"3.1.1","name":"network.protocol.version","note":"`network.protocol.version` refers to the version of the protocol used and might be different from the protocol client\u0027s version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.\n","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"string"},{"brief":"[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).\n","examples":["tcp","udp"],"name":"network.transport","note":"The value SHOULD be normalized to lowercase.\n\nConsider always setting the transport when setting a port number, since\na port number is ambiguous without knowing the transport. For example\ndifferent processes could be listening on TCP port 12345 and UDP port 12345.\n","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":{"allow_custom_values":true,"members":[{"brief":"TCP","deprecated":null,"id":"tcp","note":null,"stability":null,"value":"tcp"},{"brief":"UDP","deprecated":null,"id":"udp","note":null,"stability":null,"value":"udp"},{"brief":"Named or anonymous pipe.","deprecated":null,"id":"pipe","note":null,"stability":null,"value":"pipe"},{"brief":"Unix domain socket","deprecated":null,"id":"unix","note":null,"stability":null,"value":"unix"}]}},{"brief":"[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.","examples":["ipv4","ipv6"],"name":"network.type","note":"The value SHOULD be normalized to lowercase.","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":{"allow_custom_values":true,"members":[{"brief":"IPv4","deprecated":null,"id":"ipv4","note":null,"stability":null,"value":"ipv4"},{"brief":"IPv6","deprecated":null,"id":"ipv6","note":null,"stability":null,"value":"ipv6"}]}},{"brief":"The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component","examples":["SemConv"],"name":"url.fragment","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)","examples":["https://www.foo.bar/search?q=OpenTelemetry#SemConv","//localhost"],"name":"url.full","note":"For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.\n`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute\u0027s value SHOULD be `https://REDACTED:REDACTED@www.example.com/`.\n`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes.\n","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component","examples":["/search"],"name":"url.path","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component","examples":["q=OpenTelemetry"],"name":"url.query","note":"Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it.","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.","examples":["https","ftp","telnet"],"name":"url.scheme","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.\n","examples":["CERN-LineMode/2.15 libwww/2.17b3","Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1"],"name":"user_agent.original","requirement_level":"recommended","root_namespace":"user_agent","stability":"stable","type":"string"}] \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_grouped_attributes.json b/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_grouped_attributes.json new file mode 100644 index 00000000..7239c2dd --- /dev/null +++ b/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_grouped_attributes.json @@ -0,0 +1 @@ +[{"attributes":[{"brief":"The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n","name":"db.cassandra.consistency_level","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":{"allow_custom_values":true,"members":[{"brief":null,"deprecated":null,"id":"all","note":null,"stability":null,"value":"all"},{"brief":null,"deprecated":null,"id":"each_quorum","note":null,"stability":null,"value":"each_quorum"},{"brief":null,"deprecated":null,"id":"quorum","note":null,"stability":null,"value":"quorum"},{"brief":null,"deprecated":null,"id":"local_quorum","note":null,"stability":null,"value":"local_quorum"},{"brief":null,"deprecated":null,"id":"one","note":null,"stability":null,"value":"one"},{"brief":null,"deprecated":null,"id":"two","note":null,"stability":null,"value":"two"},{"brief":null,"deprecated":null,"id":"three","note":null,"stability":null,"value":"three"},{"brief":null,"deprecated":null,"id":"local_one","note":null,"stability":null,"value":"local_one"},{"brief":null,"deprecated":null,"id":"any","note":null,"stability":null,"value":"any"},{"brief":null,"deprecated":null,"id":"serial","note":null,"stability":null,"value":"serial"},{"brief":null,"deprecated":null,"id":"local_serial","note":null,"stability":null,"value":"local_serial"}]}},{"brief":"The data center of the coordinating node for a query.\n","examples":"us-west-2","name":"db.cassandra.coordinator.dc","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"The ID of the coordinating node for a query.\n","examples":"be13faa2-8574-4d71-926d-27f16cf8a7af","name":"db.cassandra.coordinator.id","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"Whether or not the query is idempotent.\n","name":"db.cassandra.idempotence","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"boolean"},{"brief":"The fetch size used for paging, i.e. how many rows will be returned at once.\n","examples":[5000],"name":"db.cassandra.page_size","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"int"},{"brief":"The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.\n","examples":[0,2],"name":"db.cassandra.speculative_execution_count","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"int"},{"brief":"The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable).","examples":"mytable","name":"db.cassandra.table","note":"This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"The connection string used to connect to the database. It is recommended to remove embedded credentials.\n","examples":"Server=(localdb)\\v11.0;Integrated Security=true;","name":"db.connection_string","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"Unique Cosmos client instance id.","examples":"3ba4827d-4422-483f-b59f-85b74211c11d","name":"db.cosmosdb.client_id","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"string"},{"brief":"Cosmos client connection mode.","name":"db.cosmosdb.connection_mode","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":{"allow_custom_values":false,"members":[{"brief":"Gateway (HTTP) connections mode","deprecated":null,"id":"gateway","note":null,"stability":null,"value":"gateway"},{"brief":"Direct connection.","deprecated":null,"id":"direct","note":null,"stability":null,"value":"direct"}]}},{"brief":"Cosmos DB container name.","examples":"anystring","name":"db.cosmosdb.container","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"string"},{"brief":"CosmosDB Operation Type.","name":"db.cosmosdb.operation_type","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":{"allow_custom_values":true,"members":[{"brief":null,"deprecated":null,"id":"invalid","note":null,"stability":null,"value":"Invalid"},{"brief":null,"deprecated":null,"id":"create","note":null,"stability":null,"value":"Create"},{"brief":null,"deprecated":null,"id":"patch","note":null,"stability":null,"value":"Patch"},{"brief":null,"deprecated":null,"id":"read","note":null,"stability":null,"value":"Read"},{"brief":null,"deprecated":null,"id":"read_feed","note":null,"stability":null,"value":"ReadFeed"},{"brief":null,"deprecated":null,"id":"delete","note":null,"stability":null,"value":"Delete"},{"brief":null,"deprecated":null,"id":"replace","note":null,"stability":null,"value":"Replace"},{"brief":null,"deprecated":null,"id":"execute","note":null,"stability":null,"value":"Execute"},{"brief":null,"deprecated":null,"id":"query","note":null,"stability":null,"value":"Query"},{"brief":null,"deprecated":null,"id":"head","note":null,"stability":null,"value":"Head"},{"brief":null,"deprecated":null,"id":"head_feed","note":null,"stability":null,"value":"HeadFeed"},{"brief":null,"deprecated":null,"id":"upsert","note":null,"stability":null,"value":"Upsert"},{"brief":null,"deprecated":null,"id":"batch","note":null,"stability":null,"value":"Batch"},{"brief":null,"deprecated":null,"id":"query_plan","note":null,"stability":null,"value":"QueryPlan"},{"brief":null,"deprecated":null,"id":"execute_javascript","note":null,"stability":null,"value":"ExecuteJavaScript"}]}},{"brief":"RU consumed for that operation","examples":[46.18,1.0],"name":"db.cosmosdb.request_charge","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"double"},{"brief":"Request payload size in bytes","name":"db.cosmosdb.request_content_length","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Cosmos DB status code.","examples":[200,201],"name":"db.cosmosdb.status_code","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Cosmos DB sub status code.","examples":[1000,1002],"name":"db.cosmosdb.sub_status_code","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Represents the identifier of an Elasticsearch cluster.\n","examples":["e9106fc68e3044f0b1475b04bf4ffd5f"],"name":"db.elasticsearch.cluster.name","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"string"},{"brief":"Represents the human-readable identifier of the node/instance to which a request was routed.\n","examples":["instance-0000000001"],"name":"db.elasticsearch.node.name","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"string"},{"brief":"A dynamic value in the url path.\n","examples":["db.elasticsearch.path_parts.index=test-index","db.elasticsearch.path_parts.doc_id=123"],"name":"db.elasticsearch.path_parts","note":"Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.\u003ckey\u003e`, where `\u003ckey\u003e` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"template[string]"},{"brief":"An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`.\n","examples":"mysql-e26b99z.example.com","name":"db.instance.id","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.\n","examples":["org.postgresql.Driver","com.microsoft.sqlserver.jdbc.SQLServerDriver"],"name":"db.jdbc.driver_classname","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-jdbc","type":"string"},{"brief":"The MongoDB collection being accessed within the database stated in `db.name`.\n","examples":["customers","products"],"name":"db.mongodb.collection","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-mongodb","type":"string"},{"brief":"The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.\n","examples":"MSSQLSERVER","name":"db.mssql.instance_name","note":"If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard).\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-mssql","type":"string"},{"brief":"This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).\n","examples":["customers","main"],"name":"db.name","note":"In some SQL databases, the database name to be used is called \"schema name\". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name).\n","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.\n","examples":["findAndModify","HMSET","SELECT"],"name":"db.operation","note":"When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.\n","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.\n","examples":[0,1,15],"name":"db.redis.database_index","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-redis","type":"int"},{"brief":"The name of the primary table that the operation is acting upon, including the database name (if applicable).","examples":["public.users","customers"],"name":"db.sql.table","note":"It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-sql","type":"string"},{"brief":"The database statement being executed.\n","examples":["SELECT * FROM wuser_table","SET mykey \"WuValue\""],"name":"db.statement","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.","name":"db.system","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":{"allow_custom_values":true,"members":[{"brief":"Some other SQL database. Fallback only. See notes.","deprecated":null,"id":"other_sql","note":null,"stability":null,"value":"other_sql"},{"brief":"Microsoft SQL Server","deprecated":null,"id":"mssql","note":null,"stability":null,"value":"mssql"},{"brief":"Microsoft SQL Server Compact","deprecated":null,"id":"mssqlcompact","note":null,"stability":null,"value":"mssqlcompact"},{"brief":"MySQL","deprecated":null,"id":"mysql","note":null,"stability":null,"value":"mysql"},{"brief":"Oracle Database","deprecated":null,"id":"oracle","note":null,"stability":null,"value":"oracle"},{"brief":"IBM Db2","deprecated":null,"id":"db2","note":null,"stability":null,"value":"db2"},{"brief":"PostgreSQL","deprecated":null,"id":"postgresql","note":null,"stability":null,"value":"postgresql"},{"brief":"Amazon Redshift","deprecated":null,"id":"redshift","note":null,"stability":null,"value":"redshift"},{"brief":"Apache Hive","deprecated":null,"id":"hive","note":null,"stability":null,"value":"hive"},{"brief":"Cloudscape","deprecated":null,"id":"cloudscape","note":null,"stability":null,"value":"cloudscape"},{"brief":"HyperSQL DataBase","deprecated":null,"id":"hsqldb","note":null,"stability":null,"value":"hsqldb"},{"brief":"Progress Database","deprecated":null,"id":"progress","note":null,"stability":null,"value":"progress"},{"brief":"SAP MaxDB","deprecated":null,"id":"maxdb","note":null,"stability":null,"value":"maxdb"},{"brief":"SAP HANA","deprecated":null,"id":"hanadb","note":null,"stability":null,"value":"hanadb"},{"brief":"Ingres","deprecated":null,"id":"ingres","note":null,"stability":null,"value":"ingres"},{"brief":"FirstSQL","deprecated":null,"id":"firstsql","note":null,"stability":null,"value":"firstsql"},{"brief":"EnterpriseDB","deprecated":null,"id":"edb","note":null,"stability":null,"value":"edb"},{"brief":"InterSystems Caché","deprecated":null,"id":"cache","note":null,"stability":null,"value":"cache"},{"brief":"Adabas (Adaptable Database System)","deprecated":null,"id":"adabas","note":null,"stability":null,"value":"adabas"},{"brief":"Firebird","deprecated":null,"id":"firebird","note":null,"stability":null,"value":"firebird"},{"brief":"Apache Derby","deprecated":null,"id":"derby","note":null,"stability":null,"value":"derby"},{"brief":"FileMaker","deprecated":null,"id":"filemaker","note":null,"stability":null,"value":"filemaker"},{"brief":"Informix","deprecated":null,"id":"informix","note":null,"stability":null,"value":"informix"},{"brief":"InstantDB","deprecated":null,"id":"instantdb","note":null,"stability":null,"value":"instantdb"},{"brief":"InterBase","deprecated":null,"id":"interbase","note":null,"stability":null,"value":"interbase"},{"brief":"MariaDB","deprecated":null,"id":"mariadb","note":null,"stability":null,"value":"mariadb"},{"brief":"Netezza","deprecated":null,"id":"netezza","note":null,"stability":null,"value":"netezza"},{"brief":"Pervasive PSQL","deprecated":null,"id":"pervasive","note":null,"stability":null,"value":"pervasive"},{"brief":"PointBase","deprecated":null,"id":"pointbase","note":null,"stability":null,"value":"pointbase"},{"brief":"SQLite","deprecated":null,"id":"sqlite","note":null,"stability":null,"value":"sqlite"},{"brief":"Sybase","deprecated":null,"id":"sybase","note":null,"stability":null,"value":"sybase"},{"brief":"Teradata","deprecated":null,"id":"teradata","note":null,"stability":null,"value":"teradata"},{"brief":"Vertica","deprecated":null,"id":"vertica","note":null,"stability":null,"value":"vertica"},{"brief":"H2","deprecated":null,"id":"h2","note":null,"stability":null,"value":"h2"},{"brief":"ColdFusion IMQ","deprecated":null,"id":"coldfusion","note":null,"stability":null,"value":"coldfusion"},{"brief":"Apache Cassandra","deprecated":null,"id":"cassandra","note":null,"stability":null,"value":"cassandra"},{"brief":"Apache HBase","deprecated":null,"id":"hbase","note":null,"stability":null,"value":"hbase"},{"brief":"MongoDB","deprecated":null,"id":"mongodb","note":null,"stability":null,"value":"mongodb"},{"brief":"Redis","deprecated":null,"id":"redis","note":null,"stability":null,"value":"redis"},{"brief":"Couchbase","deprecated":null,"id":"couchbase","note":null,"stability":null,"value":"couchbase"},{"brief":"CouchDB","deprecated":null,"id":"couchdb","note":null,"stability":null,"value":"couchdb"},{"brief":"Microsoft Azure Cosmos DB","deprecated":null,"id":"cosmosdb","note":null,"stability":null,"value":"cosmosdb"},{"brief":"Amazon DynamoDB","deprecated":null,"id":"dynamodb","note":null,"stability":null,"value":"dynamodb"},{"brief":"Neo4j","deprecated":null,"id":"neo4j","note":null,"stability":null,"value":"neo4j"},{"brief":"Apache Geode","deprecated":null,"id":"geode","note":null,"stability":null,"value":"geode"},{"brief":"Elasticsearch","deprecated":null,"id":"elasticsearch","note":null,"stability":null,"value":"elasticsearch"},{"brief":"Memcached","deprecated":null,"id":"memcached","note":null,"stability":null,"value":"memcached"},{"brief":"CockroachDB","deprecated":null,"id":"cockroachdb","note":null,"stability":null,"value":"cockroachdb"},{"brief":"OpenSearch","deprecated":null,"id":"opensearch","note":null,"stability":null,"value":"opensearch"},{"brief":"ClickHouse","deprecated":null,"id":"clickhouse","note":null,"stability":null,"value":"clickhouse"},{"brief":"Cloud Spanner","deprecated":null,"id":"spanner","note":null,"stability":null,"value":"spanner"},{"brief":"Trino","deprecated":null,"id":"trino","note":null,"stability":null,"value":"trino"}]}},{"brief":"Username for accessing the database.\n","examples":["readonly_user","reporting_user"],"name":"db.user","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"}],"root_namespace":"db"},{"attributes":[{"brief":"The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.\n","examples":3495,"name":"http.request.body.size","requirement_level":"recommended","root_namespace":"http","stability":"experimental","type":"int"},{"brief":"HTTP request headers, `\u003ckey\u003e` being the normalized HTTP Header name (lowercase), the value being the header values.\n","examples":["http.request.header.content-type=[\"application/json\"]","http.request.header.x-forwarded-for=[\"1.2.3.4\", \"1.2.3.5\"]"],"name":"http.request.header","note":"Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\nThe `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended.\nThe attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"template[string[]]"},{"brief":"HTTP request method.","examples":["GET","POST","HEAD"],"name":"http.request.method","note":"HTTP request method value SHOULD be \"known\" to the instrumentation.\nBy default, this convention defines \"known\" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)\nand the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).\n\nIf the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.\n\nIf the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override\nthe list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named\nOTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods\n(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults).\n\nHTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly.\nInstrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent.\nTracing instrumentations that do so, MUST also set `http.request.method_original` to the original value.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":{"allow_custom_values":true,"members":[{"brief":"CONNECT method.","deprecated":null,"id":"connect","note":null,"stability":null,"value":"CONNECT"},{"brief":"DELETE method.","deprecated":null,"id":"delete","note":null,"stability":null,"value":"DELETE"},{"brief":"GET method.","deprecated":null,"id":"get","note":null,"stability":null,"value":"GET"},{"brief":"HEAD method.","deprecated":null,"id":"head","note":null,"stability":null,"value":"HEAD"},{"brief":"OPTIONS method.","deprecated":null,"id":"options","note":null,"stability":null,"value":"OPTIONS"},{"brief":"PATCH method.","deprecated":null,"id":"patch","note":null,"stability":null,"value":"PATCH"},{"brief":"POST method.","deprecated":null,"id":"post","note":null,"stability":null,"value":"POST"},{"brief":"PUT method.","deprecated":null,"id":"put","note":null,"stability":null,"value":"PUT"},{"brief":"TRACE method.","deprecated":null,"id":"trace","note":null,"stability":null,"value":"TRACE"},{"brief":"Any HTTP method that the instrumentation has no prior knowledge of.","deprecated":null,"id":"other","note":null,"stability":null,"value":"_OTHER"}]}},{"brief":"Original HTTP method sent by the client in the request line.","examples":["GeT","ACL","foo"],"name":"http.request.method_original","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"string"},{"brief":"The ordinal number of request resending attempt (for any reason, including redirects).\n","examples":3,"name":"http.request.resend_count","note":"The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"int"},{"brief":"The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.\n","examples":3495,"name":"http.response.body.size","requirement_level":"recommended","root_namespace":"http","stability":"experimental","type":"int"},{"brief":"HTTP response headers, `\u003ckey\u003e` being the normalized HTTP Header name (lowercase), the value being the header values.\n","examples":["http.response.header.content-type=[\"application/json\"]","http.response.header.my-custom-header=[\"abc\", \"def\"]"],"name":"http.response.header","note":"Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\nUsers MAY explicitly configure instrumentations to capture them even though it is not recommended.\nThe attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"template[string[]]"},{"brief":"[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).","examples":[200],"name":"http.response.status_code","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"int"},{"brief":"The matched route, that is, the path template in the format used by the respective server framework.\n","examples":["/users/:userID?","{controller}/{action}/{id?}"],"name":"http.route","note":"MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.\nSHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"string"}],"root_namespace":"http"},{"attributes":[{"brief":"The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.","examples":"DE","name":"network.carrier.icc","requirement_level":"recommended","root_namespace":"network","type":"string"},{"brief":"The mobile carrier country code.","examples":"310","name":"network.carrier.mcc","requirement_level":"recommended","root_namespace":"network","type":"string"},{"brief":"The mobile carrier network code.","examples":"001","name":"network.carrier.mnc","requirement_level":"recommended","root_namespace":"network","type":"string"},{"brief":"The name of the mobile carrier.","examples":"sprint","name":"network.carrier.name","requirement_level":"recommended","root_namespace":"network","type":"string"},{"brief":"This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.","examples":"LTE","name":"network.connection.subtype","requirement_level":"recommended","root_namespace":"network","type":{"allow_custom_values":true,"members":[{"brief":"GPRS","deprecated":null,"id":"gprs","note":null,"stability":null,"value":"gprs"},{"brief":"EDGE","deprecated":null,"id":"edge","note":null,"stability":null,"value":"edge"},{"brief":"UMTS","deprecated":null,"id":"umts","note":null,"stability":null,"value":"umts"},{"brief":"CDMA","deprecated":null,"id":"cdma","note":null,"stability":null,"value":"cdma"},{"brief":"EVDO Rel. 0","deprecated":null,"id":"evdo_0","note":null,"stability":null,"value":"evdo_0"},{"brief":"EVDO Rev. A","deprecated":null,"id":"evdo_a","note":null,"stability":null,"value":"evdo_a"},{"brief":"CDMA2000 1XRTT","deprecated":null,"id":"cdma2000_1xrtt","note":null,"stability":null,"value":"cdma2000_1xrtt"},{"brief":"HSDPA","deprecated":null,"id":"hsdpa","note":null,"stability":null,"value":"hsdpa"},{"brief":"HSUPA","deprecated":null,"id":"hsupa","note":null,"stability":null,"value":"hsupa"},{"brief":"HSPA","deprecated":null,"id":"hspa","note":null,"stability":null,"value":"hspa"},{"brief":"IDEN","deprecated":null,"id":"iden","note":null,"stability":null,"value":"iden"},{"brief":"EVDO Rev. B","deprecated":null,"id":"evdo_b","note":null,"stability":null,"value":"evdo_b"},{"brief":"LTE","deprecated":null,"id":"lte","note":null,"stability":null,"value":"lte"},{"brief":"EHRPD","deprecated":null,"id":"ehrpd","note":null,"stability":null,"value":"ehrpd"},{"brief":"HSPAP","deprecated":null,"id":"hspap","note":null,"stability":null,"value":"hspap"},{"brief":"GSM","deprecated":null,"id":"gsm","note":null,"stability":null,"value":"gsm"},{"brief":"TD-SCDMA","deprecated":null,"id":"td_scdma","note":null,"stability":null,"value":"td_scdma"},{"brief":"IWLAN","deprecated":null,"id":"iwlan","note":null,"stability":null,"value":"iwlan"},{"brief":"5G NR (New Radio)","deprecated":null,"id":"nr","note":null,"stability":null,"value":"nr"},{"brief":"5G NRNSA (New Radio Non-Standalone)","deprecated":null,"id":"nrnsa","note":null,"stability":null,"value":"nrnsa"},{"brief":"LTE CA","deprecated":null,"id":"lte_ca","note":null,"stability":null,"value":"lte_ca"}]}},{"brief":"The internet connection type.","examples":"wifi","name":"network.connection.type","requirement_level":"recommended","root_namespace":"network","type":{"allow_custom_values":true,"members":[{"brief":null,"deprecated":null,"id":"wifi","note":null,"stability":null,"value":"wifi"},{"brief":null,"deprecated":null,"id":"wired","note":null,"stability":null,"value":"wired"},{"brief":null,"deprecated":null,"id":"cell","note":null,"stability":null,"value":"cell"},{"brief":null,"deprecated":null,"id":"unavailable","note":null,"stability":null,"value":"unavailable"},{"brief":null,"deprecated":null,"id":"unknown","note":null,"stability":null,"value":"unknown"}]}},{"brief":"The network IO operation direction.","examples":["transmit"],"name":"network.io.direction","requirement_level":"recommended","root_namespace":"network","type":{"allow_custom_values":false,"members":[{"brief":null,"deprecated":null,"id":"transmit","note":null,"stability":null,"value":"transmit"},{"brief":null,"deprecated":null,"id":"receive","note":null,"stability":null,"value":"receive"}]}},{"brief":"Local address of the network connection - IP address or Unix domain socket name.","examples":["10.1.2.80","/tmp/my.sock"],"name":"network.local.address","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"string"},{"brief":"Local port number of the network connection.","examples":[65123],"name":"network.local.port","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"int"},{"brief":"Peer address of the network connection - IP address or Unix domain socket name.","examples":["10.1.2.80","/tmp/my.sock"],"name":"network.peer.address","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"string"},{"brief":"Peer port number of the network connection.","examples":[65123],"name":"network.peer.port","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"int"},{"brief":"[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.","examples":["amqp","http","mqtt"],"name":"network.protocol.name","note":"The value SHOULD be normalized to lowercase.","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"string"},{"brief":"Version of the protocol specified in `network.protocol.name`.","examples":"3.1.1","name":"network.protocol.version","note":"`network.protocol.version` refers to the version of the protocol used and might be different from the protocol client\u0027s version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.\n","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":"string"},{"brief":"[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).\n","examples":["tcp","udp"],"name":"network.transport","note":"The value SHOULD be normalized to lowercase.\n\nConsider always setting the transport when setting a port number, since\na port number is ambiguous without knowing the transport. For example\ndifferent processes could be listening on TCP port 12345 and UDP port 12345.\n","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":{"allow_custom_values":true,"members":[{"brief":"TCP","deprecated":null,"id":"tcp","note":null,"stability":null,"value":"tcp"},{"brief":"UDP","deprecated":null,"id":"udp","note":null,"stability":null,"value":"udp"},{"brief":"Named or anonymous pipe.","deprecated":null,"id":"pipe","note":null,"stability":null,"value":"pipe"},{"brief":"Unix domain socket","deprecated":null,"id":"unix","note":null,"stability":null,"value":"unix"}]}},{"brief":"[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.","examples":["ipv4","ipv6"],"name":"network.type","note":"The value SHOULD be normalized to lowercase.","requirement_level":"recommended","root_namespace":"network","stability":"stable","type":{"allow_custom_values":true,"members":[{"brief":"IPv4","deprecated":null,"id":"ipv4","note":null,"stability":null,"value":"ipv4"},{"brief":"IPv6","deprecated":null,"id":"ipv6","note":null,"stability":null,"value":"ipv6"}]}}],"root_namespace":"network"},{"attributes":[{"brief":"The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component","examples":["SemConv"],"name":"url.fragment","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)","examples":["https://www.foo.bar/search?q=OpenTelemetry#SemConv","//localhost"],"name":"url.full","note":"For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.\n`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute\u0027s value SHOULD be `https://REDACTED:REDACTED@www.example.com/`.\n`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes.\n","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component","examples":["/search"],"name":"url.path","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component","examples":["q=OpenTelemetry"],"name":"url.query","note":"Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it.","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"},{"brief":"The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.","examples":["https","ftp","telnet"],"name":"url.scheme","requirement_level":"recommended","root_namespace":"url","stability":"stable","type":"string"}],"root_namespace":"url"},{"attributes":[{"brief":"Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.\n","examples":["CERN-LineMode/2.15 libwww/2.17b3","Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1"],"name":"user_agent.original","requirement_level":"recommended","root_namespace":"user_agent","stability":"stable","type":"string"}],"root_namespace":"user_agent"}] \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_grouped_attributes_without_experimental.json b/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_grouped_attributes_without_experimental.json new file mode 100644 index 00000000..83d7e2ed --- /dev/null +++ b/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_grouped_attributes_without_experimental.json @@ -0,0 +1 @@ +[{"attributes":[{"brief":"The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n","name":"db.cassandra.consistency_level","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":{"allow_custom_values":true,"members":[{"brief":null,"deprecated":null,"id":"all","note":null,"stability":null,"value":"all"},{"brief":null,"deprecated":null,"id":"each_quorum","note":null,"stability":null,"value":"each_quorum"},{"brief":null,"deprecated":null,"id":"quorum","note":null,"stability":null,"value":"quorum"},{"brief":null,"deprecated":null,"id":"local_quorum","note":null,"stability":null,"value":"local_quorum"},{"brief":null,"deprecated":null,"id":"one","note":null,"stability":null,"value":"one"},{"brief":null,"deprecated":null,"id":"two","note":null,"stability":null,"value":"two"},{"brief":null,"deprecated":null,"id":"three","note":null,"stability":null,"value":"three"},{"brief":null,"deprecated":null,"id":"local_one","note":null,"stability":null,"value":"local_one"},{"brief":null,"deprecated":null,"id":"any","note":null,"stability":null,"value":"any"},{"brief":null,"deprecated":null,"id":"serial","note":null,"stability":null,"value":"serial"},{"brief":null,"deprecated":null,"id":"local_serial","note":null,"stability":null,"value":"local_serial"}]}},{"brief":"The data center of the coordinating node for a query.\n","examples":"us-west-2","name":"db.cassandra.coordinator.dc","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"The ID of the coordinating node for a query.\n","examples":"be13faa2-8574-4d71-926d-27f16cf8a7af","name":"db.cassandra.coordinator.id","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"Whether or not the query is idempotent.\n","name":"db.cassandra.idempotence","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"boolean"},{"brief":"The fetch size used for paging, i.e. how many rows will be returned at once.\n","examples":[5000],"name":"db.cassandra.page_size","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"int"},{"brief":"The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.\n","examples":[0,2],"name":"db.cassandra.speculative_execution_count","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"int"},{"brief":"The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable).","examples":"mytable","name":"db.cassandra.table","note":"This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cassandra","type":"string"},{"brief":"The connection string used to connect to the database. It is recommended to remove embedded credentials.\n","examples":"Server=(localdb)\\v11.0;Integrated Security=true;","name":"db.connection_string","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"Unique Cosmos client instance id.","examples":"3ba4827d-4422-483f-b59f-85b74211c11d","name":"db.cosmosdb.client_id","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"string"},{"brief":"Cosmos client connection mode.","name":"db.cosmosdb.connection_mode","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":{"allow_custom_values":false,"members":[{"brief":"Gateway (HTTP) connections mode","deprecated":null,"id":"gateway","note":null,"stability":null,"value":"gateway"},{"brief":"Direct connection.","deprecated":null,"id":"direct","note":null,"stability":null,"value":"direct"}]}},{"brief":"Cosmos DB container name.","examples":"anystring","name":"db.cosmosdb.container","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"string"},{"brief":"CosmosDB Operation Type.","name":"db.cosmosdb.operation_type","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":{"allow_custom_values":true,"members":[{"brief":null,"deprecated":null,"id":"invalid","note":null,"stability":null,"value":"Invalid"},{"brief":null,"deprecated":null,"id":"create","note":null,"stability":null,"value":"Create"},{"brief":null,"deprecated":null,"id":"patch","note":null,"stability":null,"value":"Patch"},{"brief":null,"deprecated":null,"id":"read","note":null,"stability":null,"value":"Read"},{"brief":null,"deprecated":null,"id":"read_feed","note":null,"stability":null,"value":"ReadFeed"},{"brief":null,"deprecated":null,"id":"delete","note":null,"stability":null,"value":"Delete"},{"brief":null,"deprecated":null,"id":"replace","note":null,"stability":null,"value":"Replace"},{"brief":null,"deprecated":null,"id":"execute","note":null,"stability":null,"value":"Execute"},{"brief":null,"deprecated":null,"id":"query","note":null,"stability":null,"value":"Query"},{"brief":null,"deprecated":null,"id":"head","note":null,"stability":null,"value":"Head"},{"brief":null,"deprecated":null,"id":"head_feed","note":null,"stability":null,"value":"HeadFeed"},{"brief":null,"deprecated":null,"id":"upsert","note":null,"stability":null,"value":"Upsert"},{"brief":null,"deprecated":null,"id":"batch","note":null,"stability":null,"value":"Batch"},{"brief":null,"deprecated":null,"id":"query_plan","note":null,"stability":null,"value":"QueryPlan"},{"brief":null,"deprecated":null,"id":"execute_javascript","note":null,"stability":null,"value":"ExecuteJavaScript"}]}},{"brief":"RU consumed for that operation","examples":[46.18,1.0],"name":"db.cosmosdb.request_charge","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"double"},{"brief":"Request payload size in bytes","name":"db.cosmosdb.request_content_length","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Cosmos DB status code.","examples":[200,201],"name":"db.cosmosdb.status_code","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Cosmos DB sub status code.","examples":[1000,1002],"name":"db.cosmosdb.sub_status_code","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-cosmosdb","type":"int"},{"brief":"Represents the identifier of an Elasticsearch cluster.\n","examples":["e9106fc68e3044f0b1475b04bf4ffd5f"],"name":"db.elasticsearch.cluster.name","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"string"},{"brief":"Represents the human-readable identifier of the node/instance to which a request was routed.\n","examples":["instance-0000000001"],"name":"db.elasticsearch.node.name","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"string"},{"brief":"A dynamic value in the url path.\n","examples":["db.elasticsearch.path_parts.index=test-index","db.elasticsearch.path_parts.doc_id=123"],"name":"db.elasticsearch.path_parts","note":"Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.\u003ckey\u003e`, where `\u003ckey\u003e` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-elasticsearch","type":"template[string]"},{"brief":"An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`.\n","examples":"mysql-e26b99z.example.com","name":"db.instance.id","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.\n","examples":["org.postgresql.Driver","com.microsoft.sqlserver.jdbc.SQLServerDriver"],"name":"db.jdbc.driver_classname","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-jdbc","type":"string"},{"brief":"The MongoDB collection being accessed within the database stated in `db.name`.\n","examples":["customers","products"],"name":"db.mongodb.collection","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-mongodb","type":"string"},{"brief":"The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.\n","examples":"MSSQLSERVER","name":"db.mssql.instance_name","note":"If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard).\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-mssql","type":"string"},{"brief":"This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).\n","examples":["customers","main"],"name":"db.name","note":"In some SQL databases, the database name to be used is called \"schema name\". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name).\n","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.\n","examples":["findAndModify","HMSET","SELECT"],"name":"db.operation","note":"When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.\n","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.\n","examples":[0,1,15],"name":"db.redis.database_index","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-redis","type":"int"},{"brief":"The name of the primary table that the operation is acting upon, including the database name (if applicable).","examples":["public.users","customers"],"name":"db.sql.table","note":"It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n","requirement_level":"recommended","root_namespace":"db","tag":"tech-specific-sql","type":"string"},{"brief":"The database statement being executed.\n","examples":["SELECT * FROM wuser_table","SET mykey \"WuValue\""],"name":"db.statement","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"},{"brief":"An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.","name":"db.system","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":{"allow_custom_values":true,"members":[{"brief":"Some other SQL database. Fallback only. See notes.","deprecated":null,"id":"other_sql","note":null,"stability":null,"value":"other_sql"},{"brief":"Microsoft SQL Server","deprecated":null,"id":"mssql","note":null,"stability":null,"value":"mssql"},{"brief":"Microsoft SQL Server Compact","deprecated":null,"id":"mssqlcompact","note":null,"stability":null,"value":"mssqlcompact"},{"brief":"MySQL","deprecated":null,"id":"mysql","note":null,"stability":null,"value":"mysql"},{"brief":"Oracle Database","deprecated":null,"id":"oracle","note":null,"stability":null,"value":"oracle"},{"brief":"IBM Db2","deprecated":null,"id":"db2","note":null,"stability":null,"value":"db2"},{"brief":"PostgreSQL","deprecated":null,"id":"postgresql","note":null,"stability":null,"value":"postgresql"},{"brief":"Amazon Redshift","deprecated":null,"id":"redshift","note":null,"stability":null,"value":"redshift"},{"brief":"Apache Hive","deprecated":null,"id":"hive","note":null,"stability":null,"value":"hive"},{"brief":"Cloudscape","deprecated":null,"id":"cloudscape","note":null,"stability":null,"value":"cloudscape"},{"brief":"HyperSQL DataBase","deprecated":null,"id":"hsqldb","note":null,"stability":null,"value":"hsqldb"},{"brief":"Progress Database","deprecated":null,"id":"progress","note":null,"stability":null,"value":"progress"},{"brief":"SAP MaxDB","deprecated":null,"id":"maxdb","note":null,"stability":null,"value":"maxdb"},{"brief":"SAP HANA","deprecated":null,"id":"hanadb","note":null,"stability":null,"value":"hanadb"},{"brief":"Ingres","deprecated":null,"id":"ingres","note":null,"stability":null,"value":"ingres"},{"brief":"FirstSQL","deprecated":null,"id":"firstsql","note":null,"stability":null,"value":"firstsql"},{"brief":"EnterpriseDB","deprecated":null,"id":"edb","note":null,"stability":null,"value":"edb"},{"brief":"InterSystems Caché","deprecated":null,"id":"cache","note":null,"stability":null,"value":"cache"},{"brief":"Adabas (Adaptable Database System)","deprecated":null,"id":"adabas","note":null,"stability":null,"value":"adabas"},{"brief":"Firebird","deprecated":null,"id":"firebird","note":null,"stability":null,"value":"firebird"},{"brief":"Apache Derby","deprecated":null,"id":"derby","note":null,"stability":null,"value":"derby"},{"brief":"FileMaker","deprecated":null,"id":"filemaker","note":null,"stability":null,"value":"filemaker"},{"brief":"Informix","deprecated":null,"id":"informix","note":null,"stability":null,"value":"informix"},{"brief":"InstantDB","deprecated":null,"id":"instantdb","note":null,"stability":null,"value":"instantdb"},{"brief":"InterBase","deprecated":null,"id":"interbase","note":null,"stability":null,"value":"interbase"},{"brief":"MariaDB","deprecated":null,"id":"mariadb","note":null,"stability":null,"value":"mariadb"},{"brief":"Netezza","deprecated":null,"id":"netezza","note":null,"stability":null,"value":"netezza"},{"brief":"Pervasive PSQL","deprecated":null,"id":"pervasive","note":null,"stability":null,"value":"pervasive"},{"brief":"PointBase","deprecated":null,"id":"pointbase","note":null,"stability":null,"value":"pointbase"},{"brief":"SQLite","deprecated":null,"id":"sqlite","note":null,"stability":null,"value":"sqlite"},{"brief":"Sybase","deprecated":null,"id":"sybase","note":null,"stability":null,"value":"sybase"},{"brief":"Teradata","deprecated":null,"id":"teradata","note":null,"stability":null,"value":"teradata"},{"brief":"Vertica","deprecated":null,"id":"vertica","note":null,"stability":null,"value":"vertica"},{"brief":"H2","deprecated":null,"id":"h2","note":null,"stability":null,"value":"h2"},{"brief":"ColdFusion IMQ","deprecated":null,"id":"coldfusion","note":null,"stability":null,"value":"coldfusion"},{"brief":"Apache Cassandra","deprecated":null,"id":"cassandra","note":null,"stability":null,"value":"cassandra"},{"brief":"Apache HBase","deprecated":null,"id":"hbase","note":null,"stability":null,"value":"hbase"},{"brief":"MongoDB","deprecated":null,"id":"mongodb","note":null,"stability":null,"value":"mongodb"},{"brief":"Redis","deprecated":null,"id":"redis","note":null,"stability":null,"value":"redis"},{"brief":"Couchbase","deprecated":null,"id":"couchbase","note":null,"stability":null,"value":"couchbase"},{"brief":"CouchDB","deprecated":null,"id":"couchdb","note":null,"stability":null,"value":"couchdb"},{"brief":"Microsoft Azure Cosmos DB","deprecated":null,"id":"cosmosdb","note":null,"stability":null,"value":"cosmosdb"},{"brief":"Amazon DynamoDB","deprecated":null,"id":"dynamodb","note":null,"stability":null,"value":"dynamodb"},{"brief":"Neo4j","deprecated":null,"id":"neo4j","note":null,"stability":null,"value":"neo4j"},{"brief":"Apache Geode","deprecated":null,"id":"geode","note":null,"stability":null,"value":"geode"},{"brief":"Elasticsearch","deprecated":null,"id":"elasticsearch","note":null,"stability":null,"value":"elasticsearch"},{"brief":"Memcached","deprecated":null,"id":"memcached","note":null,"stability":null,"value":"memcached"},{"brief":"CockroachDB","deprecated":null,"id":"cockroachdb","note":null,"stability":null,"value":"cockroachdb"},{"brief":"OpenSearch","deprecated":null,"id":"opensearch","note":null,"stability":null,"value":"opensearch"},{"brief":"ClickHouse","deprecated":null,"id":"clickhouse","note":null,"stability":null,"value":"clickhouse"},{"brief":"Cloud Spanner","deprecated":null,"id":"spanner","note":null,"stability":null,"value":"spanner"},{"brief":"Trino","deprecated":null,"id":"trino","note":null,"stability":null,"value":"trino"}]}},{"brief":"Username for accessing the database.\n","examples":["readonly_user","reporting_user"],"name":"db.user","requirement_level":"recommended","root_namespace":"db","tag":"db-generic","type":"string"}],"root_namespace":"db"},{"attributes":[{"brief":"HTTP request headers, `\u003ckey\u003e` being the normalized HTTP Header name (lowercase), the value being the header values.\n","examples":["http.request.header.content-type=[\"application/json\"]","http.request.header.x-forwarded-for=[\"1.2.3.4\", \"1.2.3.5\"]"],"name":"http.request.header","note":"Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\nThe `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended.\nThe attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"template[string[]]"},{"brief":"HTTP request method.","examples":["GET","POST","HEAD"],"name":"http.request.method","note":"HTTP request method value SHOULD be \"known\" to the instrumentation.\nBy default, this convention defines \"known\" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)\nand the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).\n\nIf the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.\n\nIf the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override\nthe list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named\nOTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods\n(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults).\n\nHTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly.\nInstrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent.\nTracing instrumentations that do so, MUST also set `http.request.method_original` to the original value.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":{"allow_custom_values":true,"members":[{"brief":"CONNECT method.","deprecated":null,"id":"connect","note":null,"stability":null,"value":"CONNECT"},{"brief":"DELETE method.","deprecated":null,"id":"delete","note":null,"stability":null,"value":"DELETE"},{"brief":"GET method.","deprecated":null,"id":"get","note":null,"stability":null,"value":"GET"},{"brief":"HEAD method.","deprecated":null,"id":"head","note":null,"stability":null,"value":"HEAD"},{"brief":"OPTIONS method.","deprecated":null,"id":"options","note":null,"stability":null,"value":"OPTIONS"},{"brief":"PATCH method.","deprecated":null,"id":"patch","note":null,"stability":null,"value":"PATCH"},{"brief":"POST method.","deprecated":null,"id":"post","note":null,"stability":null,"value":"POST"},{"brief":"PUT method.","deprecated":null,"id":"put","note":null,"stability":null,"value":"PUT"},{"brief":"TRACE method.","deprecated":null,"id":"trace","note":null,"stability":null,"value":"TRACE"},{"brief":"Any HTTP method that the instrumentation has no prior knowledge of.","deprecated":null,"id":"other","note":null,"stability":null,"value":"_OTHER"}]}},{"brief":"Original HTTP method sent by the client in the request line.","examples":["GeT","ACL","foo"],"name":"http.request.method_original","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"string"},{"brief":"The ordinal number of request resending attempt (for any reason, including redirects).\n","examples":3,"name":"http.request.resend_count","note":"The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"int"},{"brief":"HTTP response headers, `\u003ckey\u003e` being the normalized HTTP Header name (lowercase), the value being the header values.\n","examples":["http.response.header.content-type=[\"application/json\"]","http.response.header.my-custom-header=[\"abc\", \"def\"]"],"name":"http.response.header","note":"Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\nUsers MAY explicitly configure instrumentations to capture them even though it is not recommended.\nThe attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.\n","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"template[string[]]"},{"brief":"[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).","examples":[200],"name":"http.response.status_code","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"int"},{"brief":"The matched route, that is, the path template in the format used by the respective server framework.\n","examples":["/users/:userID?","{controller}/{action}/{id?}"],"name":"http.route","note":"MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.\nSHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.","requirement_level":"recommended","root_namespace":"http","stability":"stable","type":"string"}],"root_namespace":"http"},{"attributes":[{"brief":"Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.\n","examples":["CERN-LineMode/2.15 libwww/2.17b3","Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1"],"name":"user_agent.original","requirement_level":"recommended","root_namespace":"user_agent","stability":"stable","type":"string"}],"root_namespace":"user_agent"}] \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_metrics.json b/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_metrics.json new file mode 100644 index 00000000..0ecb7806 --- /dev/null +++ b/crates/weaver_forge/expected_output/semconv_jq_fn/semconv_metrics.json @@ -0,0 +1 @@ +[{"metrics":[{"attributes":[{"brief":"The type of memory.","examples":["heap","non_heap"],"name":"jvm.memory.type","requirement_level":"recommended","stability":"stable","type":{"allow_custom_values":false,"members":[{"brief":"Heap memory.","deprecated":null,"id":"heap","note":null,"stability":null,"value":"heap"},{"brief":"Non-heap memory","deprecated":null,"id":"non_heap","note":null,"stability":null,"value":"non_heap"}]}},{"brief":"Name of the memory pool.","examples":["G1 Old Gen","G1 Eden space","G1 Survivor Space"],"name":"jvm.memory.pool.name","note":"Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n","requirement_level":"recommended","stability":"stable","type":"string"}],"brief":"Measure of memory used.","events":[],"id":"metric.jvm.memory.used","instrument":"updowncounter","lineage":{"attributes":{"jvm.memory.pool.name":{"inherited_fields":["brief","examples","note","requirement_level","stability"],"source_group":"attributes.jvm.memory"},"jvm.memory.type":{"inherited_fields":["brief","examples","note","requirement_level","stability"],"source_group":"attributes.jvm.memory"}},"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.memory.used","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"By"},{"attributes":[{"brief":"The type of memory.","examples":["heap","non_heap"],"name":"jvm.memory.type","requirement_level":"recommended","stability":"stable","type":{"allow_custom_values":false,"members":[{"brief":"Heap memory.","deprecated":null,"id":"heap","note":null,"stability":null,"value":"heap"},{"brief":"Non-heap memory","deprecated":null,"id":"non_heap","note":null,"stability":null,"value":"non_heap"}]}},{"brief":"Name of the memory pool.","examples":["G1 Old Gen","G1 Eden space","G1 Survivor Space"],"name":"jvm.memory.pool.name","note":"Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n","requirement_level":"recommended","stability":"stable","type":"string"}],"brief":"Measure of memory committed.","events":[],"id":"metric.jvm.memory.committed","instrument":"updowncounter","lineage":{"attributes":{"jvm.memory.pool.name":{"inherited_fields":["brief","examples","note","requirement_level","stability"],"source_group":"attributes.jvm.memory"},"jvm.memory.type":{"inherited_fields":["brief","examples","note","requirement_level","stability"],"source_group":"attributes.jvm.memory"}},"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.memory.committed","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"By"},{"attributes":[{"brief":"The type of memory.","examples":["heap","non_heap"],"name":"jvm.memory.type","requirement_level":"recommended","stability":"stable","type":{"allow_custom_values":false,"members":[{"brief":"Heap memory.","deprecated":null,"id":"heap","note":null,"stability":null,"value":"heap"},{"brief":"Non-heap memory","deprecated":null,"id":"non_heap","note":null,"stability":null,"value":"non_heap"}]}},{"brief":"Name of the memory pool.","examples":["G1 Old Gen","G1 Eden space","G1 Survivor Space"],"name":"jvm.memory.pool.name","note":"Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n","requirement_level":"recommended","stability":"stable","type":"string"}],"brief":"Measure of max obtainable memory.","events":[],"id":"metric.jvm.memory.limit","instrument":"updowncounter","lineage":{"attributes":{"jvm.memory.pool.name":{"inherited_fields":["brief","examples","note","requirement_level","stability"],"source_group":"attributes.jvm.memory"},"jvm.memory.type":{"inherited_fields":["brief","examples","note","requirement_level","stability"],"source_group":"attributes.jvm.memory"}},"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.memory.limit","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"By"},{"attributes":[{"brief":"The type of memory.","examples":["heap","non_heap"],"name":"jvm.memory.type","requirement_level":"recommended","stability":"stable","type":{"allow_custom_values":false,"members":[{"brief":"Heap memory.","deprecated":null,"id":"heap","note":null,"stability":null,"value":"heap"},{"brief":"Non-heap memory","deprecated":null,"id":"non_heap","note":null,"stability":null,"value":"non_heap"}]}},{"brief":"Name of the memory pool.","examples":["G1 Old Gen","G1 Eden space","G1 Survivor Space"],"name":"jvm.memory.pool.name","note":"Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n","requirement_level":"recommended","stability":"stable","type":"string"}],"brief":"Measure of memory used, as measured after the most recent garbage collection event on this pool.","events":[],"id":"metric.jvm.memory.used_after_last_gc","instrument":"updowncounter","lineage":{"attributes":{"jvm.memory.pool.name":{"inherited_fields":["brief","examples","note","requirement_level","stability"],"source_group":"attributes.jvm.memory"},"jvm.memory.type":{"inherited_fields":["brief","examples","note","requirement_level","stability"],"source_group":"attributes.jvm.memory"}},"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.memory.used_after_last_gc","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"By"},{"attributes":[{"brief":"Name of the garbage collector.","examples":["G1 Young Generation","G1 Old Generation"],"name":"jvm.gc.name","note":"Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).\n","requirement_level":"recommended","stability":"stable","type":"string"},{"brief":"Name of the garbage collector action.","examples":["end of minor GC","end of major GC"],"name":"jvm.gc.action","note":"Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).\n","requirement_level":"recommended","stability":"stable","type":"string"}],"brief":"Duration of JVM garbage collection actions.","events":[],"id":"metric.jvm.gc.duration","instrument":"histogram","lineage":{"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.gc.duration","name":null,"prefix":"jvm.gc","root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"s"},{"attributes":[{"brief":"Whether the thread is daemon or not.","name":"jvm.thread.daemon","requirement_level":"recommended","stability":"stable","type":"boolean"},{"brief":"State of the thread.","examples":["runnable","blocked"],"name":"jvm.thread.state","requirement_level":"recommended","stability":"stable","type":{"allow_custom_values":false,"members":[{"brief":"A thread that has not yet started is in this state.","deprecated":null,"id":"new","note":null,"stability":null,"value":"new"},{"brief":"A thread executing in the Java virtual machine is in this state.","deprecated":null,"id":"runnable","note":null,"stability":null,"value":"runnable"},{"brief":"A thread that is blocked waiting for a monitor lock is in this state.","deprecated":null,"id":"blocked","note":null,"stability":null,"value":"blocked"},{"brief":"A thread that is waiting indefinitely for another thread to perform a particular action is in this state.","deprecated":null,"id":"waiting","note":null,"stability":null,"value":"waiting"},{"brief":"A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.","deprecated":null,"id":"timed_waiting","note":null,"stability":null,"value":"timed_waiting"},{"brief":"A thread that has exited is in this state.","deprecated":null,"id":"terminated","note":null,"stability":null,"value":"terminated"}]}}],"brief":"Number of executing platform threads.","events":[],"id":"metric.jvm.thread.count","instrument":"updowncounter","lineage":{"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.thread.count","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"{thread}"},{"attributes":[],"brief":"Number of classes loaded since JVM start.","events":[],"id":"metric.jvm.class.loaded","instrument":"counter","lineage":{"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.class.loaded","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"{class}"},{"attributes":[],"brief":"Number of classes unloaded since JVM start.","events":[],"id":"metric.jvm.class.unloaded","instrument":"counter","lineage":{"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.class.unloaded","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"{class}"},{"attributes":[],"brief":"Number of classes currently loaded.","events":[],"id":"metric.jvm.class.count","instrument":"updowncounter","lineage":{"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.class.count","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"{class}"},{"attributes":[],"brief":"Number of processors available to the Java virtual machine.","events":[],"id":"metric.jvm.cpu.count","instrument":"updowncounter","lineage":{"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.cpu.count","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"{cpu}"},{"attributes":[],"brief":"CPU time used by the process as reported by the JVM.","events":[],"id":"metric.jvm.cpu.time","instrument":"counter","lineage":{"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.cpu.time","name":null,"root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"s"},{"attributes":[],"brief":"Recent CPU utilization for the process as reported by the JVM.","events":[],"id":"metric.jvm.cpu.recent_utilization","instrument":"gauge","lineage":{"source_file":"data/jvm-metrics.yaml"},"metric_name":"jvm.cpu.recent_utilization","name":null,"note":"The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()).\n","root_namespace":"jvm","span_kind":null,"stability":"stable","type":"metric","unit":"1"}],"root_namespace":"jvm"}] \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/attribute_group/attributes_jvm_memory.md b/crates/weaver_forge/expected_output/test/attribute_group/attributes_jvm_memory.md deleted file mode 100644 index 5f3764f9..00000000 --- a/crates/weaver_forge/expected_output/test/attribute_group/attributes_jvm_memory.md +++ /dev/null @@ -1,46 +0,0 @@ -## Group `attributes_jvm_memory` (attribute_group) - -### Brief - -Describes JVM memory metric attributes. - -prefix: jvm.memory - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/attribute_group/registry_db.md b/crates/weaver_forge/expected_output/test/attribute_group/db.md similarity index 98% rename from crates/weaver_forge/expected_output/test/attribute_group/registry_db.md rename to crates/weaver_forge/expected_output/test/attribute_group/db.md index f1d35ed0..648e6126 100644 --- a/crates/weaver_forge/expected_output/test/attribute_group/registry_db.md +++ b/crates/weaver_forge/expected_output/test/attribute_group/db.md @@ -1,30 +1,23 @@ -## Group `registry_db` (attribute_group) - -### Brief - -This document defines the attributes used to describe telemetry in the context of databases. - -prefix: db +## Namespace `db` ### Attributes -#### Attribute `db.cassandra.coordinator.dc` +#### Attribute `db.cassandra.consistency_level` -The data center of the coordinating node for a query. +The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - Requirement Level: Recommended - Tag: tech-specific-cassandra -- Type: string -- Examples: us-west-2 +- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] -#### Attribute `db.cassandra.coordinator.id` +#### Attribute `db.cassandra.coordinator.dc` -The ID of the coordinating node for a query. +The data center of the coordinating node for a query. - Requirement Level: Recommended @@ -32,19 +25,20 @@ The ID of the coordinating node for a query. - Tag: tech-specific-cassandra - Type: string -- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af +- Examples: us-west-2 -#### Attribute `db.cassandra.consistency_level` +#### Attribute `db.cassandra.coordinator.id` -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). +The ID of the coordinating node for a query. - Requirement Level: Recommended - Tag: tech-specific-cassandra -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] +- Type: string +- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af #### Attribute `db.cassandra.idempotence` @@ -276,6 +270,19 @@ Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in s ] +#### Attribute `db.instance.id` + +An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. + + +- Requirement Level: Recommended + +- Tag: db-generic + +- Type: string +- Examples: mysql-e26b99z.example.com + + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -438,17 +445,4 @@ Username for accessing the database. "reporting_user", ] - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: mysql-e26b99z.example.com - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/attribute_group/registry_http.md b/crates/weaver_forge/expected_output/test/attribute_group/http.md similarity index 97% rename from crates/weaver_forge/expected_output/test/attribute_group/registry_http.md rename to crates/weaver_forge/expected_output/test/attribute_group/http.md index 19880802..8576b2df 100644 --- a/crates/weaver_forge/expected_output/test/attribute_group/registry_http.md +++ b/crates/weaver_forge/expected_output/test/attribute_group/http.md @@ -1,10 +1,4 @@ -## Group `registry_http` (attribute_group) - -### Brief - -This document defines semantic convention attributes in the HTTP namespace. - -prefix: http +## Namespace `http` ### Attributes diff --git a/crates/weaver_forge/expected_output/test/attribute_group/registry_network.md b/crates/weaver_forge/expected_output/test/attribute_group/network.md similarity index 96% rename from crates/weaver_forge/expected_output/test/attribute_group/registry_network.md rename to crates/weaver_forge/expected_output/test/attribute_group/network.md index 70efc78d..69da9e7f 100644 --- a/crates/weaver_forge/expected_output/test/attribute_group/registry_network.md +++ b/crates/weaver_forge/expected_output/test/attribute_group/network.md @@ -1,10 +1,4 @@ -## Group `registry_network` (attribute_group) - -### Brief - -These attributes may be used for any network related operation. - -prefix: network +## Namespace `network` ### Attributes @@ -75,6 +69,19 @@ The internet connection type. - Examples: wifi +#### Attribute `network.io.direction` + +The network IO operation direction. + + +- Requirement Level: Recommended + +- Type: Enum [transmit, receive] +- Examples: [ + "transmit", +] + + #### Attribute `network.local.address` Local address of the network connection - IP address or Unix domain socket name. @@ -210,17 +217,4 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - -#### Attribute `network.io.direction` - -The network IO operation direction. - - -- Requirement Level: Recommended - -- Type: Enum [transmit, receive] -- Examples: [ - "transmit", -] - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/attribute_group/server.md b/crates/weaver_forge/expected_output/test/attribute_group/server.md deleted file mode 100644 index 06a10dbe..00000000 --- a/crates/weaver_forge/expected_output/test/attribute_group/server.md +++ /dev/null @@ -1,49 +0,0 @@ -## Group `server` (attribute_group) - -### Brief - -These attributes may be used to describe the server in a connection-based network interaction where there is one side that initiates the connection (the client is the side that initiates the connection). This covers all TCP network interactions since TCP is connection-based and one side initiates the connection (an exception is made for peer-to-peer communication over TCP where the "user-facing" surface of the protocol / API doesn't expose a clear notion of client and server). This also covers UDP network interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS. - -prefix: server - -### Attributes - - -#### Attribute `server.address` - -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/attribute_group/registry_url.md b/crates/weaver_forge/expected_output/test/attribute_group/url.md similarity index 95% rename from crates/weaver_forge/expected_output/test/attribute_group/registry_url.md rename to crates/weaver_forge/expected_output/test/attribute_group/url.md index f7dfd4a8..093052c8 100644 --- a/crates/weaver_forge/expected_output/test/attribute_group/registry_url.md +++ b/crates/weaver_forge/expected_output/test/attribute_group/url.md @@ -1,26 +1,18 @@ -## Group `registry_url` (attribute_group) - -### Brief - -Attributes describing URL. - -prefix: url +## Namespace `url` ### Attributes -#### Attribute `url.scheme` +#### Attribute `url.fragment` -The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component - Requirement Level: Recommended - Type: string - Examples: [ - "https", - "ftp", - "telnet", + "SemConv", ] - Stability: Stable @@ -78,16 +70,18 @@ Sensitive content provided in query string SHOULD be scrubbed when instrumentati - Stability: Stable -#### Attribute `url.fragment` +#### Attribute `url.scheme` -The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component +The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. - Requirement Level: Recommended - Type: string - Examples: [ - "SemConv", + "https", + "ftp", + "telnet", ] - Stability: Stable diff --git a/crates/weaver_forge/expected_output/test/attribute_group/registry_user_agent.md b/crates/weaver_forge/expected_output/test/attribute_group/user_agent.md similarity index 80% rename from crates/weaver_forge/expected_output/test/attribute_group/registry_user_agent.md rename to crates/weaver_forge/expected_output/test/attribute_group/user_agent.md index 0b45e086..821f801d 100644 --- a/crates/weaver_forge/expected_output/test/attribute_group/registry_user_agent.md +++ b/crates/weaver_forge/expected_output/test/attribute_group/user_agent.md @@ -1,10 +1,4 @@ -## Group `registry_user_agent` (attribute_group) - -### Brief - -Describes user-agent attributes. - -prefix: user_agent +## Namespace `user_agent` ### Attributes diff --git a/crates/weaver_forge/expected_output/test/attribute_groups.md b/crates/weaver_forge/expected_output/test/attribute_groups.md index 38d2cf9c..e831b7ca 100644 --- a/crates/weaver_forge/expected_output/test/attribute_groups.md +++ b/crates/weaver_forge/expected_output/test/attribute_groups.md @@ -4,64 +4,24 @@ - one - two - three -## Group `attributes.jvm.memory` (attribute_group) - -### Brief - -Describes JVM memory metric attributes. - -prefix: jvm.memory +## Namespace `db` ### Attributes -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` +#### Attribute `db.cassandra.consistency_level` -Name of the memory pool. +The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - Requirement Level: Recommended -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable +- Tag: tech-specific-cassandra +- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] -## Group `registry.db` (attribute_group) - -### Brief - -This document defines the attributes used to describe telemetry in the context of databases. - -prefix: db - -### Attributes - - #### Attribute `db.cassandra.coordinator.dc` The data center of the coordinating node for a query. @@ -90,19 +50,6 @@ The ID of the coordinating node for a query. - Examples: be13faa2-8574-4d71-926d-27f16cf8a7af -#### Attribute `db.cassandra.consistency_level` - -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - - #### Attribute `db.cassandra.idempotence` Whether or not the query is idempotent. @@ -339,6 +286,20 @@ Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in s ] +#### Attribute `db.instance.id` + +An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. + + + +- Requirement Level: Recommended + +- Tag: db-generic + +- Type: string +- Examples: mysql-e26b99z.example.com + + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -510,28 +471,8 @@ Username for accessing the database. ] -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: mysql-e26b99z.example.com - - -## Group `registry.http` (attribute_group) - -### Brief - -This document defines semantic convention attributes in the HTTP namespace. - -prefix: http +## Namespace `http` ### Attributes @@ -707,13 +648,7 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin -## Group `registry.network` (attribute_group) - -### Brief - -These attributes may be used for any network related operation. - -prefix: network +## Namespace `network` ### Attributes @@ -784,6 +719,19 @@ The internet connection type. - Examples: wifi +#### Attribute `network.io.direction` + +The network IO operation direction. + + +- Requirement Level: Recommended + +- Type: Enum [transmit, receive] +- Examples: [ + "transmit", +] + + #### Attribute `network.local.address` Local address of the network connection - IP address or Unix domain socket name. @@ -921,93 +869,22 @@ The value SHOULD be normalized to lowercase. - Stability: Stable -#### Attribute `network.io.direction` - -The network IO operation direction. - - -- Requirement Level: Recommended - -- Type: Enum [transmit, receive] -- Examples: [ - "transmit", -] - - - -## Group `server` (attribute_group) - -### Brief - -These attributes may be used to describe the server in a connection-based network interaction where there is one side that initiates the connection (the client is the side that initiates the connection). This covers all TCP network interactions since TCP is connection-based and one side initiates the connection (an exception is made for peer-to-peer communication over TCP where the "user-facing" surface of the protocol / API doesn't expose a clear notion of client and server). This also covers UDP network interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS. - -prefix: server - -### Attributes - - -#### Attribute `server.address` - -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -## Group `registry.url` (attribute_group) - -### Brief - -Attributes describing URL. - -prefix: url +## Namespace `url` ### Attributes -#### Attribute `url.scheme` +#### Attribute `url.fragment` -The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component - Requirement Level: Recommended - Type: string - Examples: [ - "https", - "ftp", - "telnet", + "SemConv", ] - Stability: Stable @@ -1065,29 +942,25 @@ Sensitive content provided in query string SHOULD be scrubbed when instrumentati - Stability: Stable -#### Attribute `url.fragment` +#### Attribute `url.scheme` -The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component +The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. - Requirement Level: Recommended - Type: string - Examples: [ - "SemConv", + "https", + "ftp", + "telnet", ] - Stability: Stable -## Group `registry.user_agent` (attribute_group) - -### Brief - -Describes user-agent attributes. - -prefix: user_agent +## Namespace `user_agent` ### Attributes diff --git a/crates/weaver_forge/expected_output/test/event/android_lifecycle_events.md b/crates/weaver_forge/expected_output/test/event/android_lifecycle_events.md deleted file mode 100644 index de690580..00000000 --- a/crates/weaver_forge/expected_output/test/event/android_lifecycle_events.md +++ /dev/null @@ -1,27 +0,0 @@ -# Group `android.lifecycle.events` (event) - -## Brief - -This event represents an occurrence of a lifecycle transition on the Android platform. - -Prefix: android -Name: device.app.lifecycle - -## Attributes - - -### Attribute `android.state` - -This attribute represents the state the application has transitioned into at the occurrence of the event. - - - -The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. - -- Requirement Level: Required - -- Type: Enum [created, background, foreground] - -- Stability: Experimental - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/event/ios_lifecycle_events.md b/crates/weaver_forge/expected_output/test/event/ios_lifecycle_events.md deleted file mode 100644 index 83ecf5db..00000000 --- a/crates/weaver_forge/expected_output/test/event/ios_lifecycle_events.md +++ /dev/null @@ -1,27 +0,0 @@ -# Group `ios.lifecycle.events` (event) - -## Brief - -This event represents an occurrence of a lifecycle transition on the iOS platform. - -Prefix: ios -Name: device.app.lifecycle - -## Attributes - - -### Attribute `ios.state` - -This attribute represents the state the application has transitioned into at the occurrence of the event. - - - -The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. - -- Requirement Level: Required - -- Type: Enum [active, inactive, background, foreground, terminate] - -- Stability: Experimental - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/event/lifecycle.md b/crates/weaver_forge/expected_output/test/event/lifecycle.md new file mode 100644 index 00000000..456ecbc5 --- /dev/null +++ b/crates/weaver_forge/expected_output/test/event/lifecycle.md @@ -0,0 +1,57 @@ +## Events Namespace `lifecycle` + + +## Event `device.app.lifecycle` + +Note: +Brief: This event represents an occurrence of a lifecycle transition on the iOS platform. + +Requirement level: +Stability: + +### Attributes + + +#### Attribute `ios.state` + +This attribute represents the state the application has transitioned into at the occurrence of the event. + + + +The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. + +- Requirement Level: Required + +- Type: Enum [active, inactive, background, foreground, terminate] + +- Stability: Experimental + + + +## Event `device.app.lifecycle` + +Note: +Brief: This event represents an occurrence of a lifecycle transition on the Android platform. + +Requirement level: +Stability: + +### Attributes + + +#### Attribute `android.state` + +This attribute represents the state the application has transitioned into at the occurrence of the event. + + + +The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. + +- Requirement Level: Required + +- Type: Enum [created, background, foreground] + +- Stability: Experimental + + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/events.md b/crates/weaver_forge/expected_output/test/events.md index 8066e504..3f6033f1 100644 --- a/crates/weaver_forge/expected_output/test/events.md +++ b/crates/weaver_forge/expected_output/test/events.md @@ -1,14 +1,14 @@ -# Semantic Convention Event Groups +# Events Namespace `lifecycle` -## Group `ios.lifecycle.events` (event) -### Brief +## Event `device.app.lifecycle` -This event represents an occurrence of a lifecycle transition on the iOS platform. +Note: +Brief: This event represents an occurrence of a lifecycle transition on the iOS platform. -Prefix: ios -Name: device.app.lifecycle +Requirement level: +Stability: ### Attributes @@ -29,14 +29,13 @@ The iOS lifecycle states are defined in the [UIApplicationDelegate documentation -## Group `android.lifecycle.events` (event) +## Event `device.app.lifecycle` -### Brief +Note: +Brief: This event represents an occurrence of a lifecycle transition on the Android platform. -This event represents an occurrence of a lifecycle transition on the Android platform. - -Prefix: android -Name: device.app.lifecycle +Requirement level: +Stability: ### Attributes @@ -56,4 +55,6 @@ The Android lifecycle states are defined in [Activity lifecycle callbacks](https - Stability: Experimental + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/group/android_lifecycle_events.md b/crates/weaver_forge/expected_output/test/group/android_lifecycle_events.md deleted file mode 100644 index 1eba53e2..00000000 --- a/crates/weaver_forge/expected_output/test/group/android_lifecycle_events.md +++ /dev/null @@ -1,31 +0,0 @@ -# Group `android.lifecycle.events` (event) - -## Brief - -This event represents an occurrence of a lifecycle transition on the Android platform. - -prefix: android - -## Attributes - - -### Attribute `android.state` - -This attribute represents the state the application has transitioned into at the occurrence of the event. - - - -The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. - -- Requirement Level: Required - -- Type: Enum [created, background, foreground] - -- Stability: Experimental - - - -## Lineage - -Source file: data/mobile-events.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/attributes_jvm_memory.md b/crates/weaver_forge/expected_output/test/group/attributes_jvm_memory.md deleted file mode 100644 index ed1a167d..00000000 --- a/crates/weaver_forge/expected_output/test/group/attributes_jvm_memory.md +++ /dev/null @@ -1,51 +0,0 @@ -# Group `attributes.jvm.memory` (attribute_group) - -## Brief - -Describes JVM memory metric attributes. - -prefix: jvm.memory - -## Attributes - - -### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/db.md b/crates/weaver_forge/expected_output/test/group/db.md deleted file mode 100644 index 1e993973..00000000 --- a/crates/weaver_forge/expected_output/test/group/db.md +++ /dev/null @@ -1,339 +0,0 @@ -# Group `db` (span) - -## Brief - -This document defines the attributes used to perform database client calls. - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_cassandra.md b/crates/weaver_forge/expected_output/test/group/db_cassandra.md deleted file mode 100644 index 1ad1b84b..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_cassandra.md +++ /dev/null @@ -1,475 +0,0 @@ -# Group `db.cassandra` (span) - -## Brief - -Call-level attributes for Cassandra - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.cassandra.consistency_level` - -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - - -### Attribute `db.cassandra.coordinator.dc` - -The data center of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: us-west-2 - - -### Attribute `db.cassandra.coordinator.id` - -The ID of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - - -### Attribute `db.cassandra.idempotence` - -Whether or not the query is idempotent. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: boolean - - -### Attribute `db.cassandra.page_size` - -The fetch size used for paging, i.e. how many rows will be returned at once. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 5000, -] - - -### Attribute `db.cassandra.speculative_execution_count` - -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 0, - 2, -] - - -### Attribute `db.cassandra.table` - -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). - - -This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: mytable - - -### Attribute `db.name` - -The keyspace name in Cassandra. - - - -For Cassandra the `db.name` should be set to the Cassandra keyspace name. - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: [ - "mykeyspace", -] - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_cosmosdb.md b/crates/weaver_forge/expected_output/test/group/db_cosmosdb.md deleted file mode 100644 index b406fa3d..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_cosmosdb.md +++ /dev/null @@ -1,515 +0,0 @@ -# Group `db.cosmosdb` (span) - -## Brief - -Call-level attributes for Cosmos DB. - -prefix: db.cosmosdb - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.cosmosdb.client_id` - -Unique Cosmos client instance id. - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - - -### Attribute `db.cosmosdb.connection_mode` - -Cosmos client connection mode. - - -- Requirement Level: Conditionally Required - if not `direct` (or pick gw as default) - -- Tag: call-level-tech-specific - -- Type: Enum [gateway, direct] - - -### Attribute `db.cosmosdb.container` - -Cosmos DB container name. - - -- Requirement Level: Conditionally Required - if available - -- Tag: call-level-tech-specific - -- Type: string -- Examples: anystring - - -### Attribute `db.cosmosdb.operation_type` - -CosmosDB Operation Type. - - -- Requirement Level: Conditionally Required - when performing one of the operations in this list - -- Tag: call-level-tech-specific - -- Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - - -### Attribute `db.cosmosdb.request_charge` - -RU consumed for that operation - - -- Requirement Level: Conditionally Required - when available - -- Tag: call-level-tech-specific - -- Type: double -- Examples: [ - 46.18, - 1.0, -] - - -### Attribute `db.cosmosdb.request_content_length` - -Request payload size in bytes - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: int - - -### Attribute `db.cosmosdb.status_code` - -Cosmos DB status code. - - -- Requirement Level: Conditionally Required - if response was received - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 200, - 201, -] - - -### Attribute `db.cosmosdb.sub_status_code` - -Cosmos DB sub status code. - - -- Requirement Level: Conditionally Required - when response was received and contained sub-code. - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 1000, - 1002, -] - - -### Attribute `user_agent.original` - -Full user-agent string is generated by Cosmos DB SDK - - -The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. - Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). - Default value is "NS". - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "cosmos-netstandard-sdk/3.23.0\\|3.23.1\\|1\\|X64\\|Linux 5.4.0-1098-azure 104 18\\|.NET Core 3.1.32\\|S\\|", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_couchdb.md b/crates/weaver_forge/expected_output/test/group/db_couchdb.md deleted file mode 100644 index e1517369..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_couchdb.md +++ /dev/null @@ -1,337 +0,0 @@ -# Group `db.couchdb` (span) - -## Brief - -Call-level attributes for CouchDB - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.operation` - -The HTTP method + the target REST route. - - - -In **CouchDB**, `db.operation` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](http://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid). - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "GET /{db}/{docid}", -] - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_elasticsearch.md b/crates/weaver_forge/expected_output/test/group/db_elasticsearch.md deleted file mode 100644 index 72b17cc6..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_elasticsearch.md +++ /dev/null @@ -1,467 +0,0 @@ -# Group `db.elasticsearch` (span) - -## Brief - -Call-level attributes for Elasticsearch - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.elasticsearch.cluster.name` - -Represents the identifier of an Elasticsearch cluster. - - - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "e9106fc68e3044f0b1475b04bf4ffd5f", -] - - -### Attribute `db.elasticsearch.node.name` - -Represents the human-readable identifier of the node/instance to which a request was routed. - - - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "instance-0000000001", -] - - -### Attribute `db.elasticsearch.path_parts` - -A dynamic value in the url path. - - - -Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. - -- Requirement Level: Conditionally Required - when the url has dynamic values - -- Tag: call-level-tech-specific - -- Type: template[string] -- Examples: [ - "db.elasticsearch.path_parts.index=test-index", - "db.elasticsearch.path_parts.doc_id=123", -] - - -### Attribute `db.operation` - -The endpoint identifier for the request. - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "search", - "ml.close_job", - "cat.aliases", -] - - -### Attribute `db.statement` - -The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. - - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "\"{\\\"query\\\":{\\\"term\\\":{\\\"user.id\\\":\\\"kimchy\\\"}}}\"", -] - - -### Attribute `http.request.method` - -HTTP request method. - - -HTTP request method value SHOULD be "known" to the instrumentation. -By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) -and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - -If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. - -If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override -the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named -OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods -(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). - -HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. -Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. -Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: Enum [CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, _OTHER] -- Examples: [ - "GET", - "POST", - "HEAD", -] - -- Stability: Stable - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `url.full` - -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) - - -For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. -`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. -`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "https://localhost:9200/index/_search?q=user.id:kimchy", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_hbase.md b/crates/weaver_forge/expected_output/test/group/db_hbase.md deleted file mode 100644 index 6564de85..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_hbase.md +++ /dev/null @@ -1,338 +0,0 @@ -# Group `db.hbase` (span) - -## Brief - -Call-level attributes for HBase - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.name` - -The HBase namespace. - - - -For HBase the `db.name` should be set to the HBase namespace. - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "mynamespace", -] - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_mongodb.md b/crates/weaver_forge/expected_output/test/group/db_mongodb.md deleted file mode 100644 index 87f54b14..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_mongodb.md +++ /dev/null @@ -1,361 +0,0 @@ -# Group `db.mongodb` (span) - -## Brief - -Call-level attributes for MongoDB - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.mongodb.collection` - -The MongoDB collection being accessed within the database stated in `db.name`. - - - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "customers", - "products", -] - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_mssql.md b/crates/weaver_forge/expected_output/test/group/db_mssql.md deleted file mode 100644 index 96245ce9..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_mssql.md +++ /dev/null @@ -1,360 +0,0 @@ -# Group `db.mssql` (span) - -## Brief - -Connection-level attributes for Microsoft SQL Server - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.mssql.instance_name` - -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - - - -If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: MSSQLSERVER - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_redis.md b/crates/weaver_forge/expected_output/test/group/db_redis.md deleted file mode 100644 index ea48f3e5..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_redis.md +++ /dev/null @@ -1,363 +0,0 @@ -# Group `db.redis` (span) - -## Brief - -Call-level attributes for Redis - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.redis.database_index` - -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - - - -- Requirement Level: Conditionally Required - If other than the default database (`0`). - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 0, - 1, - 15, -] - - -### Attribute `db.statement` - -The full syntax of the Redis CLI command. - - - -For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`. - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "HMSET myhash field1 'Hello' field2 'World'", -] - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_sql.md b/crates/weaver_forge/expected_output/test/group/db_sql.md deleted file mode 100644 index 931a4268..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_sql.md +++ /dev/null @@ -1,362 +0,0 @@ -# Group `db.sql` (span) - -## Brief - -Call-level attributes for SQL databases - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.sql.table` - -The name of the primary table that the operation is acting upon, including the database name (if applicable). - - -It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "public.users", - "customers", -] - - - -## Lineage - -Source file: data/trace-database.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/db_tech.md b/crates/weaver_forge/expected_output/test/group/db_tech.md deleted file mode 100644 index a6550929..00000000 --- a/crates/weaver_forge/expected_output/test/group/db_tech.md +++ /dev/null @@ -1,591 +0,0 @@ -# Group `db.tech` (span) - -## Brief - -Semantic convention group for specific technologies - -prefix: - -## Attributes - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -### Attribute `db.cassandra.consistency_level` - -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - - -### Attribute `db.cassandra.coordinator.dc` - -The data center of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: us-west-2 - - -### Attribute `db.cassandra.coordinator.id` - -The ID of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - - -### Attribute `db.cassandra.idempotence` - -Whether or not the query is idempotent. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: boolean - - -### Attribute `db.cassandra.page_size` - -The fetch size used for paging, i.e. how many rows will be returned at once. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 5000, -] - - -### Attribute `db.cassandra.speculative_execution_count` - -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 0, - 2, -] - - -### Attribute `db.cassandra.table` - -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). - - -This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: mytable - - -### Attribute `db.name` - -The keyspace name in Cassandra. - - - -For Cassandra the `db.name` should be set to the Cassandra keyspace name. - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: [ - "mykeyspace", -] - - -### Attribute `db.redis.database_index` - -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - - - -- Requirement Level: Conditionally Required - If other than the default database (`0`). - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 0, - 1, - 15, -] - - -### Attribute `db.statement` - -The full syntax of the Redis CLI command. - - - -For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`. - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "HMSET myhash field1 'Hello' field2 'World'", -] - - -### Attribute `db.mongodb.collection` - -The MongoDB collection being accessed within the database stated in `db.name`. - - - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "customers", - "products", -] - - -### Attribute `db.sql.table` - -The name of the primary table that the operation is acting upon, including the database name (if applicable). - - -It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "public.users", - "customers", -] - - -### Attribute `db.cosmosdb.client_id` - -Unique Cosmos client instance id. - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - - -### Attribute `db.cosmosdb.connection_mode` - -Cosmos client connection mode. - - -- Requirement Level: Conditionally Required - if not `direct` (or pick gw as default) - -- Tag: call-level-tech-specific - -- Type: Enum [gateway, direct] - - -### Attribute `db.cosmosdb.container` - -Cosmos DB container name. - - -- Requirement Level: Conditionally Required - if available - -- Tag: call-level-tech-specific - -- Type: string -- Examples: anystring - - -### Attribute `db.cosmosdb.operation_type` - -CosmosDB Operation Type. - - -- Requirement Level: Conditionally Required - when performing one of the operations in this list - -- Tag: call-level-tech-specific - -- Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - - -### Attribute `db.cosmosdb.request_charge` - -RU consumed for that operation - - -- Requirement Level: Conditionally Required - when available - -- Tag: call-level-tech-specific - -- Type: double -- Examples: [ - 46.18, - 1.0, -] - - -### Attribute `db.cosmosdb.request_content_length` - -Request payload size in bytes - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: int - - -### Attribute `db.cosmosdb.status_code` - -Cosmos DB status code. - - -- Requirement Level: Conditionally Required - if response was received - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 200, - 201, -] - - -### Attribute `db.cosmosdb.sub_status_code` - -Cosmos DB sub status code. - - -- Requirement Level: Conditionally Required - when response was received and contained sub-code. - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 1000, - 1002, -] - - -### Attribute `user_agent.original` - -Full user-agent string is generated by Cosmos DB SDK - - -The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. - Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). - Default value is "NS". - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "cosmos-netstandard-sdk/3.23.0\\|3.23.1\\|1\\|X64\\|Linux 5.4.0-1098-azure 104 18\\|.NET Core 3.1.32\\|S\\|", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/trace-database.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/ios_lifecycle_events.md b/crates/weaver_forge/expected_output/test/group/ios_lifecycle_events.md deleted file mode 100644 index b36ffa8d..00000000 --- a/crates/weaver_forge/expected_output/test/group/ios_lifecycle_events.md +++ /dev/null @@ -1,31 +0,0 @@ -# Group `ios.lifecycle.events` (event) - -## Brief - -This event represents an occurrence of a lifecycle transition on the iOS platform. - -prefix: ios - -## Attributes - - -### Attribute `ios.state` - -This attribute represents the state the application has transitioned into at the occurrence of the event. - - - -The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. - -- Requirement Level: Required - -- Type: Enum [active, inactive, background, foreground, terminate] - -- Stability: Experimental - - - -## Lineage - -Source file: data/mobile-events.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_class_count.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_class_count.md deleted file mode 100644 index b71335f5..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_class_count.md +++ /dev/null @@ -1,16 +0,0 @@ -# Group `metric.jvm.class.count` (metric) - -## Brief - -Number of classes currently loaded. - -prefix: - -## Attributes - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_class_loaded.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_class_loaded.md deleted file mode 100644 index 073fd6ec..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_class_loaded.md +++ /dev/null @@ -1,16 +0,0 @@ -# Group `metric.jvm.class.loaded` (metric) - -## Brief - -Number of classes loaded since JVM start. - -prefix: - -## Attributes - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_class_unloaded.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_class_unloaded.md deleted file mode 100644 index e31aaf34..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_class_unloaded.md +++ /dev/null @@ -1,16 +0,0 @@ -# Group `metric.jvm.class.unloaded` (metric) - -## Brief - -Number of classes unloaded since JVM start. - -prefix: - -## Attributes - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_count.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_count.md deleted file mode 100644 index 02f9d644..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_count.md +++ /dev/null @@ -1,16 +0,0 @@ -# Group `metric.jvm.cpu.count` (metric) - -## Brief - -Number of processors available to the Java virtual machine. - -prefix: - -## Attributes - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_recent_utilization.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_recent_utilization.md deleted file mode 100644 index f6576c4c..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_recent_utilization.md +++ /dev/null @@ -1,16 +0,0 @@ -# Group `metric.jvm.cpu.recent_utilization` (metric) - -## Brief - -Recent CPU utilization for the process as reported by the JVM. - -prefix: - -## Attributes - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_time.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_time.md deleted file mode 100644 index d6f9df68..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_cpu_time.md +++ /dev/null @@ -1,16 +0,0 @@ -# Group `metric.jvm.cpu.time` (metric) - -## Brief - -CPU time used by the process as reported by the JVM. - -prefix: - -## Attributes - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_gc_duration.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_gc_duration.md deleted file mode 100644 index 6392dd23..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_gc_duration.md +++ /dev/null @@ -1,52 +0,0 @@ -# Group `metric.jvm.gc.duration` (metric) - -## Brief - -Duration of JVM garbage collection actions. - -prefix: jvm.gc - -## Attributes - - -### Attribute `jvm.gc.name` - -Name of the garbage collector. - - -Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Young Generation", - "G1 Old Generation", -] - -- Stability: Stable - - -### Attribute `jvm.gc.action` - -Name of the garbage collector action. - - -Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "end of minor GC", - "end of major GC", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_committed.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_committed.md deleted file mode 100644 index 9f92cb32..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_committed.md +++ /dev/null @@ -1,61 +0,0 @@ -# Group `metric.jvm.memory.committed` (metric) - -## Brief - -Measure of memory committed. - -prefix: - -## Attributes - - -### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/jvm-metrics.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_limit.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_limit.md deleted file mode 100644 index 4fd250f1..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_limit.md +++ /dev/null @@ -1,61 +0,0 @@ -# Group `metric.jvm.memory.limit` (metric) - -## Brief - -Measure of max obtainable memory. - -prefix: - -## Attributes - - -### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/jvm-metrics.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used.md deleted file mode 100644 index 6d867206..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used.md +++ /dev/null @@ -1,61 +0,0 @@ -# Group `metric.jvm.memory.used` (metric) - -## Brief - -Measure of memory used. - -prefix: - -## Attributes - - -### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/jvm-metrics.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used_after_last_gc.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used_after_last_gc.md deleted file mode 100644 index f89e34a9..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_memory_used_after_last_gc.md +++ /dev/null @@ -1,61 +0,0 @@ -# Group `metric.jvm.memory.used_after_last_gc` (metric) - -## Brief - -Measure of memory used, as measured after the most recent garbage collection event on this pool. - -prefix: - -## Attributes - - -### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/jvm-metrics.yaml - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - -attribute: - - source group: - - inherited fields: - - locally overridden fields: - diff --git a/crates/weaver_forge/expected_output/test/group/metric_jvm_thread_count.md b/crates/weaver_forge/expected_output/test/group/metric_jvm_thread_count.md deleted file mode 100644 index 3a650076..00000000 --- a/crates/weaver_forge/expected_output/test/group/metric_jvm_thread_count.md +++ /dev/null @@ -1,44 +0,0 @@ -# Group `metric.jvm.thread.count` (metric) - -## Brief - -Number of executing platform threads. - -prefix: - -## Attributes - - -### Attribute `jvm.thread.daemon` - -Whether the thread is daemon or not. - - -- Requirement Level: Recommended - -- Type: boolean - -- Stability: Stable - - -### Attribute `jvm.thread.state` - -State of the thread. - - -- Requirement Level: Recommended - -- Type: Enum [new, runnable, blocked, waiting, timed_waiting, terminated] -- Examples: [ - "runnable", - "blocked", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/jvm-metrics.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/otel_library.md b/crates/weaver_forge/expected_output/test/group/otel_library.md deleted file mode 100644 index 7c532bbc..00000000 --- a/crates/weaver_forge/expected_output/test/group/otel_library.md +++ /dev/null @@ -1,44 +0,0 @@ -# Group `otel.library` (resource) - -## Brief - -Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. - -prefix: otel.library - -## Attributes - - -### Attribute `otel.library.name` - - - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "io.opentelemetry.contrib.mongodb", -] -- Deprecated: use the `otel.scope.name` attribute. - - -### Attribute `otel.library.version` - - - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "1.0.0", -] -- Deprecated: use the `otel.scope.version` attribute. - - - -## Lineage - -Source file: data/exporter.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/otel_scope.md b/crates/weaver_forge/expected_output/test/group/otel_scope.md deleted file mode 100644 index 96d71a0f..00000000 --- a/crates/weaver_forge/expected_output/test/group/otel_scope.md +++ /dev/null @@ -1,46 +0,0 @@ -# Group `otel.scope` (resource) - -## Brief - -Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. - -prefix: otel.scope - -## Attributes - - -### Attribute `otel.scope.name` - -The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "io.opentelemetry.contrib.mongodb", -] - -- Stability: Stable - - -### Attribute `otel.scope.version` - -The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "1.0.0", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/exporter.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/registry_db.md b/crates/weaver_forge/expected_output/test/group/registry_db.md deleted file mode 100644 index 48a30ef2..00000000 --- a/crates/weaver_forge/expected_output/test/group/registry_db.md +++ /dev/null @@ -1,478 +0,0 @@ -# Group `registry.db` (attribute_group) - -## Brief - -This document defines the attributes used to describe telemetry in the context of databases. - -prefix: db - -## Attributes - - -### Attribute `db.cassandra.coordinator.dc` - -The data center of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: string -- Examples: us-west-2 - - -### Attribute `db.cassandra.coordinator.id` - -The ID of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: string -- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - - -### Attribute `db.cassandra.consistency_level` - -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - - -### Attribute `db.cassandra.idempotence` - -Whether or not the query is idempotent. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: boolean - - -### Attribute `db.cassandra.page_size` - -The fetch size used for paging, i.e. how many rows will be returned at once. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: int -- Examples: [ - 5000, -] - - -### Attribute `db.cassandra.speculative_execution_count` - -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: int -- Examples: [ - 0, - 2, -] - - -### Attribute `db.cassandra.table` - -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). - - -This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: string -- Examples: mytable - - -### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -### Attribute `db.cosmosdb.client_id` - -Unique Cosmos client instance id. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: string -- Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - - -### Attribute `db.cosmosdb.connection_mode` - -Cosmos client connection mode. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: Enum [gateway, direct] - - -### Attribute `db.cosmosdb.container` - -Cosmos DB container name. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: string -- Examples: anystring - - -### Attribute `db.cosmosdb.operation_type` - -CosmosDB Operation Type. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - - -### Attribute `db.cosmosdb.request_charge` - -RU consumed for that operation - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: double -- Examples: [ - 46.18, - 1.0, -] - - -### Attribute `db.cosmosdb.request_content_length` - -Request payload size in bytes - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: int - - -### Attribute `db.cosmosdb.status_code` - -Cosmos DB status code. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: int -- Examples: [ - 200, - 201, -] - - -### Attribute `db.cosmosdb.sub_status_code` - -Cosmos DB sub status code. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: int -- Examples: [ - 1000, - 1002, -] - - -### Attribute `db.elasticsearch.cluster.name` - -Represents the identifier of an Elasticsearch cluster. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-elasticsearch - -- Type: string -- Examples: [ - "e9106fc68e3044f0b1475b04bf4ffd5f", -] - - -### Attribute `db.elasticsearch.node.name` - -Represents the human-readable identifier of the node/instance to which a request was routed. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-elasticsearch - -- Type: string -- Examples: [ - "instance-0000000001", -] - - -### Attribute `db.elasticsearch.path_parts` - -A dynamic value in the url path. - - - -Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. - -- Requirement Level: Recommended - -- Tag: tech-specific-elasticsearch - -- Type: template[string] -- Examples: [ - "db.elasticsearch.path_parts.index=test-index", - "db.elasticsearch.path_parts.doc_id=123", -] - - -### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-jdbc - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -### Attribute `db.mongodb.collection` - -The MongoDB collection being accessed within the database stated in `db.name`. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-mongodb - -- Type: string -- Examples: [ - "customers", - "products", -] - - -### Attribute `db.mssql.instance_name` - -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - - - -If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). - -- Requirement Level: Recommended - -- Tag: tech-specific-mssql - -- Type: string -- Examples: MSSQLSERVER - - -### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: [ - "customers", - "main", -] - - -### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -### Attribute `db.redis.database_index` - -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-redis - -- Type: int -- Examples: [ - 0, - 1, - 15, -] - - -### Attribute `db.sql.table` - -The name of the primary table that the operation is acting upon, including the database name (if applicable). - - -It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: tech-specific-sql - -- Type: string -- Examples: [ - "public.users", - "customers", -] - - -### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: mysql-e26b99z.example.com - - - -## Lineage - -Source file: data/registry-db.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/registry_http.md b/crates/weaver_forge/expected_output/test/group/registry_http.md deleted file mode 100644 index d5d4caa3..00000000 --- a/crates/weaver_forge/expected_output/test/group/registry_http.md +++ /dev/null @@ -1,186 +0,0 @@ -# Group `registry.http` (attribute_group) - -## Brief - -This document defines semantic convention attributes in the HTTP namespace. - -prefix: http - -## Attributes - - -### Attribute `http.request.body.size` - -The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - - - -- Requirement Level: Recommended - -- Type: int -- Examples: 3495 - -- Stability: Experimental - - -### Attribute `http.request.header` - -HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. - - - -Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. -The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. -The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. - -- Requirement Level: Recommended - -- Type: template[string[]] -- Examples: [ - "http.request.header.content-type=[\"application/json\"]", - "http.request.header.x-forwarded-for=[\"1.2.3.4\", \"1.2.3.5\"]", -] - -- Stability: Stable - - -### Attribute `http.request.method` - -HTTP request method. - - -HTTP request method value SHOULD be "known" to the instrumentation. -By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) -and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - -If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. - -If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override -the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named -OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods -(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). - -HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. -Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. -Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. - -- Requirement Level: Recommended - -- Type: Enum [CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, _OTHER] -- Examples: [ - "GET", - "POST", - "HEAD", -] - -- Stability: Stable - - -### Attribute `http.request.method_original` - -Original HTTP method sent by the client in the request line. - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "GeT", - "ACL", - "foo", -] - -- Stability: Stable - - -### Attribute `http.request.resend_count` - -The ordinal number of request resending attempt (for any reason, including redirects). - - - -The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). - -- Requirement Level: Recommended - -- Type: int -- Examples: 3 - -- Stability: Stable - - -### Attribute `http.response.body.size` - -The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - - - -- Requirement Level: Recommended - -- Type: int -- Examples: 3495 - -- Stability: Experimental - - -### Attribute `http.response.header` - -HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. - - - -Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. -Users MAY explicitly configure instrumentations to capture them even though it is not recommended. -The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. - -- Requirement Level: Recommended - -- Type: template[string[]] -- Examples: [ - "http.response.header.content-type=[\"application/json\"]", - "http.response.header.my-custom-header=[\"abc\", \"def\"]", -] - -- Stability: Stable - - -### Attribute `http.response.status_code` - -[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 200, -] - -- Stability: Stable - - -### Attribute `http.route` - -The matched route, that is, the path template in the format used by the respective server framework. - - - -MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. -SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "/users/:userID?", - "{controller}/{action}/{id?}", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/registry-http.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/registry_network.md b/crates/weaver_forge/expected_output/test/group/registry_network.md deleted file mode 100644 index 2518bed7..00000000 --- a/crates/weaver_forge/expected_output/test/group/registry_network.md +++ /dev/null @@ -1,232 +0,0 @@ -# Group `registry.network` (attribute_group) - -## Brief - -These attributes may be used for any network related operation. - -prefix: network - -## Attributes - - -### Attribute `network.carrier.icc` - -The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - - -- Requirement Level: Recommended - -- Type: string -- Examples: DE - - -### Attribute `network.carrier.mcc` - -The mobile carrier country code. - - -- Requirement Level: Recommended - -- Type: string -- Examples: 310 - - -### Attribute `network.carrier.mnc` - -The mobile carrier network code. - - -- Requirement Level: Recommended - -- Type: string -- Examples: 001 - - -### Attribute `network.carrier.name` - -The name of the mobile carrier. - - -- Requirement Level: Recommended - -- Type: string -- Examples: sprint - - -### Attribute `network.connection.subtype` - -This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - - -- Requirement Level: Recommended - -- Type: Enum [gprs, edge, umts, cdma, evdo_0, evdo_a, cdma2000_1xrtt, hsdpa, hsupa, hspa, iden, evdo_b, lte, ehrpd, hspap, gsm, td_scdma, iwlan, nr, nrnsa, lte_ca] -- Examples: LTE - - -### Attribute `network.connection.type` - -The internet connection type. - - -- Requirement Level: Recommended - -- Type: Enum [wifi, wired, cell, unavailable, unknown] -- Examples: wifi - - -### Attribute `network.local.address` - -Local address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.local.port` - -Local port number of the network connection. - - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -### Attribute `network.protocol.name` - -[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "amqp", - "http", - "mqtt", -] - -- Stability: Stable - - -### Attribute `network.protocol.version` - -Version of the protocol specified in `network.protocol.name`. - - -`network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - -- Requirement Level: Recommended - -- Type: string -- Examples: 3.1.1 - -- Stability: Stable - - -### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -### Attribute `network.io.direction` - -The network IO operation direction. - - -- Requirement Level: Recommended - -- Type: Enum [transmit, receive] -- Examples: [ - "transmit", -] - - - -## Lineage - -Source file: data/registry-network.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/registry_url.md b/crates/weaver_forge/expected_output/test/group/registry_url.md deleted file mode 100644 index 8c2d3035..00000000 --- a/crates/weaver_forge/expected_output/test/group/registry_url.md +++ /dev/null @@ -1,100 +0,0 @@ -# Group `registry.url` (attribute_group) - -## Brief - -Attributes describing URL. - -prefix: url - -## Attributes - - -### Attribute `url.scheme` - -The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "https", - "ftp", - "telnet", -] - -- Stability: Stable - - -### Attribute `url.full` - -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) - - -For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. -`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. -`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "https://www.foo.bar/search?q=OpenTelemetry#SemConv", - "//localhost", -] - -- Stability: Stable - - -### Attribute `url.path` - -The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "/search", -] - -- Stability: Stable - - -### Attribute `url.query` - -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component - - -Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "q=OpenTelemetry", -] - -- Stability: Stable - - -### Attribute `url.fragment` - -The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "SemConv", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/registry-url.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/registry_user_agent.md b/crates/weaver_forge/expected_output/test/group/registry_user_agent.md deleted file mode 100644 index bf21b667..00000000 --- a/crates/weaver_forge/expected_output/test/group/registry_user_agent.md +++ /dev/null @@ -1,33 +0,0 @@ -# Group `registry.user_agent` (attribute_group) - -## Brief - -Describes user-agent attributes. - -prefix: user_agent - -## Attributes - - -### Attribute `user_agent.original` - -Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. - - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "CERN-LineMode/2.15 libwww/2.17b3", - "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1", -] - -- Stability: Stable - - - -## Lineage - -Source file: data/registry-user-agent.yaml - diff --git a/crates/weaver_forge/expected_output/test/group/server.md b/crates/weaver_forge/expected_output/test/group/server.md deleted file mode 100644 index caa11176..00000000 --- a/crates/weaver_forge/expected_output/test/group/server.md +++ /dev/null @@ -1,54 +0,0 @@ -# Group `server` (attribute_group) - -## Brief - -These attributes may be used to describe the server in a connection-based network interaction where there is one side that initiates the connection (the client is the side that initiates the connection). This covers all TCP network interactions since TCP is connection-based and one side initiates the connection (an exception is made for peer-to-peer communication over TCP where the "user-facing" surface of the protocol / API doesn't expose a clear notion of client and server). This also covers UDP network interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS. - -prefix: server - -## Attributes - - -### Attribute `server.address` - -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - - -## Lineage - -Source file: data/registry-server.yaml - diff --git a/crates/weaver_forge/expected_output/test/groups.md b/crates/weaver_forge/expected_output/test/groups.md deleted file mode 100644 index bb89d4df..00000000 --- a/crates/weaver_forge/expected_output/test/groups.md +++ /dev/null @@ -1,5231 +0,0 @@ -# Semantic Convention Groups - - -## Group `otel.scope` (resource) - -### Brief - -Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. - -prefix: otel.scope - -### Attributes - - -#### Attribute `otel.scope.name` - -The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "io.opentelemetry.contrib.mongodb", -] - -- Stability: Stable - - -#### Attribute `otel.scope.version` - -The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "1.0.0", -] - -- Stability: Stable - - - -## Group `otel.library` (resource) - -### Brief - -Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. - -prefix: otel.library - -### Attributes - - -#### Attribute `otel.library.name` - - - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "io.opentelemetry.contrib.mongodb", -] -- Deprecated: use the `otel.scope.name` attribute. - - -#### Attribute `otel.library.version` - - - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "1.0.0", -] -- Deprecated: use the `otel.scope.version` attribute. - - - -## Group `attributes.jvm.memory` (attribute_group) - -### Brief - -Describes JVM memory metric attributes. - -prefix: jvm.memory - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Group `metric.jvm.memory.used` (metric) - -### Brief - -Measure of memory used. - -prefix: - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Group `metric.jvm.memory.committed` (metric) - -### Brief - -Measure of memory committed. - -prefix: - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Group `metric.jvm.memory.limit` (metric) - -### Brief - -Measure of max obtainable memory. - -prefix: - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Group `metric.jvm.memory.used_after_last_gc` (metric) - -### Brief - -Measure of memory used, as measured after the most recent garbage collection event on this pool. - -prefix: - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - - -## Group `metric.jvm.gc.duration` (metric) - -### Brief - -Duration of JVM garbage collection actions. - -prefix: jvm.gc - -### Attributes - - -#### Attribute `jvm.gc.name` - -Name of the garbage collector. - - -Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Young Generation", - "G1 Old Generation", -] - -- Stability: Stable - - -#### Attribute `jvm.gc.action` - -Name of the garbage collector action. - - -Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "end of minor GC", - "end of major GC", -] - -- Stability: Stable - - - -## Group `metric.jvm.thread.count` (metric) - -### Brief - -Number of executing platform threads. - -prefix: - -### Attributes - - -#### Attribute `jvm.thread.daemon` - -Whether the thread is daemon or not. - - -- Requirement Level: Recommended - -- Type: boolean - -- Stability: Stable - - -#### Attribute `jvm.thread.state` - -State of the thread. - - -- Requirement Level: Recommended - -- Type: Enum [new, runnable, blocked, waiting, timed_waiting, terminated] -- Examples: [ - "runnable", - "blocked", -] - -- Stability: Stable - - - -## Group `metric.jvm.class.loaded` (metric) - -### Brief - -Number of classes loaded since JVM start. - -prefix: - -### Attributes - - - -## Group `metric.jvm.class.unloaded` (metric) - -### Brief - -Number of classes unloaded since JVM start. - -prefix: - -### Attributes - - - -## Group `metric.jvm.class.count` (metric) - -### Brief - -Number of classes currently loaded. - -prefix: - -### Attributes - - - -## Group `metric.jvm.cpu.count` (metric) - -### Brief - -Number of processors available to the Java virtual machine. - -prefix: - -### Attributes - - - -## Group `metric.jvm.cpu.time` (metric) - -### Brief - -CPU time used by the process as reported by the JVM. - -prefix: - -### Attributes - - - -## Group `metric.jvm.cpu.recent_utilization` (metric) - -### Brief - -Recent CPU utilization for the process as reported by the JVM. - -prefix: - -### Attributes - - - -## Group `ios.lifecycle.events` (event) - -### Brief - -This event represents an occurrence of a lifecycle transition on the iOS platform. - -prefix: ios - -### Attributes - - -#### Attribute `ios.state` - -This attribute represents the state the application has transitioned into at the occurrence of the event. - - - -The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. - -- Requirement Level: Required - -- Type: Enum [active, inactive, background, foreground, terminate] - -- Stability: Experimental - - - -## Group `android.lifecycle.events` (event) - -### Brief - -This event represents an occurrence of a lifecycle transition on the Android platform. - -prefix: android - -### Attributes - - -#### Attribute `android.state` - -This attribute represents the state the application has transitioned into at the occurrence of the event. - - - -The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. - -- Requirement Level: Required - -- Type: Enum [created, background, foreground] - -- Stability: Experimental - - - -## Group `registry.db` (attribute_group) - -### Brief - -This document defines the attributes used to describe telemetry in the context of databases. - -prefix: db - -### Attributes - - -#### Attribute `db.cassandra.coordinator.dc` - -The data center of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: string -- Examples: us-west-2 - - -#### Attribute `db.cassandra.coordinator.id` - -The ID of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: string -- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - - -#### Attribute `db.cassandra.consistency_level` - -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - - -#### Attribute `db.cassandra.idempotence` - -Whether or not the query is idempotent. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: boolean - - -#### Attribute `db.cassandra.page_size` - -The fetch size used for paging, i.e. how many rows will be returned at once. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: int -- Examples: [ - 5000, -] - - -#### Attribute `db.cassandra.speculative_execution_count` - -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: int -- Examples: [ - 0, - 2, -] - - -#### Attribute `db.cassandra.table` - -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). - - -This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: tech-specific-cassandra - -- Type: string -- Examples: mytable - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.cosmosdb.client_id` - -Unique Cosmos client instance id. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: string -- Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - - -#### Attribute `db.cosmosdb.connection_mode` - -Cosmos client connection mode. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: Enum [gateway, direct] - - -#### Attribute `db.cosmosdb.container` - -Cosmos DB container name. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: string -- Examples: anystring - - -#### Attribute `db.cosmosdb.operation_type` - -CosmosDB Operation Type. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - - -#### Attribute `db.cosmosdb.request_charge` - -RU consumed for that operation - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: double -- Examples: [ - 46.18, - 1.0, -] - - -#### Attribute `db.cosmosdb.request_content_length` - -Request payload size in bytes - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: int - - -#### Attribute `db.cosmosdb.status_code` - -Cosmos DB status code. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: int -- Examples: [ - 200, - 201, -] - - -#### Attribute `db.cosmosdb.sub_status_code` - -Cosmos DB sub status code. - - -- Requirement Level: Recommended - -- Tag: tech-specific-cosmosdb - -- Type: int -- Examples: [ - 1000, - 1002, -] - - -#### Attribute `db.elasticsearch.cluster.name` - -Represents the identifier of an Elasticsearch cluster. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-elasticsearch - -- Type: string -- Examples: [ - "e9106fc68e3044f0b1475b04bf4ffd5f", -] - - -#### Attribute `db.elasticsearch.node.name` - -Represents the human-readable identifier of the node/instance to which a request was routed. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-elasticsearch - -- Type: string -- Examples: [ - "instance-0000000001", -] - - -#### Attribute `db.elasticsearch.path_parts` - -A dynamic value in the url path. - - - -Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. - -- Requirement Level: Recommended - -- Tag: tech-specific-elasticsearch - -- Type: template[string] -- Examples: [ - "db.elasticsearch.path_parts.index=test-index", - "db.elasticsearch.path_parts.doc_id=123", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-jdbc - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.mongodb.collection` - -The MongoDB collection being accessed within the database stated in `db.name`. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-mongodb - -- Type: string -- Examples: [ - "customers", - "products", -] - - -#### Attribute `db.mssql.instance_name` - -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - - - -If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). - -- Requirement Level: Recommended - -- Tag: tech-specific-mssql - -- Type: string -- Examples: MSSQLSERVER - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `db.redis.database_index` - -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - - - -- Requirement Level: Recommended - -- Tag: tech-specific-redis - -- Type: int -- Examples: [ - 0, - 1, - 15, -] - - -#### Attribute `db.sql.table` - -The name of the primary table that the operation is acting upon, including the database name (if applicable). - - -It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: tech-specific-sql - -- Type: string -- Examples: [ - "public.users", - "customers", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Recommended - -- Tag: db-generic - -- Type: string -- Examples: mysql-e26b99z.example.com - - - -## Group `registry.http` (attribute_group) - -### Brief - -This document defines semantic convention attributes in the HTTP namespace. - -prefix: http - -### Attributes - - -#### Attribute `http.request.body.size` - -The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - - - -- Requirement Level: Recommended - -- Type: int -- Examples: 3495 - -- Stability: Experimental - - -#### Attribute `http.request.header` - -HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. - - - -Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. -The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. -The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. - -- Requirement Level: Recommended - -- Type: template[string[]] -- Examples: [ - "http.request.header.content-type=[\"application/json\"]", - "http.request.header.x-forwarded-for=[\"1.2.3.4\", \"1.2.3.5\"]", -] - -- Stability: Stable - - -#### Attribute `http.request.method` - -HTTP request method. - - -HTTP request method value SHOULD be "known" to the instrumentation. -By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) -and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - -If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. - -If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override -the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named -OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods -(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). - -HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. -Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. -Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. - -- Requirement Level: Recommended - -- Type: Enum [CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, _OTHER] -- Examples: [ - "GET", - "POST", - "HEAD", -] - -- Stability: Stable - - -#### Attribute `http.request.method_original` - -Original HTTP method sent by the client in the request line. - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "GeT", - "ACL", - "foo", -] - -- Stability: Stable - - -#### Attribute `http.request.resend_count` - -The ordinal number of request resending attempt (for any reason, including redirects). - - - -The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). - -- Requirement Level: Recommended - -- Type: int -- Examples: 3 - -- Stability: Stable - - -#### Attribute `http.response.body.size` - -The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - - - -- Requirement Level: Recommended - -- Type: int -- Examples: 3495 - -- Stability: Experimental - - -#### Attribute `http.response.header` - -HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. - - - -Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. -Users MAY explicitly configure instrumentations to capture them even though it is not recommended. -The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. - -- Requirement Level: Recommended - -- Type: template[string[]] -- Examples: [ - "http.response.header.content-type=[\"application/json\"]", - "http.response.header.my-custom-header=[\"abc\", \"def\"]", -] - -- Stability: Stable - - -#### Attribute `http.response.status_code` - -[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 200, -] - -- Stability: Stable - - -#### Attribute `http.route` - -The matched route, that is, the path template in the format used by the respective server framework. - - - -MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. -SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "/users/:userID?", - "{controller}/{action}/{id?}", -] - -- Stability: Stable - - - -## Group `registry.network` (attribute_group) - -### Brief - -These attributes may be used for any network related operation. - -prefix: network - -### Attributes - - -#### Attribute `network.carrier.icc` - -The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - - -- Requirement Level: Recommended - -- Type: string -- Examples: DE - - -#### Attribute `network.carrier.mcc` - -The mobile carrier country code. - - -- Requirement Level: Recommended - -- Type: string -- Examples: 310 - - -#### Attribute `network.carrier.mnc` - -The mobile carrier network code. - - -- Requirement Level: Recommended - -- Type: string -- Examples: 001 - - -#### Attribute `network.carrier.name` - -The name of the mobile carrier. - - -- Requirement Level: Recommended - -- Type: string -- Examples: sprint - - -#### Attribute `network.connection.subtype` - -This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - - -- Requirement Level: Recommended - -- Type: Enum [gprs, edge, umts, cdma, evdo_0, evdo_a, cdma2000_1xrtt, hsdpa, hsupa, hspa, iden, evdo_b, lte, ehrpd, hspap, gsm, td_scdma, iwlan, nr, nrnsa, lte_ca] -- Examples: LTE - - -#### Attribute `network.connection.type` - -The internet connection type. - - -- Requirement Level: Recommended - -- Type: Enum [wifi, wired, cell, unavailable, unknown] -- Examples: wifi - - -#### Attribute `network.local.address` - -Local address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.local.port` - -Local port number of the network connection. - - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.protocol.name` - -[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "amqp", - "http", - "mqtt", -] - -- Stability: Stable - - -#### Attribute `network.protocol.version` - -Version of the protocol specified in `network.protocol.name`. - - -`network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - -- Requirement Level: Recommended - -- Type: string -- Examples: 3.1.1 - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `network.io.direction` - -The network IO operation direction. - - -- Requirement Level: Recommended - -- Type: Enum [transmit, receive] -- Examples: [ - "transmit", -] - - - -## Group `server` (attribute_group) - -### Brief - -These attributes may be used to describe the server in a connection-based network interaction where there is one side that initiates the connection (the client is the side that initiates the connection). This covers all TCP network interactions since TCP is connection-based and one side initiates the connection (an exception is made for peer-to-peer communication over TCP where the "user-facing" surface of the protocol / API doesn't expose a clear notion of client and server). This also covers UDP network interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS. - -prefix: server - -### Attributes - - -#### Attribute `server.address` - -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - - -## Group `registry.url` (attribute_group) - -### Brief - -Attributes describing URL. - -prefix: url - -### Attributes - - -#### Attribute `url.scheme` - -The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "https", - "ftp", - "telnet", -] - -- Stability: Stable - - -#### Attribute `url.full` - -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) - - -For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. -`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. -`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "https://www.foo.bar/search?q=OpenTelemetry#SemConv", - "//localhost", -] - -- Stability: Stable - - -#### Attribute `url.path` - -The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "/search", -] - -- Stability: Stable - - -#### Attribute `url.query` - -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component - - -Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "q=OpenTelemetry", -] - -- Stability: Stable - - -#### Attribute `url.fragment` - -The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "SemConv", -] - -- Stability: Stable - - - -## Group `registry.user_agent` (attribute_group) - -### Brief - -Describes user-agent attributes. - -prefix: user_agent - -### Attributes - - -#### Attribute `user_agent.original` - -Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. - - - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "CERN-LineMode/2.15 libwww/2.17b3", - "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1", -] - -- Stability: Stable - - - -## Group `db` (span) - -### Brief - -This document defines the attributes used to perform database client calls. - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - - -## Group `db.mssql` (span) - -### Brief - -Connection-level attributes for Microsoft SQL Server - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.mssql.instance_name` - -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - - - -If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: MSSQLSERVER - - - -## Group `db.cassandra` (span) - -### Brief - -Call-level attributes for Cassandra - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.cassandra.consistency_level` - -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - - -#### Attribute `db.cassandra.coordinator.dc` - -The data center of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: us-west-2 - - -#### Attribute `db.cassandra.coordinator.id` - -The ID of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - - -#### Attribute `db.cassandra.idempotence` - -Whether or not the query is idempotent. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: boolean - - -#### Attribute `db.cassandra.page_size` - -The fetch size used for paging, i.e. how many rows will be returned at once. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 5000, -] - - -#### Attribute `db.cassandra.speculative_execution_count` - -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 0, - 2, -] - - -#### Attribute `db.cassandra.table` - -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). - - -This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: mytable - - -#### Attribute `db.name` - -The keyspace name in Cassandra. - - - -For Cassandra the `db.name` should be set to the Cassandra keyspace name. - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: [ - "mykeyspace", -] - - - -## Group `db.hbase` (span) - -### Brief - -Call-level attributes for HBase - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.name` - -The HBase namespace. - - - -For HBase the `db.name` should be set to the HBase namespace. - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "mynamespace", -] - - - -## Group `db.couchdb` (span) - -### Brief - -Call-level attributes for CouchDB - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.operation` - -The HTTP method + the target REST route. - - - -In **CouchDB**, `db.operation` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](http://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid). - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "GET /{db}/{docid}", -] - - - -## Group `db.redis` (span) - -### Brief - -Call-level attributes for Redis - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.redis.database_index` - -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - - - -- Requirement Level: Conditionally Required - If other than the default database (`0`). - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 0, - 1, - 15, -] - - -#### Attribute `db.statement` - -The full syntax of the Redis CLI command. - - - -For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`. - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "HMSET myhash field1 'Hello' field2 'World'", -] - - - -## Group `db.mongodb` (span) - -### Brief - -Call-level attributes for MongoDB - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.mongodb.collection` - -The MongoDB collection being accessed within the database stated in `db.name`. - - - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "customers", - "products", -] - - - -## Group `db.elasticsearch` (span) - -### Brief - -Call-level attributes for Elasticsearch - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.elasticsearch.cluster.name` - -Represents the identifier of an Elasticsearch cluster. - - - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "e9106fc68e3044f0b1475b04bf4ffd5f", -] - - -#### Attribute `db.elasticsearch.node.name` - -Represents the human-readable identifier of the node/instance to which a request was routed. - - - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "instance-0000000001", -] - - -#### Attribute `db.elasticsearch.path_parts` - -A dynamic value in the url path. - - - -Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. - -- Requirement Level: Conditionally Required - when the url has dynamic values - -- Tag: call-level-tech-specific - -- Type: template[string] -- Examples: [ - "db.elasticsearch.path_parts.index=test-index", - "db.elasticsearch.path_parts.doc_id=123", -] - - -#### Attribute `db.operation` - -The endpoint identifier for the request. - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "search", - "ml.close_job", - "cat.aliases", -] - - -#### Attribute `db.statement` - -The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. - - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "\"{\\\"query\\\":{\\\"term\\\":{\\\"user.id\\\":\\\"kimchy\\\"}}}\"", -] - - -#### Attribute `http.request.method` - -HTTP request method. - - -HTTP request method value SHOULD be "known" to the instrumentation. -By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) -and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - -If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. - -If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override -the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named -OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods -(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). - -HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. -Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. -Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: Enum [CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, _OTHER] -- Examples: [ - "GET", - "POST", - "HEAD", -] - -- Stability: Stable - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `url.full` - -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) - - -For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. -`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. -`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "https://localhost:9200/index/_search?q=user.id:kimchy", -] - -- Stability: Stable - - - -## Group `db.sql` (span) - -### Brief - -Call-level attributes for SQL databases - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.sql.table` - -The name of the primary table that the operation is acting upon, including the database name (if applicable). - - -It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "public.users", - "customers", -] - - - -## Group `db.cosmosdb` (span) - -### Brief - -Call-level attributes for Cosmos DB. - -prefix: db.cosmosdb - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.cosmosdb.client_id` - -Unique Cosmos client instance id. - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - - -#### Attribute `db.cosmosdb.connection_mode` - -Cosmos client connection mode. - - -- Requirement Level: Conditionally Required - if not `direct` (or pick gw as default) - -- Tag: call-level-tech-specific - -- Type: Enum [gateway, direct] - - -#### Attribute `db.cosmosdb.container` - -Cosmos DB container name. - - -- Requirement Level: Conditionally Required - if available - -- Tag: call-level-tech-specific - -- Type: string -- Examples: anystring - - -#### Attribute `db.cosmosdb.operation_type` - -CosmosDB Operation Type. - - -- Requirement Level: Conditionally Required - when performing one of the operations in this list - -- Tag: call-level-tech-specific - -- Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - - -#### Attribute `db.cosmosdb.request_charge` - -RU consumed for that operation - - -- Requirement Level: Conditionally Required - when available - -- Tag: call-level-tech-specific - -- Type: double -- Examples: [ - 46.18, - 1.0, -] - - -#### Attribute `db.cosmosdb.request_content_length` - -Request payload size in bytes - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: int - - -#### Attribute `db.cosmosdb.status_code` - -Cosmos DB status code. - - -- Requirement Level: Conditionally Required - if response was received - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 200, - 201, -] - - -#### Attribute `db.cosmosdb.sub_status_code` - -Cosmos DB sub status code. - - -- Requirement Level: Conditionally Required - when response was received and contained sub-code. - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 1000, - 1002, -] - - -#### Attribute `user_agent.original` - -Full user-agent string is generated by Cosmos DB SDK - - -The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. - Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). - Default value is "NS". - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "cosmos-netstandard-sdk/3.23.0\\|3.23.1\\|1\\|X64\\|Linux 5.4.0-1098-azure 104 18\\|.NET Core 3.1.32\\|S\\|", -] - -- Stability: Stable - - - -## Group `db.tech` (span) - -### Brief - -Semantic convention group for specific technologies - -prefix: - -### Attributes - - -#### Attribute `db.system` - -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - - -- Requirement Level: Required - -- Tag: connection-level - -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - - -#### Attribute `db.connection_string` - -The connection string used to connect to the database. It is recommended to remove embedded credentials. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; - - -#### Attribute `db.user` - -Username for accessing the database. - - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "findAndModify", - "HMSET", - "SELECT", -] - - -#### Attribute `server.address` - -Name of the database host. - - - -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level - -- Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. - - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: int -- Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", -] - -- Stability: Stable - - -#### Attribute `network.type` - -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - - -The value SHOULD be normalized to lowercase. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [ipv4, ipv6] -- Examples: [ - "ipv4", - "ipv6", -] - -- Stability: Stable - - -#### Attribute `db.instance.id` - -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.cassandra.consistency_level` - -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - - -#### Attribute `db.cassandra.coordinator.dc` - -The data center of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: us-west-2 - - -#### Attribute `db.cassandra.coordinator.id` - -The ID of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - - -#### Attribute `db.cassandra.idempotence` - -Whether or not the query is idempotent. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: boolean - - -#### Attribute `db.cassandra.page_size` - -The fetch size used for paging, i.e. how many rows will be returned at once. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 5000, -] - - -#### Attribute `db.cassandra.speculative_execution_count` - -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 0, - 2, -] - - -#### Attribute `db.cassandra.table` - -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). - - -This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: mytable - - -#### Attribute `db.name` - -The keyspace name in Cassandra. - - - -For Cassandra the `db.name` should be set to the Cassandra keyspace name. - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: [ - "mykeyspace", -] - - -#### Attribute `db.redis.database_index` - -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - - - -- Requirement Level: Conditionally Required - If other than the default database (`0`). - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 0, - 1, - 15, -] - - -#### Attribute `db.statement` - -The full syntax of the Redis CLI command. - - - -For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`. - -- Requirement Level: Optional - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "HMSET myhash field1 'Hello' field2 'World'", -] - - -#### Attribute `db.mongodb.collection` - -The MongoDB collection being accessed within the database stated in `db.name`. - - - -- Requirement Level: Required - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "customers", - "products", -] - - -#### Attribute `db.sql.table` - -The name of the primary table that the operation is acting upon, including the database name (if applicable). - - -It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "public.users", - "customers", -] - - -#### Attribute `db.cosmosdb.client_id` - -Unique Cosmos client instance id. - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - - -#### Attribute `db.cosmosdb.connection_mode` - -Cosmos client connection mode. - - -- Requirement Level: Conditionally Required - if not `direct` (or pick gw as default) - -- Tag: call-level-tech-specific - -- Type: Enum [gateway, direct] - - -#### Attribute `db.cosmosdb.container` - -Cosmos DB container name. - - -- Requirement Level: Conditionally Required - if available - -- Tag: call-level-tech-specific - -- Type: string -- Examples: anystring - - -#### Attribute `db.cosmosdb.operation_type` - -CosmosDB Operation Type. - - -- Requirement Level: Conditionally Required - when performing one of the operations in this list - -- Tag: call-level-tech-specific - -- Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - - -#### Attribute `db.cosmosdb.request_charge` - -RU consumed for that operation - - -- Requirement Level: Conditionally Required - when available - -- Tag: call-level-tech-specific - -- Type: double -- Examples: [ - 46.18, - 1.0, -] - - -#### Attribute `db.cosmosdb.request_content_length` - -Request payload size in bytes - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: int - - -#### Attribute `db.cosmosdb.status_code` - -Cosmos DB status code. - - -- Requirement Level: Conditionally Required - if response was received - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 200, - 201, -] - - -#### Attribute `db.cosmosdb.sub_status_code` - -Cosmos DB sub status code. - - -- Requirement Level: Conditionally Required - when response was received and contained sub-code. - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 1000, - 1002, -] - - -#### Attribute `user_agent.original` - -Full user-agent string is generated by Cosmos DB SDK - - -The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. - Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). - Default value is "NS". - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "cosmos-netstandard-sdk/3.23.0\\|3.23.1\\|1\\|X64\\|Linux 5.4.0-1098-azure 104 18\\|.NET Core 3.1.32\\|S\\|", -] - -- Stability: Stable - - diff --git a/crates/weaver_forge/expected_output/test/metric/jvm.md b/crates/weaver_forge/expected_output/test/metric/jvm.md new file mode 100644 index 00000000..7dbbb85f --- /dev/null +++ b/crates/weaver_forge/expected_output/test/metric/jvm.md @@ -0,0 +1,327 @@ +## Metrics Namespace `jvm` + + +## Metric `jvm.memory.used` + +Instrument: updowncounter +Unit: By +Stability: stable + +### Attributes + + +#### Attribute `jvm.memory.type` + +The type of memory. + + +- Requirement Level: Recommended + +- Type: Enum [heap, non_heap] +- Examples: [ + "heap", + "non_heap", +] + +- Stability: Stable + + +#### Attribute `jvm.memory.pool.name` + +Name of the memory pool. + + +Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). + +- Requirement Level: Recommended + +- Type: string +- Examples: [ + "G1 Old Gen", + "G1 Eden space", + "G1 Survivor Space", +] + +- Stability: Stable + + + +## Metric `jvm.memory.committed` + +Instrument: updowncounter +Unit: By +Stability: stable + +### Attributes + + +#### Attribute `jvm.memory.type` + +The type of memory. + + +- Requirement Level: Recommended + +- Type: Enum [heap, non_heap] +- Examples: [ + "heap", + "non_heap", +] + +- Stability: Stable + + +#### Attribute `jvm.memory.pool.name` + +Name of the memory pool. + + +Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). + +- Requirement Level: Recommended + +- Type: string +- Examples: [ + "G1 Old Gen", + "G1 Eden space", + "G1 Survivor Space", +] + +- Stability: Stable + + + +## Metric `jvm.memory.limit` + +Instrument: updowncounter +Unit: By +Stability: stable + +### Attributes + + +#### Attribute `jvm.memory.type` + +The type of memory. + + +- Requirement Level: Recommended + +- Type: Enum [heap, non_heap] +- Examples: [ + "heap", + "non_heap", +] + +- Stability: Stable + + +#### Attribute `jvm.memory.pool.name` + +Name of the memory pool. + + +Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). + +- Requirement Level: Recommended + +- Type: string +- Examples: [ + "G1 Old Gen", + "G1 Eden space", + "G1 Survivor Space", +] + +- Stability: Stable + + + +## Metric `jvm.memory.used_after_last_gc` + +Instrument: updowncounter +Unit: By +Stability: stable + +### Attributes + + +#### Attribute `jvm.memory.type` + +The type of memory. + + +- Requirement Level: Recommended + +- Type: Enum [heap, non_heap] +- Examples: [ + "heap", + "non_heap", +] + +- Stability: Stable + + +#### Attribute `jvm.memory.pool.name` + +Name of the memory pool. + + +Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). + +- Requirement Level: Recommended + +- Type: string +- Examples: [ + "G1 Old Gen", + "G1 Eden space", + "G1 Survivor Space", +] + +- Stability: Stable + + + +## Metric `jvm.gc.duration` + +Instrument: histogram +Unit: s +Stability: stable + +### Attributes + + +#### Attribute `jvm.gc.name` + +Name of the garbage collector. + + +Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). + +- Requirement Level: Recommended + +- Type: string +- Examples: [ + "G1 Young Generation", + "G1 Old Generation", +] + +- Stability: Stable + + +#### Attribute `jvm.gc.action` + +Name of the garbage collector action. + + +Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). + +- Requirement Level: Recommended + +- Type: string +- Examples: [ + "end of minor GC", + "end of major GC", +] + +- Stability: Stable + + + +## Metric `jvm.thread.count` + +Instrument: updowncounter +Unit: {thread} +Stability: stable + +### Attributes + + +#### Attribute `jvm.thread.daemon` + +Whether the thread is daemon or not. + + +- Requirement Level: Recommended + +- Type: boolean + +- Stability: Stable + + +#### Attribute `jvm.thread.state` + +State of the thread. + + +- Requirement Level: Recommended + +- Type: Enum [new, runnable, blocked, waiting, timed_waiting, terminated] +- Examples: [ + "runnable", + "blocked", +] + +- Stability: Stable + + + +## Metric `jvm.class.loaded` + +Instrument: counter +Unit: {class} +Stability: stable + +### Attributes + + + +## Metric `jvm.class.unloaded` + +Instrument: counter +Unit: {class} +Stability: stable + +### Attributes + + + +## Metric `jvm.class.count` + +Instrument: updowncounter +Unit: {class} +Stability: stable + +### Attributes + + + +## Metric `jvm.cpu.count` + +Instrument: updowncounter +Unit: {cpu} +Stability: stable + +### Attributes + + + +## Metric `jvm.cpu.time` + +Instrument: counter +Unit: s +Stability: stable + +### Attributes + + + +## Metric `jvm.cpu.recent_utilization` + +Instrument: gauge +Unit: 1 +Stability: stable + +### Attributes + + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_count.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_count.md deleted file mode 100644 index 052e9335..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_count.md +++ /dev/null @@ -1,16 +0,0 @@ -## Group `metric.jvm.class.count` (metric) - -### Brief - -Number of classes currently loaded. - - - -Prefix: -Metric: jvm.class.count -Instrument: updowncounter -Unit: {class} -Stability: Stable - -### Attributes - diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_loaded.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_loaded.md deleted file mode 100644 index d82ce127..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_loaded.md +++ /dev/null @@ -1,16 +0,0 @@ -## Group `metric.jvm.class.loaded` (metric) - -### Brief - -Number of classes loaded since JVM start. - - - -Prefix: -Metric: jvm.class.loaded -Instrument: counter -Unit: {class} -Stability: Stable - -### Attributes - diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_unloaded.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_unloaded.md deleted file mode 100644 index 8c5cb1c8..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_class_unloaded.md +++ /dev/null @@ -1,16 +0,0 @@ -## Group `metric.jvm.class.unloaded` (metric) - -### Brief - -Number of classes unloaded since JVM start. - - - -Prefix: -Metric: jvm.class.unloaded -Instrument: counter -Unit: {class} -Stability: Stable - -### Attributes - diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_count.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_count.md deleted file mode 100644 index a4f5168a..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_count.md +++ /dev/null @@ -1,16 +0,0 @@ -## Group `metric.jvm.cpu.count` (metric) - -### Brief - -Number of processors available to the Java virtual machine. - - - -Prefix: -Metric: jvm.cpu.count -Instrument: updowncounter -Unit: {cpu} -Stability: Stable - -### Attributes - diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_recent_utilization.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_recent_utilization.md deleted file mode 100644 index 1b01d182..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_recent_utilization.md +++ /dev/null @@ -1,16 +0,0 @@ -## Group `metric.jvm.cpu.recent_utilization` (metric) - -### Brief - -Recent CPU utilization for the process as reported by the JVM. - -The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()). - -Prefix: -Metric: jvm.cpu.recent_utilization -Instrument: gauge -Unit: 1 -Stability: Stable - -### Attributes - diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_time.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_time.md deleted file mode 100644 index 92e917a8..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_cpu_time.md +++ /dev/null @@ -1,16 +0,0 @@ -## Group `metric.jvm.cpu.time` (metric) - -### Brief - -CPU time used by the process as reported by the JVM. - - - -Prefix: -Metric: jvm.cpu.time -Instrument: counter -Unit: s -Stability: Stable - -### Attributes - diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_gc_duration.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_gc_duration.md deleted file mode 100644 index 42faa7c2..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_gc_duration.md +++ /dev/null @@ -1,53 +0,0 @@ -## Group `metric.jvm.gc.duration` (metric) - -### Brief - -Duration of JVM garbage collection actions. - - - -Prefix: jvm.gc -Metric: jvm.gc.duration -Instrument: histogram -Unit: s -Stability: Stable - -### Attributes - - -#### Attribute `jvm.gc.name` - -Name of the garbage collector. - - -Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Young Generation", - "G1 Old Generation", -] - -- Stability: Stable - - -#### Attribute `jvm.gc.action` - -Name of the garbage collector action. - - -Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "end of minor GC", - "end of major GC", -] - -- Stability: Stable - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_committed.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_committed.md deleted file mode 100644 index 1708ad6d..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_committed.md +++ /dev/null @@ -1,52 +0,0 @@ -## Group `metric.jvm.memory.committed` (metric) - -### Brief - -Measure of memory committed. - - - -Prefix: -Metric: jvm.memory.committed -Instrument: updowncounter -Unit: By -Stability: Stable - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_limit.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_limit.md deleted file mode 100644 index d2dca2c7..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_limit.md +++ /dev/null @@ -1,52 +0,0 @@ -## Group `metric.jvm.memory.limit` (metric) - -### Brief - -Measure of max obtainable memory. - - - -Prefix: -Metric: jvm.memory.limit -Instrument: updowncounter -Unit: By -Stability: Stable - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used.md deleted file mode 100644 index 66ec1681..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used.md +++ /dev/null @@ -1,52 +0,0 @@ -## Group `metric.jvm.memory.used` (metric) - -### Brief - -Measure of memory used. - - - -Prefix: -Metric: jvm.memory.used -Instrument: updowncounter -Unit: By -Stability: Stable - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used_after_last_gc.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used_after_last_gc.md deleted file mode 100644 index 6f71ae44..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_memory_used_after_last_gc.md +++ /dev/null @@ -1,52 +0,0 @@ -## Group `metric.jvm.memory.used_after_last_gc` (metric) - -### Brief - -Measure of memory used, as measured after the most recent garbage collection event on this pool. - - - -Prefix: -Metric: jvm.memory.used_after_last_gc -Instrument: updowncounter -Unit: By -Stability: Stable - -### Attributes - - -#### Attribute `jvm.memory.type` - -The type of memory. - - -- Requirement Level: Recommended - -- Type: Enum [heap, non_heap] -- Examples: [ - "heap", - "non_heap", -] - -- Stability: Stable - - -#### Attribute `jvm.memory.pool.name` - -Name of the memory pool. - - -Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - -- Requirement Level: Recommended - -- Type: string -- Examples: [ - "G1 Old Gen", - "G1 Eden space", - "G1 Survivor Space", -] - -- Stability: Stable - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/metric/metric_jvm_thread_count.md b/crates/weaver_forge/expected_output/test/metric/metric_jvm_thread_count.md deleted file mode 100644 index 03ec08d1..00000000 --- a/crates/weaver_forge/expected_output/test/metric/metric_jvm_thread_count.md +++ /dev/null @@ -1,45 +0,0 @@ -## Group `metric.jvm.thread.count` (metric) - -### Brief - -Number of executing platform threads. - - - -Prefix: -Metric: jvm.thread.count -Instrument: updowncounter -Unit: {thread} -Stability: Stable - -### Attributes - - -#### Attribute `jvm.thread.daemon` - -Whether the thread is daemon or not. - - -- Requirement Level: Recommended - -- Type: boolean - -- Stability: Stable - - -#### Attribute `jvm.thread.state` - -State of the thread. - - -- Requirement Level: Recommended - -- Type: Enum [new, runnable, blocked, waiting, timed_waiting, terminated] -- Examples: [ - "runnable", - "blocked", -] - -- Stability: Stable - - \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/metrics.md b/crates/weaver_forge/expected_output/test/metrics.md index f255e743..1850ee4f 100644 --- a/crates/weaver_forge/expected_output/test/metrics.md +++ b/crates/weaver_forge/expected_output/test/metrics.md @@ -1,19 +1,12 @@ -# Semantic Convention Metric Groups +# Metric Namespace `jvm` -## Group `metric.jvm.memory.used` (metric) -### Brief +## Metric `jvm.memory.used` -Measure of memory used. - - - -Prefix: -Metric: jvm.memory.used Instrument: updowncounter Unit: By -Stability: Stable +Stability: stable ### Attributes @@ -54,19 +47,11 @@ Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs. -## Group `metric.jvm.memory.committed` (metric) - -### Brief - -Measure of memory committed. - +## Metric `jvm.memory.committed` - -Prefix: -Metric: jvm.memory.committed Instrument: updowncounter Unit: By -Stability: Stable +Stability: stable ### Attributes @@ -107,19 +92,11 @@ Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs. -## Group `metric.jvm.memory.limit` (metric) - -### Brief - -Measure of max obtainable memory. +## Metric `jvm.memory.limit` - - -Prefix: -Metric: jvm.memory.limit Instrument: updowncounter Unit: By -Stability: Stable +Stability: stable ### Attributes @@ -160,19 +137,11 @@ Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs. -## Group `metric.jvm.memory.used_after_last_gc` (metric) - -### Brief +## Metric `jvm.memory.used_after_last_gc` -Measure of memory used, as measured after the most recent garbage collection event on this pool. - - - -Prefix: -Metric: jvm.memory.used_after_last_gc Instrument: updowncounter Unit: By -Stability: Stable +Stability: stable ### Attributes @@ -213,19 +182,11 @@ Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs. -## Group `metric.jvm.gc.duration` (metric) - -### Brief - -Duration of JVM garbage collection actions. - +## Metric `jvm.gc.duration` - -Prefix: jvm.gc -Metric: jvm.gc.duration Instrument: histogram Unit: s -Stability: Stable +Stability: stable ### Attributes @@ -267,19 +228,11 @@ Garbage collector action is generally obtained via [GarbageCollectionNotificatio -## Group `metric.jvm.thread.count` (metric) - -### Brief - -Number of executing platform threads. +## Metric `jvm.thread.count` - - -Prefix: -Metric: jvm.thread.count Instrument: updowncounter Unit: {thread} -Stability: Stable +Stability: stable ### Attributes @@ -313,111 +266,65 @@ State of the thread. -## Group `metric.jvm.class.loaded` (metric) - -### Brief +## Metric `jvm.class.loaded` -Number of classes loaded since JVM start. - - - -Prefix: -Metric: jvm.class.loaded Instrument: counter Unit: {class} -Stability: Stable +Stability: stable ### Attributes -## Group `metric.jvm.class.unloaded` (metric) - -### Brief - -Number of classes unloaded since JVM start. - +## Metric `jvm.class.unloaded` - -Prefix: -Metric: jvm.class.unloaded Instrument: counter Unit: {class} -Stability: Stable +Stability: stable ### Attributes -## Group `metric.jvm.class.count` (metric) - -### Brief - -Number of classes currently loaded. +## Metric `jvm.class.count` - - -Prefix: -Metric: jvm.class.count Instrument: updowncounter Unit: {class} -Stability: Stable +Stability: stable ### Attributes -## Group `metric.jvm.cpu.count` (metric) - -### Brief +## Metric `jvm.cpu.count` -Number of processors available to the Java virtual machine. - - - -Prefix: -Metric: jvm.cpu.count Instrument: updowncounter Unit: {cpu} -Stability: Stable +Stability: stable ### Attributes -## Group `metric.jvm.cpu.time` (metric) - -### Brief - -CPU time used by the process as reported by the JVM. - +## Metric `jvm.cpu.time` - -Prefix: -Metric: jvm.cpu.time Instrument: counter Unit: s -Stability: Stable +Stability: stable ### Attributes -## Group `metric.jvm.cpu.recent_utilization` (metric) - -### Brief - -Recent CPU utilization for the process as reported by the JVM. +## Metric `jvm.cpu.recent_utilization` -The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()). - -Prefix: -Metric: jvm.cpu.recent_utilization Instrument: gauge Unit: 1 -Stability: Stable +Stability: stable ### Attributes + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/resource/otel_library.md b/crates/weaver_forge/expected_output/test/resource/library.md similarity index 70% rename from crates/weaver_forge/expected_output/test/resource/otel_library.md rename to crates/weaver_forge/expected_output/test/resource/library.md index cc192999..4d7dbc05 100644 --- a/crates/weaver_forge/expected_output/test/resource/otel_library.md +++ b/crates/weaver_forge/expected_output/test/resource/library.md @@ -1,10 +1,12 @@ -## Group `otel.library` (resource) +## Namespace Resource `library` -### Brief -Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. -prefix: otel.library +## Resource `otel.library` + +Note: +Brief: Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. + ### Attributes @@ -36,4 +38,5 @@ prefix: otel.library ] - Deprecated: use the `otel.scope.version` attribute. + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/resource/otel_scope.md b/crates/weaver_forge/expected_output/test/resource/scope.md similarity index 76% rename from crates/weaver_forge/expected_output/test/resource/otel_scope.md rename to crates/weaver_forge/expected_output/test/resource/scope.md index 9fcb8e68..efaa54bc 100644 --- a/crates/weaver_forge/expected_output/test/resource/otel_scope.md +++ b/crates/weaver_forge/expected_output/test/resource/scope.md @@ -1,10 +1,11 @@ -## Group `otel.scope` (resource) +## Namespace Resource `scope` -### Brief -Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. -prefix: otel.scope +## Resource `otel.scope` + +Note: +Brief: Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. ### Attributes @@ -38,4 +39,5 @@ The version of the instrumentation scope - (`InstrumentationScope.Version` in OT - Stability: Stable + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/resources.md b/crates/weaver_forge/expected_output/test/resources.md index 1554f001..bb21a7f9 100644 --- a/crates/weaver_forge/expected_output/test/resources.md +++ b/crates/weaver_forge/expected_output/test/resources.md @@ -1,20 +1,22 @@ # Semantic Convention Resource Groups -## Group `otel.scope` (resource) +## Namespace Resource `library` -### Brief -Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. -prefix: otel.scope +## Resource `otel.library` + +Note: +Brief: Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. + ### Attributes -#### Attribute `otel.scope.name` +#### Attribute `otel.library.name` + -The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). - Requirement Level: Recommended @@ -23,13 +25,12 @@ The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). - Examples: [ "io.opentelemetry.contrib.mongodb", ] - -- Stability: Stable +- Deprecated: use the `otel.scope.name` attribute. -#### Attribute `otel.scope.version` +#### Attribute `otel.library.version` + -The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - Requirement Level: Recommended @@ -38,25 +39,26 @@ The version of the instrumentation scope - (`InstrumentationScope.Version` in OT - Examples: [ "1.0.0", ] - -- Stability: Stable +- Deprecated: use the `otel.scope.version` attribute. -## Group `otel.library` (resource) +- +## Namespace Resource `scope` -### Brief -Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. -prefix: otel.library +## Resource `otel.scope` -### Attributes +Note: +Brief: Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. +### Attributes -#### Attribute `otel.library.name` +#### Attribute `otel.scope.name` +The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). - Requirement Level: Recommended @@ -65,12 +67,13 @@ prefix: otel.library - Examples: [ "io.opentelemetry.contrib.mongodb", ] -- Deprecated: use the `otel.scope.name` attribute. +- Stability: Stable -#### Attribute `otel.library.version` - + +#### Attribute `otel.scope.version` +The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - Requirement Level: Recommended @@ -79,7 +82,9 @@ prefix: otel.library - Examples: [ "1.0.0", ] -- Deprecated: use the `otel.scope.version` attribute. + +- Stability: Stable + - \ No newline at end of file +- \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_cassandra.md b/crates/weaver_forge/expected_output/test/span/cassandra.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_cassandra.md rename to crates/weaver_forge/expected_output/test/span/cassandra.md index 00ca15eb..54f68f73 100644 --- a/crates/weaver_forge/expected_output/test/span/db_cassandra.md +++ b/crates/weaver_forge/expected_output/test/span/cassandra.md @@ -1,10 +1,9 @@ -## Group `db.cassandra` (span) +## Namespace Span `cassandra` -### Brief - -Call-level attributes for Cassandra +## Span `db.cassandra` +Call-level attributes for Cassandra Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.statement` The database statement being executed. @@ -88,7 +87,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -108,7 +107,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -130,7 +129,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -151,7 +150,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -169,7 +168,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -186,7 +185,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -211,7 +210,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -231,7 +230,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -245,7 +244,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.cassandra.consistency_level` The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). @@ -258,7 +257,7 @@ The consistency level of the query. Based on consistency values from [CQL](https - Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - + #### Attribute `db.cassandra.coordinator.dc` The data center of the coordinating node for a query. @@ -272,7 +271,7 @@ The data center of the coordinating node for a query. - Type: string - Examples: us-west-2 - + #### Attribute `db.cassandra.coordinator.id` The ID of the coordinating node for a query. @@ -286,7 +285,7 @@ The ID of the coordinating node for a query. - Type: string - Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - + #### Attribute `db.cassandra.idempotence` Whether or not the query is idempotent. @@ -299,7 +298,7 @@ Whether or not the query is idempotent. - Type: boolean - + #### Attribute `db.cassandra.page_size` The fetch size used for paging, i.e. how many rows will be returned at once. @@ -315,7 +314,7 @@ The fetch size used for paging, i.e. how many rows will be returned at once. 5000, ] - + #### Attribute `db.cassandra.speculative_execution_count` The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. @@ -332,7 +331,7 @@ The number of times a query was speculatively executed. Not set or `0` if the qu 2, ] - + #### Attribute `db.cassandra.table` The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). @@ -347,7 +346,7 @@ This mirrors the db.sql.table attribute but references cassandra rather than sql - Type: string - Examples: mytable - + #### Attribute `db.name` The keyspace name in Cassandra. @@ -365,4 +364,5 @@ For Cassandra the `db.name` should be set to the Cassandra keyspace name. "mykeyspace", ] - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_cosmosdb.md b/crates/weaver_forge/expected_output/test/span/cosmosdb.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_cosmosdb.md rename to crates/weaver_forge/expected_output/test/span/cosmosdb.md index 4cb0a0ea..76fde666 100644 --- a/crates/weaver_forge/expected_output/test/span/db_cosmosdb.md +++ b/crates/weaver_forge/expected_output/test/span/cosmosdb.md @@ -1,10 +1,9 @@ -## Group `db.cosmosdb` (span) +## Namespace Span `cosmosdb` -### Brief - -Call-level attributes for Cosmos DB. +## Span `db.cosmosdb` +Call-level attributes for Cosmos DB. Prefix: db.cosmosdb Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -107,7 +106,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -127,7 +126,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -149,7 +148,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -170,7 +169,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -188,7 +187,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -205,7 +204,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -230,7 +229,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -250,7 +249,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -264,7 +263,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.cosmosdb.client_id` Unique Cosmos client instance id. @@ -277,7 +276,7 @@ Unique Cosmos client instance id. - Type: string - Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - + #### Attribute `db.cosmosdb.connection_mode` Cosmos client connection mode. @@ -289,7 +288,7 @@ Cosmos client connection mode. - Type: Enum [gateway, direct] - + #### Attribute `db.cosmosdb.container` Cosmos DB container name. @@ -302,7 +301,7 @@ Cosmos DB container name. - Type: string - Examples: anystring - + #### Attribute `db.cosmosdb.operation_type` CosmosDB Operation Type. @@ -314,7 +313,7 @@ CosmosDB Operation Type. - Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - + #### Attribute `db.cosmosdb.request_charge` RU consumed for that operation @@ -330,7 +329,7 @@ RU consumed for that operation 1.0, ] - + #### Attribute `db.cosmosdb.request_content_length` Request payload size in bytes @@ -342,7 +341,7 @@ Request payload size in bytes - Type: int - + #### Attribute `db.cosmosdb.status_code` Cosmos DB status code. @@ -358,7 +357,7 @@ Cosmos DB status code. 201, ] - + #### Attribute `db.cosmosdb.sub_status_code` Cosmos DB sub status code. @@ -374,7 +373,7 @@ Cosmos DB sub status code. 1002, ] - + #### Attribute `user_agent.original` Full user-agent string is generated by Cosmos DB SDK @@ -395,4 +394,5 @@ The user-agent value is generated by SDK which is a combination of
`sdk_vers - Stability: Stable - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_couchdb.md b/crates/weaver_forge/expected_output/test/span/couchdb.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_couchdb.md rename to crates/weaver_forge/expected_output/test/span/couchdb.md index 7441755d..7e0aab60 100644 --- a/crates/weaver_forge/expected_output/test/span/db_couchdb.md +++ b/crates/weaver_forge/expected_output/test/span/couchdb.md @@ -1,10 +1,9 @@ -## Group `db.couchdb` (span) +## Namespace Span `couchdb` -### Brief - -Call-level attributes for CouchDB +## Span `db.couchdb` +Call-level attributes for CouchDB Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -107,7 +106,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `server.address` Name of the database host. @@ -129,7 +128,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -150,7 +149,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -168,7 +167,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -185,7 +184,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -210,7 +209,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -230,7 +229,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -244,7 +243,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.operation` The HTTP method + the target REST route. @@ -262,4 +261,5 @@ In **CouchDB**, `db.operation` should be set to the HTTP method + the target RES "GET /{db}/{docid}", ] - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_elasticsearch.md b/crates/weaver_forge/expected_output/test/span/elasticsearch.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_elasticsearch.md rename to crates/weaver_forge/expected_output/test/span/elasticsearch.md index f22e18bc..656aa442 100644 --- a/crates/weaver_forge/expected_output/test/span/db_elasticsearch.md +++ b/crates/weaver_forge/expected_output/test/span/elasticsearch.md @@ -1,10 +1,9 @@ -## Group `db.elasticsearch` (span) +## Namespace Span `elasticsearch` -### Brief - -Call-level attributes for Elasticsearch +## Span `db.elasticsearch` +Call-level attributes for Elasticsearch Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -108,7 +107,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -125,7 +124,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -150,7 +149,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -170,7 +169,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -184,7 +183,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.elasticsearch.cluster.name` Represents the identifier of an Elasticsearch cluster. @@ -200,7 +199,7 @@ Represents the identifier of an Elasticsearch cluster. "e9106fc68e3044f0b1475b04bf4ffd5f", ] - + #### Attribute `db.elasticsearch.node.name` Represents the human-readable identifier of the node/instance to which a request was routed. @@ -216,7 +215,7 @@ Represents the human-readable identifier of the node/instance to which a request "instance-0000000001", ] - + #### Attribute `db.elasticsearch.path_parts` A dynamic value in the url path. @@ -235,7 +234,7 @@ Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in s "db.elasticsearch.path_parts.doc_id=123", ] - + #### Attribute `db.operation` The endpoint identifier for the request. @@ -254,7 +253,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "cat.aliases", ] - + #### Attribute `db.statement` The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. @@ -269,7 +268,7 @@ The request body for a [search-type query](https://www.elastic.co/guide/en/elast "\"{\\\"query\\\":{\\\"term\\\":{\\\"user.id\\\":\\\"kimchy\\\"}}}\"", ] - + #### Attribute `http.request.method` HTTP request method. @@ -303,7 +302,7 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original - Stability: Stable - + #### Attribute `server.address` Name of the database host. @@ -325,7 +324,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -346,7 +345,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `url.full` Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) @@ -367,4 +366,5 @@ For network calls, URL usually has `scheme://host[:port][path][?query][#fragment - Stability: Stable - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_hbase.md b/crates/weaver_forge/expected_output/test/span/hbase.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_hbase.md rename to crates/weaver_forge/expected_output/test/span/hbase.md index a841c53b..e1b582e5 100644 --- a/crates/weaver_forge/expected_output/test/span/db_hbase.md +++ b/crates/weaver_forge/expected_output/test/span/hbase.md @@ -1,10 +1,9 @@ -## Group `db.hbase` (span) +## Namespace Span `hbase` -### Brief - -Call-level attributes for HBase +## Span `db.hbase` +Call-level attributes for HBase Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.statement` The database statement being executed. @@ -88,7 +87,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -108,7 +107,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -130,7 +129,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -151,7 +150,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -169,7 +168,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -186,7 +185,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -211,7 +210,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -231,7 +230,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -245,7 +244,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.name` The HBase namespace. @@ -263,4 +262,5 @@ For HBase the `db.name` should be set to the HBase namespace. "mynamespace", ] - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_mongodb.md b/crates/weaver_forge/expected_output/test/span/mongodb.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_mongodb.md rename to crates/weaver_forge/expected_output/test/span/mongodb.md index 57458795..081bdca7 100644 --- a/crates/weaver_forge/expected_output/test/span/db_mongodb.md +++ b/crates/weaver_forge/expected_output/test/span/mongodb.md @@ -1,10 +1,9 @@ -## Group `db.mongodb` (span) +## Namespace Span `mongodb` -### Brief - -Call-level attributes for MongoDB +## Span `db.mongodb` +Call-level attributes for MongoDB Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -107,7 +106,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -127,7 +126,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -149,7 +148,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -170,7 +169,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -188,7 +187,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -205,7 +204,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -230,7 +229,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -250,7 +249,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -264,7 +263,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.mongodb.collection` The MongoDB collection being accessed within the database stated in `db.name`. @@ -281,4 +280,5 @@ The MongoDB collection being accessed within the database stated in `db.name`. "products", ] - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_mssql.md b/crates/weaver_forge/expected_output/test/span/mssql.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_mssql.md rename to crates/weaver_forge/expected_output/test/span/mssql.md index 8ecd58f9..38723ea0 100644 --- a/crates/weaver_forge/expected_output/test/span/db_mssql.md +++ b/crates/weaver_forge/expected_output/test/span/mssql.md @@ -1,10 +1,9 @@ -## Group `db.mssql` (span) +## Namespace Span `mssql` -### Brief - -Connection-level attributes for Microsoft SQL Server +## Span `db.mssql` +Connection-level attributes for Microsoft SQL Server Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -107,7 +106,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -127,7 +126,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -149,7 +148,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -170,7 +169,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -188,7 +187,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -205,7 +204,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -230,7 +229,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -250,7 +249,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -264,7 +263,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.mssql.instance_name` The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. @@ -280,4 +279,5 @@ If setting a `db.mssql.instance_name`, `server.port` is no longer required (but - Type: string - Examples: MSSQLSERVER - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db.md b/crates/weaver_forge/expected_output/test/span/other.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db.md rename to crates/weaver_forge/expected_output/test/span/other.md index 8b6ec00a..521fdc48 100644 --- a/crates/weaver_forge/expected_output/test/span/db.md +++ b/crates/weaver_forge/expected_output/test/span/other.md @@ -1,10 +1,9 @@ -## Group `db` (span) +## Namespace Span `other` -### Brief - -This document defines the attributes used to perform database client calls. +## Span `db` +This document defines the attributes used to perform database client calls. Prefix: Kind: client @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -107,7 +106,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -127,7 +126,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -149,7 +148,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -170,7 +169,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -188,7 +187,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -205,7 +204,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -230,7 +229,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -250,7 +249,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -264,4 +263,5 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_redis.md b/crates/weaver_forge/expected_output/test/span/redis.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_redis.md rename to crates/weaver_forge/expected_output/test/span/redis.md index f2b3c78d..dcbe2ab8 100644 --- a/crates/weaver_forge/expected_output/test/span/db_redis.md +++ b/crates/weaver_forge/expected_output/test/span/redis.md @@ -1,10 +1,9 @@ -## Group `db.redis` (span) +## Namespace Span `redis` -### Brief - -Call-level attributes for Redis +## Span `db.redis` +Call-level attributes for Redis Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -110,7 +109,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -132,7 +131,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -153,7 +152,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -171,7 +170,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -188,7 +187,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -213,7 +212,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -233,7 +232,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -247,7 +246,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.redis.database_index` The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. @@ -265,7 +264,7 @@ The index of the database being accessed as used in the [`SELECT` command](https 15, ] - + #### Attribute `db.statement` The full syntax of the Redis CLI command. @@ -283,4 +282,5 @@ For **Redis**, the value provided for `db.statement` SHOULD correspond to the sy "HMSET myhash field1 'Hello' field2 'World'", ] - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_sql.md b/crates/weaver_forge/expected_output/test/span/sql.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_sql.md rename to crates/weaver_forge/expected_output/test/span/sql.md index a4572016..14d3619a 100644 --- a/crates/weaver_forge/expected_output/test/span/db_sql.md +++ b/crates/weaver_forge/expected_output/test/span/sql.md @@ -1,10 +1,9 @@ -## Group `db.sql` (span) +## Namespace Span `sql` -### Brief - -Call-level attributes for SQL databases +## Span `db.sql` +Call-level attributes for SQL databases Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -107,7 +106,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -127,7 +126,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -149,7 +148,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -170,7 +169,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -188,7 +187,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -205,7 +204,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -230,7 +229,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -250,7 +249,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -264,7 +263,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.sql.table` The name of the primary table that the operation is acting upon, including the database name (if applicable). @@ -282,4 +281,5 @@ It is not recommended to attempt any client-side parsing of `db.statement` just "customers", ] - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/span/db_tech.md b/crates/weaver_forge/expected_output/test/span/tech.md similarity index 98% rename from crates/weaver_forge/expected_output/test/span/db_tech.md rename to crates/weaver_forge/expected_output/test/span/tech.md index fb45d1df..54ec4d72 100644 --- a/crates/weaver_forge/expected_output/test/span/db_tech.md +++ b/crates/weaver_forge/expected_output/test/span/tech.md @@ -1,10 +1,9 @@ -## Group `db.tech` (span) +## Namespace Span `tech` -### Brief - -Semantic convention group for specific technologies +## Span `db.tech` +Semantic convention group for specific technologies Prefix: Kind: none @@ -23,7 +22,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -37,7 +36,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -54,7 +53,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -71,7 +70,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -90,7 +89,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -107,7 +106,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -127,7 +126,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -149,7 +148,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -170,7 +169,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -188,7 +187,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -205,7 +204,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -230,7 +229,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -250,7 +249,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -264,7 +263,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.cassandra.consistency_level` The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). @@ -277,7 +276,7 @@ The consistency level of the query. Based on consistency values from [CQL](https - Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - + #### Attribute `db.cassandra.coordinator.dc` The data center of the coordinating node for a query. @@ -291,7 +290,7 @@ The data center of the coordinating node for a query. - Type: string - Examples: us-west-2 - + #### Attribute `db.cassandra.coordinator.id` The ID of the coordinating node for a query. @@ -305,7 +304,7 @@ The ID of the coordinating node for a query. - Type: string - Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - + #### Attribute `db.cassandra.idempotence` Whether or not the query is idempotent. @@ -318,7 +317,7 @@ Whether or not the query is idempotent. - Type: boolean - + #### Attribute `db.cassandra.page_size` The fetch size used for paging, i.e. how many rows will be returned at once. @@ -334,7 +333,7 @@ The fetch size used for paging, i.e. how many rows will be returned at once. 5000, ] - + #### Attribute `db.cassandra.speculative_execution_count` The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. @@ -351,7 +350,7 @@ The number of times a query was speculatively executed. Not set or `0` if the qu 2, ] - + #### Attribute `db.cassandra.table` The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). @@ -366,7 +365,7 @@ This mirrors the db.sql.table attribute but references cassandra rather than sql - Type: string - Examples: mytable - + #### Attribute `db.name` The keyspace name in Cassandra. @@ -384,7 +383,7 @@ For Cassandra the `db.name` should be set to the Cassandra keyspace name. "mykeyspace", ] - + #### Attribute `db.redis.database_index` The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. @@ -402,7 +401,7 @@ The index of the database being accessed as used in the [`SELECT` command](https 15, ] - + #### Attribute `db.statement` The full syntax of the Redis CLI command. @@ -420,7 +419,7 @@ For **Redis**, the value provided for `db.statement` SHOULD correspond to the sy "HMSET myhash field1 'Hello' field2 'World'", ] - + #### Attribute `db.mongodb.collection` The MongoDB collection being accessed within the database stated in `db.name`. @@ -437,7 +436,7 @@ The MongoDB collection being accessed within the database stated in `db.name`. "products", ] - + #### Attribute `db.sql.table` The name of the primary table that the operation is acting upon, including the database name (if applicable). @@ -455,7 +454,7 @@ It is not recommended to attempt any client-side parsing of `db.statement` just "customers", ] - + #### Attribute `db.cosmosdb.client_id` Unique Cosmos client instance id. @@ -468,7 +467,7 @@ Unique Cosmos client instance id. - Type: string - Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - + #### Attribute `db.cosmosdb.connection_mode` Cosmos client connection mode. @@ -480,7 +479,7 @@ Cosmos client connection mode. - Type: Enum [gateway, direct] - + #### Attribute `db.cosmosdb.container` Cosmos DB container name. @@ -493,7 +492,7 @@ Cosmos DB container name. - Type: string - Examples: anystring - + #### Attribute `db.cosmosdb.operation_type` CosmosDB Operation Type. @@ -505,7 +504,7 @@ CosmosDB Operation Type. - Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - + #### Attribute `db.cosmosdb.request_charge` RU consumed for that operation @@ -521,7 +520,7 @@ RU consumed for that operation 1.0, ] - + #### Attribute `db.cosmosdb.request_content_length` Request payload size in bytes @@ -533,7 +532,7 @@ Request payload size in bytes - Type: int - + #### Attribute `db.cosmosdb.status_code` Cosmos DB status code. @@ -549,7 +548,7 @@ Cosmos DB status code. 201, ] - + #### Attribute `db.cosmosdb.sub_status_code` Cosmos DB sub status code. @@ -565,7 +564,7 @@ Cosmos DB sub status code. 1002, ] - + #### Attribute `user_agent.original` Full user-agent string is generated by Cosmos DB SDK @@ -586,4 +585,5 @@ The user-agent value is generated by SDK which is a combination of
`sdk_vers - Stability: Stable - \ No newline at end of file + + \ No newline at end of file diff --git a/crates/weaver_forge/expected_output/test/spans.md b/crates/weaver_forge/expected_output/test/spans.md index 38c6cdb2..952c6200 100644 --- a/crates/weaver_forge/expected_output/test/spans.md +++ b/crates/weaver_forge/expected_output/test/spans.md @@ -1,16 +1,15 @@ # Semantic Convention Span Groups -## Group `db` (span) +## Namespace Spans `cassandra` -### Brief - -This document defines the attributes used to perform database client calls. +## Span `db.cassandra` +Call-level attributes for Cassandra Prefix: -Kind: client +Kind: none ### Attributes @@ -26,7 +25,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -40,7 +39,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -57,7 +56,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -74,26 +73,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - -#### Attribute `db.name` - -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - - -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level - -- Type: string -- Examples: [ - "customers", - "main", -] - - #### Attribute `db.statement` The database statement being executed. @@ -110,7 +90,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -130,7 +110,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -152,7 +132,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -173,7 +153,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -191,7 +171,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -208,7 +188,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -233,7 +213,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -253,7 +233,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -267,17 +247,137 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com + +#### Attribute `db.cassandra.consistency_level` + +The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + + + +- Requirement Level: Recommended + +- Tag: call-level-tech-specific-cassandra +- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] -## Group `db.mssql` (span) -### Brief +#### Attribute `db.cassandra.coordinator.dc` -Connection-level attributes for Microsoft SQL Server +The data center of the coordinating node for a query. -Prefix: +- Requirement Level: Recommended + +- Tag: call-level-tech-specific-cassandra + +- Type: string +- Examples: us-west-2 + + +#### Attribute `db.cassandra.coordinator.id` + +The ID of the coordinating node for a query. + + + +- Requirement Level: Recommended + +- Tag: call-level-tech-specific-cassandra + +- Type: string +- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af + + +#### Attribute `db.cassandra.idempotence` + +Whether or not the query is idempotent. + + + +- Requirement Level: Recommended + +- Tag: call-level-tech-specific-cassandra + +- Type: boolean + + +#### Attribute `db.cassandra.page_size` + +The fetch size used for paging, i.e. how many rows will be returned at once. + + + +- Requirement Level: Recommended + +- Tag: call-level-tech-specific-cassandra + +- Type: int +- Examples: [ + 5000, +] + + +#### Attribute `db.cassandra.speculative_execution_count` + +The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + + + +- Requirement Level: Recommended + +- Tag: call-level-tech-specific-cassandra + +- Type: int +- Examples: [ + 0, + 2, +] + + +#### Attribute `db.cassandra.table` + +The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). + + +This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + +- Requirement Level: Recommended + +- Tag: call-level-tech-specific-cassandra + +- Type: string +- Examples: mytable + + +#### Attribute `db.name` + +The keyspace name in Cassandra. + + + +For Cassandra the `db.name` should be set to the Cassandra keyspace name. + +- Requirement Level: Conditionally Required - If applicable. + +- Tag: call-level-tech-specific-cassandra + +- Type: string +- Examples: [ + "mykeyspace", +] + + + + +## Namespace Spans `cosmosdb` + + +## Span `db.cosmosdb` + +Call-level attributes for Cosmos DB. + +Prefix: db.cosmosdb Kind: none ### Attributes @@ -294,7 +394,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -308,7 +408,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -325,7 +425,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -342,7 +442,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -361,7 +461,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -378,7 +478,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -398,7 +498,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -420,7 +520,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -441,7 +541,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -459,7 +559,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -476,7 +576,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -501,7 +601,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -521,7 +621,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -535,400 +635,146 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - -#### Attribute `db.mssql.instance_name` - -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. +#### Attribute `db.cosmosdb.client_id` +Unique Cosmos client instance id. -If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). - Requirement Level: Recommended -- Tag: connection-level-tech-specific +- Tag: call-level-tech-specific - Type: string -- Examples: MSSQLSERVER - - +- Examples: 3ba4827d-4422-483f-b59f-85b74211c11d -## Group `db.cassandra` (span) - -### Brief - -Call-level attributes for Cassandra - +#### Attribute `db.cosmosdb.connection_mode` -Prefix: -Kind: none +Cosmos client connection mode. -### Attributes +- Requirement Level: Conditionally Required - if not `direct` (or pick gw as default) + +- Tag: call-level-tech-specific + +- Type: Enum [gateway, direct] + -#### Attribute `db.system` +#### Attribute `db.cosmosdb.container` -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. +Cosmos DB container name. -- Requirement Level: Required - -- Tag: connection-level +- Requirement Level: Conditionally Required - if available -- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] +- Tag: call-level-tech-specific +- Type: string +- Examples: anystring -#### Attribute `db.connection_string` -The connection string used to connect to the database. It is recommended to remove embedded credentials. +#### Attribute `db.cosmosdb.operation_type` +CosmosDB Operation Type. -- Requirement Level: Recommended - -- Tag: connection-level +- Requirement Level: Conditionally Required - when performing one of the operations in this list -- Type: string -- Examples: Server=(localdb)\v11.0;Integrated Security=true; +- Tag: call-level-tech-specific +- Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] -#### Attribute `db.user` -Username for accessing the database. +#### Attribute `db.cosmosdb.request_charge` +RU consumed for that operation -- Requirement Level: Recommended +- Requirement Level: Conditionally Required - when available -- Tag: connection-level +- Tag: call-level-tech-specific -- Type: string -- Examples: [ - "readonly_user", - "reporting_user", -] - - -#### Attribute `db.jdbc.driver_classname` - -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - - - -- Requirement Level: Recommended - -- Tag: connection-level-tech-specific - -- Type: string -- Examples: [ - "org.postgresql.Driver", - "com.microsoft.sqlserver.jdbc.SQLServerDriver", -] - - -#### Attribute `db.statement` - -The database statement being executed. - - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - -#### Attribute `db.operation` - -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - - - -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - -- Tag: call-level - -- Type: string +- Type: double - Examples: [ - "findAndModify", - "HMSET", - "SELECT", + 46.18, + 1.0, ] - -#### Attribute `server.address` -Name of the database host. +#### Attribute `db.cosmosdb.request_content_length` +Request payload size in bytes -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - - Requirement Level: Recommended -- Tag: connection-level - -- Type: string -- Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `server.port` - -Server port number. - - -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. - -- Tag: connection-level +- Tag: call-level-tech-specific - Type: int -- Examples: [ - 80, - 8080, - 443, -] - -- Stability: Stable - -#### Attribute `network.peer.address` - -Peer address of the network connection - IP address or Unix domain socket name. +#### Attribute `db.cosmosdb.status_code` -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: string -- Examples: [ - "10.1.2.80", - "/tmp/my.sock", -] - -- Stability: Stable - - -#### Attribute `network.peer.port` - -Peer port number of the network connection. +Cosmos DB status code. -- Requirement Level: Optional +- Requirement Level: Conditionally Required - if response was received -- Tag: connection-level +- Tag: call-level-tech-specific - Type: int - Examples: [ - 65123, -] - -- Stability: Stable - - -#### Attribute `network.transport` - -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - - - -The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. - -- Requirement Level: Recommended - -- Tag: connection-level - -- Type: Enum [tcp, udp, pipe, unix] -- Examples: [ - "tcp", - "udp", + 200, + 201, ] -- Stability: Stable - - -#### Attribute `network.type` -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +#### Attribute `db.cosmosdb.sub_status_code` +Cosmos DB sub status code. -The value SHOULD be normalized to lowercase. -- Requirement Level: Recommended +- Requirement Level: Conditionally Required - when response was received and contained sub-code. -- Tag: connection-level +- Tag: call-level-tech-specific -- Type: Enum [ipv4, ipv6] +- Type: int - Examples: [ - "ipv4", - "ipv6", + 1000, + 1002, ] -- Stability: Stable - - -#### Attribute `db.instance.id` -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. - - - -- Requirement Level: Optional - -- Tag: connection-level - -- Type: string -- Examples: mysql-e26b99z.example.com - - -#### Attribute `db.cassandra.consistency_level` - -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - - -#### Attribute `db.cassandra.coordinator.dc` - -The data center of the coordinating node for a query. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: us-west-2 - - -#### Attribute `db.cassandra.coordinator.id` +#### Attribute `user_agent.original` -The ID of the coordinating node for a query. +Full user-agent string is generated by Cosmos DB SDK +The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. + Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). + Default value is "NS". - Requirement Level: Recommended -- Tag: call-level-tech-specific-cassandra +- Tag: call-level-tech-specific - Type: string -- Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - - -#### Attribute `db.cassandra.idempotence` - -Whether or not the query is idempotent. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: boolean - - -#### Attribute `db.cassandra.page_size` - -The fetch size used for paging, i.e. how many rows will be returned at once. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int -- Examples: [ - 5000, -] - - -#### Attribute `db.cassandra.speculative_execution_count` - -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: int - Examples: [ - 0, - 2, + "cosmos-netstandard-sdk/3.23.0\\|3.23.1\\|1\\|X64\\|Linux 5.4.0-1098-azure 104 18\\|.NET Core 3.1.32\\|S\\|", ] +- Stability: Stable -#### Attribute `db.cassandra.table` - -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). - - -This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: mytable - - -#### Attribute `db.name` -The keyspace name in Cassandra. +## Namespace Spans `couchdb` -For Cassandra the `db.name` should be set to the Cassandra keyspace name. - -- Requirement Level: Conditionally Required - If applicable. - -- Tag: call-level-tech-specific-cassandra - -- Type: string -- Examples: [ - "mykeyspace", -] - - - -## Group `db.hbase` (span) - -### Brief - -Call-level attributes for HBase +## Span `db.couchdb` +Call-level attributes for CouchDB Prefix: Kind: none @@ -947,7 +793,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -961,7 +807,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -978,7 +824,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -995,44 +841,43 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - -#### Attribute `db.statement` -The database statement being executed. +#### Attribute `db.name` + +This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). -- Requirement Level: Optional +In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). + +- Requirement Level: Conditionally Required - If applicable. - Tag: call-level - Type: string - Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", + "customers", + "main", ] - -#### Attribute `db.operation` -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. +#### Attribute `db.statement` +The database statement being executed. -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. +- Requirement Level: Optional - Tag: call-level - Type: string - Examples: [ - "findAndModify", - "HMSET", - "SELECT", + "SELECT * FROM wuser_table", + "SET mykey \"WuValue\"", ] - + #### Attribute `server.address` Name of the database host. @@ -1054,7 +899,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -1075,7 +920,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -1093,7 +938,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -1110,7 +955,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -1135,7 +980,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -1155,7 +1000,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -1169,33 +1014,33 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - -#### Attribute `db.name` -The HBase namespace. +#### Attribute `db.operation` +The HTTP method + the target REST route. -For HBase the `db.name` should be set to the HBase namespace. -- Requirement Level: Conditionally Required - If applicable. +In **CouchDB**, `db.operation` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](http://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid). + +- Requirement Level: Conditionally Required - If `db.statement` is not applicable. - Tag: call-level-tech-specific - Type: string - Examples: [ - "mynamespace", + "GET /{db}/{docid}", ] - - -## Group `db.couchdb` (span) -### Brief -Call-level attributes for CouchDB + +## Namespace Spans `elasticsearch` +## Span `db.elasticsearch` + +Call-level attributes for Elasticsearch Prefix: Kind: none @@ -1214,7 +1059,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -1228,7 +1073,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -1245,7 +1090,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -1262,7 +1107,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -1281,187 +1126,292 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] + +#### Attribute `network.peer.address` + +Peer address of the network connection - IP address or Unix domain socket name. + + +- Requirement Level: Recommended + +- Tag: connection-level + +- Type: string +- Examples: [ + "10.1.2.80", + "/tmp/my.sock", +] + +- Stability: Stable -#### Attribute `db.statement` -The database statement being executed. +#### Attribute `network.peer.port` +Peer port number of the network connection. - Requirement Level: Optional -- Tag: call-level +- Tag: connection-level -- Type: string +- Type: int - Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", + 65123, ] +- Stability: Stable -#### Attribute `server.address` -Name of the database host. +#### Attribute `network.transport` +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). -When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + +The value SHOULD be normalized to lowercase. + +Consider always setting the transport when setting a port number, since +a port number is ambiguous without knowing the transport. For example +different processes could be listening on TCP port 12345 and UDP port 12345. - Requirement Level: Recommended - Tag: connection-level -- Type: string +- Type: Enum [tcp, udp, pipe, unix] - Examples: [ - "example.com", - "10.1.2.80", - "/tmp/my.sock", + "tcp", + "udp", ] - Stability: Stable - -#### Attribute `server.port` -Server port number. +#### Attribute `network.type` +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. -When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. +The value SHOULD be normalized to lowercase. + +- Requirement Level: Recommended - Tag: connection-level -- Type: int +- Type: Enum [ipv4, ipv6] - Examples: [ - 80, - 8080, - 443, + "ipv4", + "ipv6", ] - Stability: Stable - -#### Attribute `network.peer.address` -Peer address of the network connection - IP address or Unix domain socket name. +#### Attribute `db.instance.id` +An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. -- Requirement Level: Recommended + + +- Requirement Level: Optional - Tag: connection-level +- Type: string +- Examples: mysql-e26b99z.example.com + + +#### Attribute `db.elasticsearch.cluster.name` + +Represents the identifier of an Elasticsearch cluster. + + + +- Requirement Level: Optional + +- Tag: call-level-tech-specific + - Type: string - Examples: [ - "10.1.2.80", - "/tmp/my.sock", + "e9106fc68e3044f0b1475b04bf4ffd5f", ] -- Stability: Stable + +#### Attribute `db.elasticsearch.node.name` + +Represents the human-readable identifier of the node/instance to which a request was routed. + + + +- Requirement Level: Optional +- Tag: call-level-tech-specific + +- Type: string +- Examples: [ + "instance-0000000001", +] -#### Attribute `network.peer.port` -Peer port number of the network connection. +#### Attribute `db.elasticsearch.path_parts` +A dynamic value in the url path. -- Requirement Level: Optional + + +Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. + +- Requirement Level: Conditionally Required - when the url has dynamic values -- Tag: connection-level +- Tag: call-level-tech-specific -- Type: int +- Type: template[string] - Examples: [ - 65123, + "db.elasticsearch.path_parts.index=test-index", + "db.elasticsearch.path_parts.doc_id=123", ] -- Stability: Stable + +#### Attribute `db.operation` + +The endpoint identifier for the request. + + +When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + +- Requirement Level: Required +- Tag: call-level-tech-specific + +- Type: string +- Examples: [ + "search", + "ml.close_job", + "cat.aliases", +] -#### Attribute `network.transport` -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). +#### Attribute `db.statement` +The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. -The value SHOULD be normalized to lowercase. +- Requirement Level: Optional + +- Tag: call-level-tech-specific + +- Type: string +- Examples: [ + "\"{\\\"query\\\":{\\\"term\\\":{\\\"user.id\\\":\\\"kimchy\\\"}}}\"", +] + -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. +#### Attribute `http.request.method` -- Requirement Level: Recommended +HTTP request method. + + +HTTP request method value SHOULD be "known" to the instrumentation. +By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + +If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. + +If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override +the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named +OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods +(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). + +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. +Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. +Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. + +- Requirement Level: Required -- Tag: connection-level +- Tag: call-level-tech-specific -- Type: Enum [tcp, udp, pipe, unix] +- Type: Enum [CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, _OTHER] - Examples: [ - "tcp", - "udp", + "GET", + "POST", + "HEAD", ] - Stability: Stable - -#### Attribute `network.type` -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +#### Attribute `server.address` + +Name of the database host. -The value SHOULD be normalized to lowercase. + +When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - Requirement Level: Recommended -- Tag: connection-level +- Tag: call-level-tech-specific -- Type: Enum [ipv4, ipv6] +- Type: string - Examples: [ - "ipv4", - "ipv6", + "example.com", + "10.1.2.80", + "/tmp/my.sock", ] - Stability: Stable - -#### Attribute `db.instance.id` -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. +#### Attribute `server.port` + +Server port number. +When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -- Requirement Level: Optional +- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. -- Tag: connection-level +- Tag: call-level-tech-specific -- Type: string -- Examples: mysql-e26b99z.example.com +- Type: int +- Examples: [ + 80, + 8080, + 443, +] +- Stability: Stable -#### Attribute `db.operation` -The HTTP method + the target REST route. +#### Attribute `url.full` +Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) -In **CouchDB**, `db.operation` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](http://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid). +For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. +`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. +`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. -- Requirement Level: Conditionally Required - If `db.statement` is not applicable. +- Requirement Level: Required - Tag: call-level-tech-specific - Type: string - Examples: [ - "GET /{db}/{docid}", + "https://localhost:9200/index/_search?q=user.id:kimchy", ] +- Stability: Stable - -## Group `db.redis` (span) -### Brief -Call-level attributes for Redis +## Namespace Spans `hbase` + + +## Span `db.hbase` +Call-level attributes for HBase Prefix: Kind: none @@ -1480,7 +1430,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -1494,7 +1444,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -1511,7 +1461,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -1528,26 +1478,24 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - -#### Attribute `db.name` -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). +#### Attribute `db.statement` +The database statement being executed. -In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). -- Requirement Level: Conditionally Required - If applicable. +- Requirement Level: Optional - Tag: call-level - Type: string - Examples: [ - "customers", - "main", + "SELECT * FROM wuser_table", + "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -1567,7 +1515,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -1589,7 +1537,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -1610,7 +1558,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -1628,7 +1576,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -1645,7 +1593,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -1670,7 +1618,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -1690,7 +1638,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -1704,51 +1652,33 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - -#### Attribute `db.redis.database_index` - -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - +#### Attribute `db.name` -- Requirement Level: Conditionally Required - If other than the default database (`0`). - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 0, - 1, - 15, -] - - -#### Attribute `db.statement` - -The full syntax of the Redis CLI command. +The HBase namespace. -For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`. +For HBase the `db.name` should be set to the HBase namespace. -- Requirement Level: Optional +- Requirement Level: Conditionally Required - If applicable. - Tag: call-level-tech-specific - Type: string - Examples: [ - "HMSET myhash field1 'Hello' field2 'World'", + "mynamespace", ] - - -## Group `db.mongodb` (span) -### Brief -Call-level attributes for MongoDB +## Namespace Spans `mongodb` + + +## Span `db.mongodb` +Call-level attributes for MongoDB Prefix: Kind: none @@ -1767,7 +1697,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -1781,7 +1711,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -1798,7 +1728,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -1815,7 +1745,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -1834,7 +1764,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -1851,7 +1781,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -1871,7 +1801,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -1893,7 +1823,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -1914,7 +1844,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -1932,7 +1862,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -1949,7 +1879,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -1974,7 +1904,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -1994,7 +1924,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -2008,7 +1938,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.mongodb.collection` The MongoDB collection being accessed within the database stated in `db.name`. @@ -2025,16 +1955,16 @@ The MongoDB collection being accessed within the database stated in `db.name`. "products", ] - - -## Group `db.elasticsearch` (span) -### Brief -Call-level attributes for Elasticsearch +## Namespace Spans `mssql` +## Span `db.mssql` + +Connection-level attributes for Microsoft SQL Server + Prefix: Kind: none @@ -2052,7 +1982,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -2066,7 +1996,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -2083,7 +2013,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -2100,7 +2030,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -2119,7 +2049,87 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] + +#### Attribute `db.statement` + +The database statement being executed. + + + +- Requirement Level: Optional + +- Tag: call-level + +- Type: string +- Examples: [ + "SELECT * FROM wuser_table", + "SET mykey \"WuValue\"", +] + + +#### Attribute `db.operation` + +The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. + + + +When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + +- Requirement Level: Conditionally Required - If `db.statement` is not applicable. + +- Tag: call-level + +- Type: string +- Examples: [ + "findAndModify", + "HMSET", + "SELECT", +] + + +#### Attribute `server.address` + +Name of the database host. + + + +When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + +- Requirement Level: Recommended + +- Tag: connection-level + +- Type: string +- Examples: [ + "example.com", + "10.1.2.80", + "/tmp/my.sock", +] + +- Stability: Stable + + +#### Attribute `server.port` + +Server port number. + + +When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +- Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. + +- Tag: connection-level + +- Type: int +- Examples: [ + 80, + 8080, + 443, +] + +- Stability: Stable + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -2137,7 +2147,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -2154,7 +2164,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -2179,7 +2189,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -2199,7 +2209,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -2210,129 +2220,157 @@ An identifier (address, unique name, or any other identifier) of the database in - Tag: connection-level -- Type: string -- Examples: mysql-e26b99z.example.com - +- Type: string +- Examples: mysql-e26b99z.example.com + + +#### Attribute `db.mssql.instance_name` + +The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. + + + +If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). + +- Requirement Level: Recommended + +- Tag: connection-level-tech-specific + +- Type: string +- Examples: MSSQLSERVER + + + + +## Namespace Spans `other` + + +## Span `db` + +This document defines the attributes used to perform database client calls. + +Prefix: +Kind: client + +### Attributes + + +#### Attribute `db.system` + +An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + + +- Requirement Level: Required + +- Tag: connection-level + +- Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] -#### Attribute `db.elasticsearch.cluster.name` -Represents the identifier of an Elasticsearch cluster. +#### Attribute `db.connection_string` +The connection string used to connect to the database. It is recommended to remove embedded credentials. -- Requirement Level: Optional + +- Requirement Level: Recommended -- Tag: call-level-tech-specific +- Tag: connection-level - Type: string -- Examples: [ - "e9106fc68e3044f0b1475b04bf4ffd5f", -] - +- Examples: Server=(localdb)\v11.0;Integrated Security=true; -#### Attribute `db.elasticsearch.node.name` -Represents the human-readable identifier of the node/instance to which a request was routed. +#### Attribute `db.user` +Username for accessing the database. -- Requirement Level: Optional + +- Requirement Level: Recommended -- Tag: call-level-tech-specific +- Tag: connection-level - Type: string - Examples: [ - "instance-0000000001", + "readonly_user", + "reporting_user", ] - -#### Attribute `db.elasticsearch.path_parts` -A dynamic value in the url path. +#### Attribute `db.jdbc.driver_classname` +The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. -Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. -- Requirement Level: Conditionally Required - when the url has dynamic values +- Requirement Level: Recommended -- Tag: call-level-tech-specific +- Tag: connection-level-tech-specific -- Type: template[string] +- Type: string - Examples: [ - "db.elasticsearch.path_parts.index=test-index", - "db.elasticsearch.path_parts.doc_id=123", + "org.postgresql.Driver", + "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - -#### Attribute `db.operation` -The endpoint identifier for the request. +#### Attribute `db.name` + +This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). -When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. -- Requirement Level: Required +In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). + +- Requirement Level: Conditionally Required - If applicable. -- Tag: call-level-tech-specific +- Tag: call-level - Type: string - Examples: [ - "search", - "ml.close_job", - "cat.aliases", + "customers", + "main", ] - + #### Attribute `db.statement` -The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. +The database statement being executed. + - Requirement Level: Optional -- Tag: call-level-tech-specific +- Tag: call-level - Type: string - Examples: [ - "\"{\\\"query\\\":{\\\"term\\\":{\\\"user.id\\\":\\\"kimchy\\\"}}}\"", + "SELECT * FROM wuser_table", + "SET mykey \"WuValue\"", ] - -#### Attribute `http.request.method` - -HTTP request method. +#### Attribute `db.operation` -HTTP request method value SHOULD be "known" to the instrumentation. -By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) -and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. -If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. -If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override -the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named -OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods -(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). -HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. -Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. -Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. +When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. -- Requirement Level: Required +- Requirement Level: Conditionally Required - If `db.statement` is not applicable. -- Tag: call-level-tech-specific +- Tag: call-level -- Type: Enum [CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, _OTHER] +- Type: string - Examples: [ - "GET", - "POST", - "HEAD", + "findAndModify", + "HMSET", + "SELECT", ] -- Stability: Stable - - + #### Attribute `server.address` Name of the database host. @@ -2343,7 +2381,7 @@ When observed from the client side, and when communicating through an intermedia - Requirement Level: Recommended -- Tag: call-level-tech-specific +- Tag: connection-level - Type: string - Examples: [ @@ -2354,7 +2392,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -2364,7 +2402,7 @@ When observed from the client side, and when communicating through an intermedia - Requirement Level: Conditionally Required - If using a port other than the default port for this DBMS and if `server.address` is set. -- Tag: call-level-tech-specific +- Tag: connection-level - Type: int - Examples: [ @@ -2375,36 +2413,109 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - -#### Attribute `url.full` -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) +#### Attribute `network.peer.address` +Peer address of the network connection - IP address or Unix domain socket name. -For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. -`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. -`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. -- Requirement Level: Required +- Requirement Level: Recommended -- Tag: call-level-tech-specific +- Tag: connection-level - Type: string - Examples: [ - "https://localhost:9200/index/_search?q=user.id:kimchy", + "10.1.2.80", + "/tmp/my.sock", ] - Stability: Stable + +#### Attribute `network.peer.port` + +Peer port number of the network connection. + + +- Requirement Level: Optional + +- Tag: connection-level + +- Type: int +- Examples: [ + 65123, +] +- Stability: Stable -## Group `db.sql` (span) -### Brief +#### Attribute `network.transport` + +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). + + + +The value SHOULD be normalized to lowercase. + +Consider always setting the transport when setting a port number, since +a port number is ambiguous without knowing the transport. For example +different processes could be listening on TCP port 12345 and UDP port 12345. + +- Requirement Level: Recommended + +- Tag: connection-level + +- Type: Enum [tcp, udp, pipe, unix] +- Examples: [ + "tcp", + "udp", +] + +- Stability: Stable + + +#### Attribute `network.type` + +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. + + +The value SHOULD be normalized to lowercase. + +- Requirement Level: Recommended + +- Tag: connection-level + +- Type: Enum [ipv4, ipv6] +- Examples: [ + "ipv4", + "ipv6", +] + +- Stability: Stable + + +#### Attribute `db.instance.id` + +An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. + + + +- Requirement Level: Optional + +- Tag: connection-level + +- Type: string +- Examples: mysql-e26b99z.example.com + -Call-level attributes for SQL databases +## Namespace Spans `redis` + + +## Span `db.redis` + +Call-level attributes for Redis Prefix: Kind: none @@ -2423,7 +2534,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -2437,7 +2548,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -2454,7 +2565,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -2471,7 +2582,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -2490,24 +2601,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - -#### Attribute `db.statement` - -The database statement being executed. - - -- Requirement Level: Optional - -- Tag: call-level - -- Type: string -- Examples: [ - "SELECT * FROM wuser_table", - "SET mykey \"WuValue\"", -] - - #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -2527,7 +2621,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -2549,7 +2643,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -2570,7 +2664,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -2588,7 +2682,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -2605,7 +2699,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -2630,7 +2724,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -2650,7 +2744,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -2661,38 +2755,56 @@ An identifier (address, unique name, or any other identifier) of the database in - Tag: connection-level -- Type: string -- Examples: mysql-e26b99z.example.com +- Type: string +- Examples: mysql-e26b99z.example.com + + +#### Attribute `db.redis.database_index` + +The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. + + + +- Requirement Level: Conditionally Required - If other than the default database (`0`). + +- Tag: call-level-tech-specific +- Type: int +- Examples: [ + 0, + 1, + 15, +] -#### Attribute `db.sql.table` -The name of the primary table that the operation is acting upon, including the database name (if applicable). +#### Attribute `db.statement` + +The full syntax of the Redis CLI command. -It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. -- Requirement Level: Recommended +For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`. + +- Requirement Level: Optional - Tag: call-level-tech-specific - Type: string - Examples: [ - "public.users", - "customers", + "HMSET myhash field1 'Hello' field2 'World'", ] - - -## Group `db.cosmosdb` (span) -### Brief -Call-level attributes for Cosmos DB. +## Namespace Spans `sql` -Prefix: db.cosmosdb +## Span `db.sql` + +Call-level attributes for SQL databases + +Prefix: Kind: none ### Attributes @@ -2709,7 +2821,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -2723,7 +2835,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -2740,7 +2852,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -2757,7 +2869,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -2776,7 +2888,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -2793,7 +2905,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -2813,7 +2925,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -2835,7 +2947,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -2856,7 +2968,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -2874,7 +2986,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -2891,7 +3003,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -2916,7 +3028,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -2936,7 +3048,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -2950,147 +3062,34 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - -#### Attribute `db.cosmosdb.client_id` - -Unique Cosmos client instance id. - - -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - - -#### Attribute `db.cosmosdb.connection_mode` - -Cosmos client connection mode. - - -- Requirement Level: Conditionally Required - if not `direct` (or pick gw as default) - -- Tag: call-level-tech-specific - -- Type: Enum [gateway, direct] - - -#### Attribute `db.cosmosdb.container` - -Cosmos DB container name. - - -- Requirement Level: Conditionally Required - if available - -- Tag: call-level-tech-specific - -- Type: string -- Examples: anystring - - -#### Attribute `db.cosmosdb.operation_type` - -CosmosDB Operation Type. - - -- Requirement Level: Conditionally Required - when performing one of the operations in this list - -- Tag: call-level-tech-specific - -- Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - - -#### Attribute `db.cosmosdb.request_charge` - -RU consumed for that operation +#### Attribute `db.sql.table` -- Requirement Level: Conditionally Required - when available - -- Tag: call-level-tech-specific - -- Type: double -- Examples: [ - 46.18, - 1.0, -] - - -#### Attribute `db.cosmosdb.request_content_length` +The name of the primary table that the operation is acting upon, including the database name (if applicable). -Request payload size in bytes +It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - Requirement Level: Recommended - Tag: call-level-tech-specific -- Type: int - - -#### Attribute `db.cosmosdb.status_code` - -Cosmos DB status code. - - -- Requirement Level: Conditionally Required - if response was received - -- Tag: call-level-tech-specific - -- Type: int -- Examples: [ - 200, - 201, -] - - -#### Attribute `db.cosmosdb.sub_status_code` - -Cosmos DB sub status code. - - -- Requirement Level: Conditionally Required - when response was received and contained sub-code. - -- Tag: call-level-tech-specific - -- Type: int +- Type: string - Examples: [ - 1000, - 1002, + "public.users", + "customers", ] - -#### Attribute `user_agent.original` -Full user-agent string is generated by Cosmos DB SDK -The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. - Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). - Default value is "NS". +## Namespace Spans `tech` -- Requirement Level: Recommended - -- Tag: call-level-tech-specific - -- Type: string -- Examples: [ - "cosmos-netstandard-sdk/3.23.0\\|3.23.1\\|1\\|X64\\|Linux 5.4.0-1098-azure 104 18\\|.NET Core 3.1.32\\|S\\|", -] - -- Stability: Stable - - - -## Group `db.tech` (span) -### Brief +## Span `db.tech` Semantic convention group for specific technologies - - Prefix: Kind: none @@ -3108,7 +3107,7 @@ An identifier for the database management system (DBMS) product being used. See - Type: Enum [other_sql, mssql, mssqlcompact, mysql, oracle, db2, postgresql, redshift, hive, cloudscape, hsqldb, progress, maxdb, hanadb, ingres, firstsql, edb, cache, adabas, firebird, derby, filemaker, informix, instantdb, interbase, mariadb, netezza, pervasive, pointbase, sqlite, sybase, teradata, vertica, h2, coldfusion, cassandra, hbase, mongodb, redis, couchbase, couchdb, cosmosdb, dynamodb, neo4j, geode, elasticsearch, memcached, cockroachdb, opensearch, clickhouse, spanner, trino] - + #### Attribute `db.connection_string` The connection string used to connect to the database. It is recommended to remove embedded credentials. @@ -3122,7 +3121,7 @@ The connection string used to connect to the database. It is recommended to remo - Type: string - Examples: Server=(localdb)\v11.0;Integrated Security=true; - + #### Attribute `db.user` Username for accessing the database. @@ -3139,7 +3138,7 @@ Username for accessing the database. "reporting_user", ] - + #### Attribute `db.jdbc.driver_classname` The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -3156,7 +3155,7 @@ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https: "com.microsoft.sqlserver.jdbc.SQLServerDriver", ] - + #### Attribute `db.name` This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). @@ -3175,7 +3174,7 @@ In some SQL databases, the database name to be used is called "schema name". In "main", ] - + #### Attribute `db.statement` The database statement being executed. @@ -3192,7 +3191,7 @@ The database statement being executed. "SET mykey \"WuValue\"", ] - + #### Attribute `db.operation` The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. @@ -3212,7 +3211,7 @@ When setting this to an SQL keyword, it is not recommended to attempt any client "SELECT", ] - + #### Attribute `server.address` Name of the database host. @@ -3234,7 +3233,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `server.port` Server port number. @@ -3255,7 +3254,7 @@ When observed from the client side, and when communicating through an intermedia - Stability: Stable - + #### Attribute `network.peer.address` Peer address of the network connection - IP address or Unix domain socket name. @@ -3273,7 +3272,7 @@ Peer address of the network connection - IP address or Unix domain socket name. - Stability: Stable - + #### Attribute `network.peer.port` Peer port number of the network connection. @@ -3290,7 +3289,7 @@ Peer port number of the network connection. - Stability: Stable - + #### Attribute `network.transport` [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -3315,7 +3314,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. - Stability: Stable - + #### Attribute `network.type` [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -3335,7 +3334,7 @@ The value SHOULD be normalized to lowercase. - Stability: Stable - + #### Attribute `db.instance.id` An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. @@ -3349,7 +3348,7 @@ An identifier (address, unique name, or any other identifier) of the database in - Type: string - Examples: mysql-e26b99z.example.com - + #### Attribute `db.cassandra.consistency_level` The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). @@ -3362,7 +3361,7 @@ The consistency level of the query. Based on consistency values from [CQL](https - Type: Enum [all, each_quorum, quorum, local_quorum, one, two, three, local_one, any, serial, local_serial] - + #### Attribute `db.cassandra.coordinator.dc` The data center of the coordinating node for a query. @@ -3376,7 +3375,7 @@ The data center of the coordinating node for a query. - Type: string - Examples: us-west-2 - + #### Attribute `db.cassandra.coordinator.id` The ID of the coordinating node for a query. @@ -3390,7 +3389,7 @@ The ID of the coordinating node for a query. - Type: string - Examples: be13faa2-8574-4d71-926d-27f16cf8a7af - + #### Attribute `db.cassandra.idempotence` Whether or not the query is idempotent. @@ -3403,7 +3402,7 @@ Whether or not the query is idempotent. - Type: boolean - + #### Attribute `db.cassandra.page_size` The fetch size used for paging, i.e. how many rows will be returned at once. @@ -3419,7 +3418,7 @@ The fetch size used for paging, i.e. how many rows will be returned at once. 5000, ] - + #### Attribute `db.cassandra.speculative_execution_count` The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. @@ -3436,7 +3435,7 @@ The number of times a query was speculatively executed. Not set or `0` if the qu 2, ] - + #### Attribute `db.cassandra.table` The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). @@ -3451,7 +3450,7 @@ This mirrors the db.sql.table attribute but references cassandra rather than sql - Type: string - Examples: mytable - + #### Attribute `db.name` The keyspace name in Cassandra. @@ -3469,7 +3468,7 @@ For Cassandra the `db.name` should be set to the Cassandra keyspace name. "mykeyspace", ] - + #### Attribute `db.redis.database_index` The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. @@ -3487,7 +3486,7 @@ The index of the database being accessed as used in the [`SELECT` command](https 15, ] - + #### Attribute `db.statement` The full syntax of the Redis CLI command. @@ -3505,7 +3504,7 @@ For **Redis**, the value provided for `db.statement` SHOULD correspond to the sy "HMSET myhash field1 'Hello' field2 'World'", ] - + #### Attribute `db.mongodb.collection` The MongoDB collection being accessed within the database stated in `db.name`. @@ -3522,7 +3521,7 @@ The MongoDB collection being accessed within the database stated in `db.name`. "products", ] - + #### Attribute `db.sql.table` The name of the primary table that the operation is acting upon, including the database name (if applicable). @@ -3540,7 +3539,7 @@ It is not recommended to attempt any client-side parsing of `db.statement` just "customers", ] - + #### Attribute `db.cosmosdb.client_id` Unique Cosmos client instance id. @@ -3553,7 +3552,7 @@ Unique Cosmos client instance id. - Type: string - Examples: 3ba4827d-4422-483f-b59f-85b74211c11d - + #### Attribute `db.cosmosdb.connection_mode` Cosmos client connection mode. @@ -3565,7 +3564,7 @@ Cosmos client connection mode. - Type: Enum [gateway, direct] - + #### Attribute `db.cosmosdb.container` Cosmos DB container name. @@ -3578,7 +3577,7 @@ Cosmos DB container name. - Type: string - Examples: anystring - + #### Attribute `db.cosmosdb.operation_type` CosmosDB Operation Type. @@ -3590,7 +3589,7 @@ CosmosDB Operation Type. - Type: Enum [Invalid, Create, Patch, Read, ReadFeed, Delete, Replace, Execute, Query, Head, HeadFeed, Upsert, Batch, QueryPlan, ExecuteJavaScript] - + #### Attribute `db.cosmosdb.request_charge` RU consumed for that operation @@ -3606,7 +3605,7 @@ RU consumed for that operation 1.0, ] - + #### Attribute `db.cosmosdb.request_content_length` Request payload size in bytes @@ -3618,7 +3617,7 @@ Request payload size in bytes - Type: int - + #### Attribute `db.cosmosdb.status_code` Cosmos DB status code. @@ -3634,7 +3633,7 @@ Cosmos DB status code. 201, ] - + #### Attribute `db.cosmosdb.sub_status_code` Cosmos DB sub status code. @@ -3650,7 +3649,7 @@ Cosmos DB sub status code. 1002, ] - + #### Attribute `user_agent.original` Full user-agent string is generated by Cosmos DB SDK @@ -3671,5 +3670,7 @@ The user-agent value is generated by SDK which is a combination of
`sdk_vers - Stability: Stable - + + + \ No newline at end of file diff --git a/crates/weaver_forge/src/error.rs b/crates/weaver_forge/src/error.rs index 9c8d49d7..301e4937 100644 --- a/crates/weaver_forge/src/error.rs +++ b/crates/weaver_forge/src/error.rs @@ -131,6 +131,15 @@ pub enum Error { error: String, }, + /// Import JQ package error. + #[error("Import JQ package '{package}' failed: {error}")] + ImportError { + /// Package that caused the error. + package: String, + /// Error message. + error: String, + }, + /// Invalid template pattern. #[error("Invalid template pattern: {error}")] InvalidTemplatePattern { @@ -145,6 +154,15 @@ pub enum Error { error: String, }, + /// Duplicate parameter key. + #[error("Duplicate parameter key '{key}': {error}")] + DuplicateParamKey { + /// The duplicate key. + key: String, + /// Error message. + error: String, + }, + /// Invalid case convention. #[error("`{case}` is not a valid case convention. Valid case conventions are: lower_case, upper_case, title_case, snake_case, kebab_case, camel_case, pascal_case, screaming_snake_case, and screaming_kebab_case.")] InvalidCaseConvention { diff --git a/crates/weaver_forge/src/filter.rs b/crates/weaver_forge/src/filter.rs index 66219927..29dcad30 100644 --- a/crates/weaver_forge/src/filter.rs +++ b/crates/weaver_forge/src/filter.rs @@ -5,6 +5,7 @@ use crate::error::Error; use core::fmt; use jaq_interpret::{Ctx, FilterT, RcIter, Val}; +use jaq_syn::Def; use std::fmt::Debug; /// A filter that can be applied to a JSON value. @@ -18,10 +19,11 @@ impl Filter { /// expression is invalid. /// The vars parameter is a list of variable names that can be used in the /// filter expression. - pub fn try_new(filter_expr: &str, vars: Vec) -> Result { + pub fn try_new(filter_expr: &str, vars: Vec, defs: Vec) -> Result { let mut ctx = jaq_interpret::ParseCtx::new(vars); ctx.insert_natives(jaq_core::core()); ctx.insert_defs(jaq_std::std()); + ctx.insert_defs(defs); let (parsed_expr, errs) = jaq_parse::parse(filter_expr, jaq_parse::main()); @@ -86,15 +88,15 @@ mod tests { #[test] fn test_filter() { - let filter = super::Filter::try_new("true", Vec::new()).unwrap(); + let filter = super::Filter::try_new("true", Vec::new(), Vec::new()).unwrap(); let result = filter.apply(serde_json::json!({}), Vec::new()).unwrap(); assert_eq!(result, serde_json::json!(true)); - let filter = super::Filter::try_new(".", Vec::new()).unwrap(); + let filter = super::Filter::try_new(".", Vec::new(), Vec::new()).unwrap(); let result = filter.apply(serde_json::json!({}), Vec::new()).unwrap(); assert_eq!(result, serde_json::Value::Object(serde_json::Map::new())); - let filter = super::Filter::try_new(".", Vec::new()).unwrap(); + let filter = super::Filter::try_new(".", Vec::new(), Vec::new()).unwrap(); let result = filter .apply( serde_json::json!({ @@ -112,7 +114,7 @@ mod tests { }) ); - let filter = super::Filter::try_new(".key1", Vec::new()).unwrap(); + let filter = super::Filter::try_new(".key1", Vec::new(), Vec::new()).unwrap(); let result = filter .apply( serde_json::json!({ @@ -124,7 +126,7 @@ mod tests { .unwrap(); assert_eq!(result, serde_json::json!(1)); - let filter = super::Filter::try_new(".[\"key1\"]", Vec::new()).unwrap(); + let filter = super::Filter::try_new(".[\"key1\"]", Vec::new(), Vec::new()).unwrap(); let result = filter .apply( serde_json::json!({ @@ -138,7 +140,7 @@ mod tests { let vars = vec!["key".to_owned()]; let ctx = vec![Val::from(serde_json::Value::String("key1".to_owned()))]; - let filter = super::Filter::try_new(".[$key]", vars).unwrap(); + let filter = super::Filter::try_new(".[$key]", vars, Vec::new()).unwrap(); let result = filter .apply( serde_json::json!({ @@ -163,13 +165,13 @@ end"#; let vars = vec!["incubating".to_owned()]; // When incubating is true, the entire input is returned. let ctx = vec![Val::from(serde_json::Value::Bool(true))]; - let filter = super::Filter::try_new(jq_filter, vars.clone()).unwrap(); + let filter = super::Filter::try_new(jq_filter, vars.clone(), Vec::new()).unwrap(); let result = filter.apply(input.clone(), ctx).unwrap(); assert_eq!(result, input); // When incubating = false the filter should return an empty array let ctx = vec![Val::from(serde_json::Value::Bool(false))]; - let filter = super::Filter::try_new(jq_filter, vars).unwrap(); + let filter = super::Filter::try_new(jq_filter, vars, Vec::new()).unwrap(); let result = filter.apply(input.clone(), ctx).unwrap(); assert_eq!(result, serde_json::Value::Null); } diff --git a/crates/weaver_forge/src/lib.rs b/crates/weaver_forge/src/lib.rs index 27695aa3..c90c487e 100644 --- a/crates/weaver_forge/src/lib.rs +++ b/crates/weaver_forge/src/lib.rs @@ -45,6 +45,9 @@ pub mod registry; /// Name of the Weaver configuration file. pub const WEAVER_YAML: &str = "weaver.yaml"; +/// Default jq filter for the semantic convention registry. +pub const SEMCONV_JQ: &str = include_str!("../../../defaults/jq/semconv.jq"); + // Definition of the Jinja syntax delimiters /// Constant defining the start of a Jinja block. @@ -148,6 +151,9 @@ pub struct TemplateEngine { /// Target configuration target_config: WeaverConfig, + + /// The jq packages that have been imported. + jq_packages: Vec, } /// Global context for the template engine. @@ -198,7 +204,30 @@ impl TemplateEngine { Self { file_loader: Arc::new(loader), target_config: config, + jq_packages: Vec::new(), + } + } + + /// Import a jq package into the template engine. + /// A jq package is a collection of jq functions that can be used in the templates. + pub fn import_jq_package(&mut self, package_content: &str) -> Result<(), Error> { + let (defs, errs) = jaq_parse::parse(package_content, jaq_parse::defs()); + + if !errs.is_empty() { + return Err(Error::CompoundError( + errs.into_iter() + .map(|e| Error::ImportError { + package: package_content.to_owned(), + error: e.to_string(), + }) + .collect(), + )); + } + + if let Some(def) = defs { + self.jq_packages.extend(def); } + Ok(()) } /// Generate a template snippet from serializable context and a snippet identifier. @@ -258,28 +287,49 @@ impl TemplateEngine { let mut errors = Vec::new(); + let params = if let Some(mut params) = self.target_config.params.clone() { + match serde_yaml::to_value(&self.target_config.params) { + Ok(value) => { + let prev = params.insert("params".to_owned(), value); + if prev.is_some() { + errors.push(Error::DuplicateParamKey { + key: "params".to_owned(), + error: "The parameter `params` is a reserved parameter name".to_owned(), + }); + } + } + Err(e) => { + errors.push(ContextSerializationFailed { + error: e.to_string(), + }); + } + } + Some(params) + } else { + None + }; + // Build JQ context from the params. - let (jq_vars, jq_ctx): (Vec, Vec) = - self.target_config.params.as_ref().map_or_else( - || (Vec::new(), Vec::new()), // If self.target_config.params is None, return empty vectors - |params| { - params - .iter() - .filter_map(|(k, v)| { - let json_value = match serde_json::to_value(v) { - Ok(json_value) => json_value, - Err(e) => { - errors.push(ContextSerializationFailed { - error: e.to_string(), - }); - return None; - } - }; - Some((k.clone(), json_value)) - }) - .unzip() - }, - ); + let (jq_vars, jq_ctx): (Vec, Vec) = params.as_ref().map_or_else( + || (Vec::new(), Vec::new()), // If self.target_config.params is None, return empty vectors + |params| { + params + .iter() + .filter_map(|(k, v)| { + let json_value = match serde_json::to_value(v) { + Ok(json_value) => json_value, + Err(e) => { + errors.push(ContextSerializationFailed { + error: e.to_string(), + }); + return None; + } + }; + Some((k.clone(), json_value)) + }) + .unzip() + }, + ); // Process all files in parallel // - Filter the files that match the template pattern @@ -295,7 +345,11 @@ impl TemplateEngine { .into_par_iter() .filter_map(|relative_path| { for template in tmpl_matcher.matches(relative_path.clone()) { - let filter = match Filter::try_new(template.filter.as_str(), jq_vars.clone()) { + let filter = match Filter::try_new( + template.filter.as_str(), + jq_vars.clone(), + self.jq_packages.clone(), + ) { Ok(filter) => filter, Err(e) => return Some(e), }; @@ -560,6 +614,7 @@ impl TemplateEngine { #[cfg(test)] mod tests { + use std::fs; use std::path::Path; use globset::Glob; @@ -707,6 +762,7 @@ mod tests { let config = WeaverConfig::try_from_loader(&loader).expect("Failed to load `templates/weaver.yaml`"); let mut engine = super::TemplateEngine::new(config, loader, Params::default()); + engine.import_jq_package(super::SEMCONV_JQ).unwrap(); // Add a template configuration for converter.md on top // of the default template configuration. This is useful @@ -825,4 +881,53 @@ mod tests { assert!(diff_dir("expected_output/py_compat", "observed_output/py_compat").unwrap()); } + + #[test] + fn test_semconv_jq_functions() { + let logger = TestLogger::default(); + let loader = FileSystemFileLoader::try_new("templates".into(), "semconv_jq_fn") + .expect("Failed to create file system loader"); + let config = + WeaverConfig::try_from_loader(&loader).expect("Failed to load `templates/weaver.yaml`"); + let mut engine = super::TemplateEngine::new(config, loader, Params::default()); + engine.import_jq_package(super::SEMCONV_JQ).unwrap(); + let registry_id = "default"; + let mut registry = SemConvRegistry::try_from_path_pattern(registry_id, "data/*.yaml") + .expect("Failed to load registry"); + let schema = SchemaResolver::resolve_semantic_convention_registry(&mut registry) + .expect("Failed to resolve registry"); + + let template_registry = ResolvedRegistry::try_from_resolved_registry( + schema.registry(registry_id).expect("registry not found"), + schema.catalog(), + ) + .unwrap_or_else(|e| { + panic!( + "Failed to create the context for the template evaluation: {:?}", + e + ) + }); + + // Delete all the files in the observed_output/semconv_jq_fn directory + // before generating the new files. + fs::remove_dir_all("observed_output/semconv_jq_fn").unwrap_or_default(); + + engine + .generate( + logger.clone(), + &template_registry, + Path::new("observed_output/semconv_jq_fn"), + &OutputDirective::File, + ) + .inspect_err(|e| { + print_dedup_errors(logger.clone(), e.clone()); + }) + .expect("Failed to generate registry assets"); + + assert!(diff_dir( + "expected_output/semconv_jq_fn", + "observed_output/semconv_jq_fn" + ) + .unwrap()); + } } diff --git a/crates/weaver_forge/templates/semconv_jq_fn/semconv_attributes.json b/crates/weaver_forge/templates/semconv_jq_fn/semconv_attributes.json new file mode 100644 index 00000000..760f1e67 --- /dev/null +++ b/crates/weaver_forge/templates/semconv_jq_fn/semconv_attributes.json @@ -0,0 +1 @@ +{{ ctx | tojson }} \ No newline at end of file diff --git a/crates/weaver_forge/templates/semconv_jq_fn/semconv_grouped_attributes.json b/crates/weaver_forge/templates/semconv_jq_fn/semconv_grouped_attributes.json new file mode 100644 index 00000000..760f1e67 --- /dev/null +++ b/crates/weaver_forge/templates/semconv_jq_fn/semconv_grouped_attributes.json @@ -0,0 +1 @@ +{{ ctx | tojson }} \ No newline at end of file diff --git a/crates/weaver_forge/templates/semconv_jq_fn/semconv_grouped_attributes_without_experimental.json b/crates/weaver_forge/templates/semconv_jq_fn/semconv_grouped_attributes_without_experimental.json new file mode 100644 index 00000000..760f1e67 --- /dev/null +++ b/crates/weaver_forge/templates/semconv_jq_fn/semconv_grouped_attributes_without_experimental.json @@ -0,0 +1 @@ +{{ ctx | tojson }} \ No newline at end of file diff --git a/crates/weaver_forge/templates/semconv_jq_fn/semconv_metrics.json b/crates/weaver_forge/templates/semconv_jq_fn/semconv_metrics.json new file mode 100644 index 00000000..760f1e67 --- /dev/null +++ b/crates/weaver_forge/templates/semconv_jq_fn/semconv_metrics.json @@ -0,0 +1 @@ +{{ ctx | tojson }} \ No newline at end of file diff --git a/crates/weaver_forge/templates/semconv_jq_fn/weaver.yaml b/crates/weaver_forge/templates/semconv_jq_fn/weaver.yaml new file mode 100644 index 00000000..36a42d6a --- /dev/null +++ b/crates/weaver_forge/templates/semconv_jq_fn/weaver.yaml @@ -0,0 +1,22 @@ +params: + exclude_stability: ["experimental"] + +templates: + - pattern: semconv_attributes.json + filter: semconv_attributes + application_mode: single + - pattern: semconv_grouped_attributes.json + filter: > + semconv_grouped_attributes + application_mode: single + - pattern: semconv_grouped_attributes_without_experimental.json + filter: > + semconv_grouped_attributes({ + "exclude_root_namespace": ["url", "network"], + "exclude_stability": ["experimental"] + }) + application_mode: single + - pattern: semconv_metrics.json + filter: > + semconv_grouped_metrics({"exclude_stability": ["experimental"]}) + application_mode: single diff --git a/crates/weaver_forge/templates/test/attribute_group.md b/crates/weaver_forge/templates/test/attribute_group.md index fd90cae0..1be6bcc3 100644 --- a/crates/weaver_forge/templates/test/attribute_group.md +++ b/crates/weaver_forge/templates/test/attribute_group.md @@ -1,13 +1,7 @@ -{%- set file_name = ctx.id | snake_case -%} +{%- set file_name = ctx.root_namespace | snake_case -%} {{- template.set_file_name("attribute_group/" ~ file_name ~ ".md") -}} -## Group `{{ ctx.id | split_id | list | join("_") }}` ({{ ctx.type }}) - -### Brief - -{{ ctx.brief | trim }} - -prefix: {{ ctx.prefix }} +## Namespace `{{ ctx.root_namespace }}` ### Attributes diff --git a/crates/weaver_forge/templates/test/attribute_groups.md b/crates/weaver_forge/templates/test/attribute_groups.md index 4a03936e..a5f31c46 100644 --- a/crates/weaver_forge/templates/test/attribute_groups.md +++ b/crates/weaver_forge/templates/test/attribute_groups.md @@ -6,18 +6,12 @@ - {{item}} {%- endfor -%} -{% for group in ctx %} -## Group `{{ group.id }}` ({{ group.type }}) - -### Brief - -{{ group.brief | trim }} - -prefix: {{ group.prefix }} +{% for grouped_attributes in ctx %} +## Namespace `{{ grouped_attributes.root_namespace }}` ### Attributes -{% for attribute in group.attributes %} +{% for attribute in grouped_attributes.attributes %} #### Attribute `{{ attribute.name }}` {{ attribute.brief }} diff --git a/crates/weaver_forge/templates/test/event.md b/crates/weaver_forge/templates/test/event.md index ecdeac3d..b15e5680 100644 --- a/crates/weaver_forge/templates/test/event.md +++ b/crates/weaver_forge/templates/test/event.md @@ -1,19 +1,20 @@ -{%- set file_name = ctx.id | snake_case -%} +{%- set file_name = ctx.root_namespace | snake_case -%} {{- template.set_file_name("event/" ~ file_name ~ ".md") -}} -# Group `{{ ctx.id }}` ({{ ctx.type }}) +## Events Namespace `{{ ctx.root_namespace }}` -## Brief +{% for event in ctx.events %} +## Event `{{ event.name }}` -{{ ctx.brief | trim }} +Note: {{ event.note }} +Brief: {{ event.brief }} +Requirement level: {{ event.requirement_level }} +Stability: {{ event.stability }} -Prefix: {{ ctx.prefix }} -Name: {{ ctx.name }} +### Attributes -## Attributes - -{% for attribute in ctx.attributes %} -### Attribute `{{ attribute.name }}` +{% for attribute in event.attributes %} +#### Attribute `{{ attribute.name }}` {{ attribute.brief }} @@ -45,3 +46,4 @@ Name: {{ ctx.name }} - Stability: {{ attribute.stability | capitalize }} {% endif %} {% endfor %} + {% endfor %} \ No newline at end of file diff --git a/crates/weaver_forge/templates/test/events.md b/crates/weaver_forge/templates/test/events.md index eae78bc1..d8bba381 100644 --- a/crates/weaver_forge/templates/test/events.md +++ b/crates/weaver_forge/templates/test/events.md @@ -1,18 +1,17 @@ -# Semantic Convention Event Groups +{% for grouped_events in ctx %} +# Events Namespace `{{ grouped_events.root_namespace }}` -{% for group in ctx %} -## Group `{{ group.id }}` ({{ group.type }}) +{% for event in grouped_events.events %} +## Event `{{ event.name }}` -### Brief - -{{ group.brief | trim }} - -Prefix: {{ group.prefix }} -Name: {{ group.name }} +Note: {{ event.note }} +Brief: {{ event.brief }} +Requirement level: {{ event.requirement_level }} +Stability: {{ event.stability }} ### Attributes -{% for attribute in group.attributes %} +{% for attribute in event.attributes %} #### Attribute `{{ attribute.name }}` {{ attribute.brief }} @@ -46,3 +45,5 @@ Name: {{ group.name }} {% endif %} {% endfor %} {% endfor %} + {% endfor %} + \ No newline at end of file diff --git a/crates/weaver_forge/templates/test/metric.md b/crates/weaver_forge/templates/test/metric.md index ea30d22a..c89fde7d 100644 --- a/crates/weaver_forge/templates/test/metric.md +++ b/crates/weaver_forge/templates/test/metric.md @@ -1,23 +1,18 @@ -{%- set file_name = ctx.id | snake_case -%} +{%- set file_name = ctx.root_namespace | snake_case -%} {{- template.set_file_name("metric/" ~ file_name ~ ".md") -}} -## Group `{{ ctx.id }}` ({{ ctx.type }}) +## Metrics Namespace `{{ ctx.root_namespace }}` -### Brief +{% for metric in ctx.metrics %} +## Metric `{{ metric.metric_name }}` -{{ ctx.brief | trim }} - -{{ ctx.note | trim }} - -Prefix: {{ ctx.prefix }} -Metric: {{ ctx.metric_name }} -Instrument: {{ ctx.instrument }} -Unit: {{ ctx.unit }} -Stability: {{ ctx.stability | capitalize }} +Instrument: {{ metric.instrument }} +Unit: {{ metric.unit }} +Stability: {{ metric.stability }} ### Attributes -{% for attribute in ctx.attributes %} +{% for attribute in metric.attributes %} #### Attribute `{{ attribute.name }}` {{ attribute.brief }} @@ -50,3 +45,4 @@ Stability: {{ ctx.stability | capitalize }} - Stability: {{ attribute.stability | capitalize }} {% endif %} {% endfor %} + {% endfor %} \ No newline at end of file diff --git a/crates/weaver_forge/templates/test/metrics.md b/crates/weaver_forge/templates/test/metrics.md index 641805cb..bea6f675 100644 --- a/crates/weaver_forge/templates/test/metrics.md +++ b/crates/weaver_forge/templates/test/metrics.md @@ -1,23 +1,16 @@ -# Semantic Convention Metric Groups +{% for grouped_metrics in ctx %} +# Metric Namespace `{{ grouped_metrics.root_namespace }}` -{% for group in ctx %} -## Group `{{ group.id }}` ({{ group.type }}) +{% for metric in grouped_metrics.metrics %} +## Metric `{{ metric.metric_name }}` -### Brief - -{{ group.brief | trim }} - -{{ group.note | trim }} - -Prefix: {{ group.prefix }} -Metric: {{ group.metric_name }} -Instrument: {{ group.instrument }} -Unit: {{ group.unit }} -Stability: {{ group.stability | capitalize }} +Instrument: {{ metric.instrument }} +Unit: {{ metric.unit }} +Stability: {{ metric.stability }} ### Attributes -{% for attribute in group.attributes %} +{% for attribute in metric.attributes %} #### Attribute `{{ attribute.name }}` {{ attribute.brief }} @@ -51,3 +44,5 @@ Stability: {{ group.stability | capitalize }} {% endif %} {% endfor %} {% endfor %} + {% endfor %} + \ No newline at end of file diff --git a/crates/weaver_forge/templates/test/resource.md b/crates/weaver_forge/templates/test/resource.md index b4ab50a9..de165458 100644 --- a/crates/weaver_forge/templates/test/resource.md +++ b/crates/weaver_forge/templates/test/resource.md @@ -1,17 +1,18 @@ -{%- set file_name = ctx.id | snake_case -%} +{%- set file_name = ctx.root_namespace | snake_case -%} {{- template.set_file_name("resource/" ~ file_name ~ ".md") -}} -## Group `{{ ctx.id }}` ({{ ctx.type }}) +## Namespace Resource `{{ ctx.root_namespace }}` -### Brief +{% for resource in ctx.resources %} -{{ ctx.brief | trim }} +## Resource `{{ resource.id }}` -prefix: {{ ctx.prefix }} +Note: {{ resource.note }} +Brief: {{ resource.brief }} ### Attributes -{% for attribute in ctx.attributes %} +{% for attribute in resource.attributes %} #### Attribute `{{ attribute.name }}` {{ attribute.brief }} @@ -44,3 +45,4 @@ prefix: {{ ctx.prefix }} - Stability: {{ attribute.stability | capitalize }} {% endif %} {% endfor %} + {% endfor %} \ No newline at end of file diff --git a/crates/weaver_forge/templates/test/resources.md b/crates/weaver_forge/templates/test/resources.md index 955b76fc..483f5b4f 100644 --- a/crates/weaver_forge/templates/test/resources.md +++ b/crates/weaver_forge/templates/test/resources.md @@ -1,17 +1,18 @@ # Semantic Convention Resource Groups -{% for group in ctx %} -## Group `{{ group.id }}` ({{ group.type }}) +{% for grouped_resources in ctx %} +## Namespace Resource `{{ grouped_resources.root_namespace }}` -### Brief +{% for resource in grouped_resources.resources %} -{{ group.brief | trim }} +## Resource `{{ resource.id }}` -prefix: {{ group.prefix }} +Note: {{ resource.note }} +Brief: {{ resource.brief }} ### Attributes -{% for attribute in group.attributes %} +{% for attribute in resource.attributes %} #### Attribute `{{ attribute.name }}` {{ attribute.brief }} @@ -44,4 +45,5 @@ prefix: {{ group.prefix }} - Stability: {{ attribute.stability | capitalize }} {% endif %} {% endfor %} - {% endfor %} \ No newline at end of file + {% endfor %} +- {% endfor %} \ No newline at end of file diff --git a/crates/weaver_forge/templates/test/span.md b/crates/weaver_forge/templates/test/span.md index 6f00ffc3..ac667659 100644 --- a/crates/weaver_forge/templates/test/span.md +++ b/crates/weaver_forge/templates/test/span.md @@ -1,20 +1,19 @@ -{%- set file_name = ctx.id | snake_case -%} +{%- set file_name = ctx.root_namespace | snake_case -%} {{- template.set_file_name("span/" ~ file_name ~ ".md") -}} -## Group `{{ ctx.id }}` ({{ ctx.type }}) +## Namespace Span `{{ ctx.root_namespace }}` -### Brief +{% for span in ctx.spans %} +## Span `{{ span.id }}` -{{ ctx.brief | trim }} - -{{ ctx.note | trim }} - -Prefix: {{ ctx.prefix }} -Kind: {{ ctx.span_kind }} +{{ span.brief | trim }} +{{ span.note | trim }} +Prefix: {{ span.prefix }} +Kind: {{ span.span_kind }} ### Attributes -{% for attribute in ctx.attributes %} +{% for attribute in span.attributes %} #### Attribute `{{ attribute.name }}` {{ attribute.brief }} @@ -46,4 +45,5 @@ Kind: {{ ctx.span_kind }} {% if attribute.stability %} - Stability: {{ attribute.stability | capitalize }} {% endif %} - {% endfor %} \ No newline at end of file +{% endfor %} +{% endfor %} \ No newline at end of file diff --git a/crates/weaver_forge/templates/test/spans.md b/crates/weaver_forge/templates/test/spans.md index 28083c2a..8d8a685e 100644 --- a/crates/weaver_forge/templates/test/spans.md +++ b/crates/weaver_forge/templates/test/spans.md @@ -1,20 +1,19 @@ # Semantic Convention Span Groups -{% for group in ctx %} -## Group `{{ group.id }}` ({{ group.type }}) +{% for grouped_spans in ctx %} +## Namespace Spans `{{ grouped_spans.root_namespace }}` -### Brief +{% for span in grouped_spans.spans %} +## Span `{{ span.id }}` -{{ group.brief | trim }} - -{{ group.note | trim }} - -Prefix: {{ group.prefix }} -Kind: {{ group.span_kind }} +{{ span.brief | trim }} +{{ span.note | trim }} +Prefix: {{ span.prefix }} +Kind: {{ span.span_kind }} ### Attributes -{% for attribute in group.attributes %} +{% for attribute in span.attributes %} #### Attribute `{{ attribute.name }}` {{ attribute.brief }} @@ -46,5 +45,7 @@ Kind: {{ group.span_kind }} {% if attribute.stability %} - Stability: {{ attribute.stability | capitalize }} {% endif %} - {% endfor %} - {% endfor %} \ No newline at end of file +{% endfor %} +{% endfor %} +{% endfor %} + \ No newline at end of file diff --git a/crates/weaver_forge/templates/test/weaver.yaml b/crates/weaver_forge/templates/test/weaver.yaml index e100857c..a4f9446a 100644 --- a/crates/weaver_forge/templates/test/weaver.yaml +++ b/crates/weaver_forge/templates/test/weaver.yaml @@ -21,44 +21,32 @@ templates: filter: "." application_mode: single - pattern: "**/attribute_group.md" - filter: ".groups[] | select(.type == \"attribute_group\")" + filter: semconv_grouped_attributes application_mode: each - pattern: "**/attribute_groups.md" - filter: ".groups[] | select(.type == \"attribute_group\")" + filter: semconv_grouped_attributes application_mode: single - pattern: "**/event.md" - filter: ".groups[] | select(.type == \"event\")" + filter: semconv_signal("event"; {}) | semconv_group_signals_by_root_namespace("events") application_mode: each - pattern: "**/events.md" - filter: ".groups[] | select(.type == \"event\")" - application_mode: single - - pattern: "**/group.md" - filter: ".groups" - application_mode: each - - pattern: "**/groups.md" - filter: ".groups" + filter: semconv_signal("event"; {}) | semconv_group_signals_by_root_namespace("events") application_mode: single - pattern: "**/metric.md" - filter: ".groups[] | select(.type == \"metric\")" + filter: semconv_grouped_metrics application_mode: each - pattern: "**/metrics.md" - filter: ".groups[] | select(.type == \"metric\")" + filter: semconv_grouped_metrics application_mode: single - pattern: "**/resource.md" - filter: ".groups[] | select(.type == \"resource\")" + filter: semconv_signal("resource"; {}) | semconv_group_signals_by_root_namespace("resources") application_mode: each - pattern: "**/resources.md" - filter: ".groups[] | select(.type == \"resource\")" - application_mode: single - - pattern: "**/scope.md" - filter: ".groups[] | select(.type == \"scope\")" - application_mode: each - - pattern: "**/scopes.md" - filter: ".groups[] | select(.type == \"scope\")" + filter: semconv_signal("resource"; {}) | semconv_group_signals_by_root_namespace("resources") application_mode: single - pattern: "**/span.md" - filter: ".groups[] | select(.type == \"span\")" + filter: semconv_signal("span"; {}) | semconv_group_signals_by_root_namespace("spans") application_mode: each - pattern: "**/spans.md" - filter: ".groups[] | select(.type == \"span\")" + filter: semconv_signal("span"; {}) | semconv_group_signals_by_root_namespace("spans") application_mode: single \ No newline at end of file diff --git a/crates/weaver_resolved_schema/Cargo.toml b/crates/weaver_resolved_schema/Cargo.toml index 3922bda5..db0f83dd 100644 --- a/crates/weaver_resolved_schema/Cargo.toml +++ b/crates/weaver_resolved_schema/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_resolved_schema" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_resolver/Cargo.toml b/crates/weaver_resolver/Cargo.toml index 294a0fd0..bcddb218 100644 --- a/crates/weaver_resolver/Cargo.toml +++ b/crates/weaver_resolver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_resolver" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_semconv/Cargo.toml b/crates/weaver_semconv/Cargo.toml index efa0c027..f772f82a 100644 --- a/crates/weaver_semconv/Cargo.toml +++ b/crates/weaver_semconv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_semconv" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_semconv_gen/Cargo.toml b/crates/weaver_semconv_gen/Cargo.toml index 6126acf6..88a944e9 100644 --- a/crates/weaver_semconv_gen/Cargo.toml +++ b/crates/weaver_semconv_gen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_semconv_gen" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/weaver_version/Cargo.toml b/crates/weaver_version/Cargo.toml index f4ce0789..ca6107ca 100644 --- a/crates/weaver_version/Cargo.toml +++ b/crates/weaver_version/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "weaver_version" -version = "0.6.0" +version = "0.7.0" authors.workspace = true repository.workspace = true license.workspace = true diff --git a/defaults/jq/semconv.jq b/defaults/jq/semconv.jq new file mode 100644 index 00000000..c4c15716 --- /dev/null +++ b/defaults/jq/semconv.jq @@ -0,0 +1,110 @@ +# Groups the attributes by their root namespace and sorts them by name. +def semconv_group_attributes_by_root_namespace: + group_by(.root_namespace) + | map({ root_namespace: .[0].root_namespace, attributes: . | sort_by(.name) }); + +##################### +# Attribute functions +##################### + +# Extracts and processes semantic convention attributes based on provided options. +# $options is an object that can contain: +# - exclude_stability: a list of stability statuses to exclude. +# - exclude_deprecated: a boolean to exclude deprecated attributes. +# - exclude_root_namespace: a list of root namespaces to exclude. +def semconv_attributes($options): + .groups + | map(select(.type == "attribute_group" and (.id | startswith("registry.")))) + | map(.attributes) | add + | if ($options | has("exclude_stability")) then + map(select(.stability as $st | $options.exclude_stability | index($st) | not)) + else + . + end + | if ($options | has("exclude_deprecated") and $options.exclude_deprecated == true) then + map(select(has("deprecated") | not)) + else + . + end + | map(. + {root_namespace: (if .name | index(".") then .name | split(".")[0] else "other" end)}) + | if ($options | has("exclude_root_namespace")) then + map(select(.root_namespace as $st | $options.exclude_root_namespace | index($st) | not)) + else + . + end + | sort_by(.root_namespace, .name); + +# Convenience function to extract all attributes without any filtering options. +def semconv_attributes: semconv_attributes({}); + +# Groups the processed attributes by their root namespace based on provided options. +# $options is an object that can contain: +# - exclude_stability: a list of stability statuses to exclude. +# - exclude_deprecated: a boolean to exclude deprecated attributes. +# - exclude_root_namespace: a list of root namespaces to exclude. +def semconv_grouped_attributes($options): + semconv_attributes($options) + | semconv_group_attributes_by_root_namespace; + +# Convenience function to group all attributes by their root namespace without +# any filtering options. +def semconv_grouped_attributes: semconv_grouped_attributes({}); + +# Generic Signal Functions + +# Groups the signals by their root namespace and sorts them by name. +# $signal is the type of signal to group. +def semconv_group_signals_by_root_namespace($signal): + group_by(.root_namespace) + | map({ root_namespace: .[0].root_namespace, ($signal): . | sort_by(.name) }); + +# Extracts and processes semantic convention signals based on provided options. +# $signal is the type of signal to process. +# $options is an object that can contain: +# - exclude_stability: a list of stability statuses to exclude. +# - exclude_deprecated: a boolean to exclude deprecated signals. +# - exclude_root_namespace: a list of root namespaces to exclude. +def semconv_signal($signal; $options): + .groups + | map(select(.type == $signal)) + | if ($options | has("exclude_stability")) then + map(select(.stability as $st | $options.exclude_stability | index($st) | not)) + else + . + end + | if ($options | has("exclude_deprecated") and $options.exclude_deprecated == true) then + map(select(.id | endswith(".deprecated") | not)) + else + . + end + | map(. + {root_namespace: (if .id | index(".") then .id | split(".") | .[1] else "other" end)}) + | if ($options | has("exclude_root_namespace")) then + map(select(.root_namespace as $st | $options.exclude_root_namespace | index($st) | not)) + else + . + end + | sort_by(.root_namespace); + +# Metric Functions +# Groups the metrics by their root namespace. +def semconv_group_metrics_by_root_namespace: semconv_group_signals_by_root_namespace("metrics"); + +# Extracts and processes semantic convention metrics based on provided options. +# $options is an object that can contain: +# - exclude_stability: a list of stability statuses to exclude. +# - exclude_deprecated: a boolean to exclude deprecated metrics. +# - exclude_root_namespace: a list of root namespaces to exclude. +def semconv_metrics($options): semconv_signal("metric"; $options); + +# Convenience function to extract all metrics without any filtering options. +def semconv_metrics: semconv_metrics({}); + +# Groups the processed metrics by their root namespace based on provided options. +# $options is an object that can contain: +# - exclude_stability: a list of stability statuses to exclude. +# - exclude_deprecated: a boolean to exclude deprecated metrics. +# - exclude_root_namespace: a list of root namespaces to exclude. +def semconv_grouped_metrics($options): semconv_metrics($options) | semconv_group_metrics_by_root_namespace; + +# Convenience function to group all metrics by their root namespace without any filtering options. +def semconv_grouped_metrics: semconv_grouped_metrics({}); diff --git a/docs/images/dependencies.svg b/docs/images/dependencies.svg index 4a273d14..4a084088 100644 --- a/docs/images/dependencies.svg +++ b/docs/images/dependencies.svg @@ -1,7 +1,7 @@ -