Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions opentelemetry-appender-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ use opentelemetry::{
};
#[cfg(feature = "experimental_metadata_attributes")]
use opentelemetry_semantic_conventions::attribute::{
CODE_FILEPATH, CODE_LINE_NUMBER, CODE_NAMESPACE,
CODE_FILE_PATH, CODE_FUNCTION_NAME, CODE_LINE_NUMBER,
};

pub struct OpenTelemetryLogBridge<P, L>
Expand Down Expand Up @@ -156,7 +156,7 @@ where
{
if let Some(filepath) = record.file() {
log_record.add_attribute(
Key::new(CODE_FILEPATH),
Key::new(CODE_FILE_PATH),
AnyValue::from(filepath.to_string()),
);
}
Expand All @@ -167,7 +167,7 @@ where

if let Some(module) = record.module_path() {
log_record.add_attribute(
Key::new(CODE_NAMESPACE),
Key::new(CODE_FUNCTION_NAME),
AnyValue::from(module.to_string()),
);
}
Expand Down Expand Up @@ -1180,7 +1180,7 @@ mod tests {
#[test]
fn logbridge_code_attributes() {
use opentelemetry_semantic_conventions::attribute::{
CODE_FILEPATH, CODE_LINE_NUMBER, CODE_NAMESPACE,
CODE_FILE_PATH, CODE_FUNCTION_NAME, CODE_LINE_NUMBER,
};

let exporter = InMemoryLogExporter::default();
Expand Down Expand Up @@ -1219,11 +1219,11 @@ mod tests {

assert_eq!(
Some(AnyValue::String(StringValue::from("src/main.rs"))),
get(CODE_FILEPATH)
get(CODE_FILE_PATH)
);
assert_eq!(
Some(AnyValue::String(StringValue::from("service"))),
get(CODE_NAMESPACE)
get(CODE_FUNCTION_NAME)
);
assert_eq!(Some(AnyValue::Int(101)), get(CODE_LINE_NUMBER));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CRATE_DIR="${SCRIPT_DIR}/../"

# freeze the spec version and generator version to make generation reproducible
SPEC_VERSION=1.31.0
WEAVER_VERSION=v0.13.0
SPEC_VERSION=1.32.0
WEAVER_VERSION=v0.13.2

cd "$CRATE_DIR"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#[cfg(feature = "semconv_experimental")]
{% endif %}
{% if attr is deprecated %}
#[deprecated(note="{{ attr.deprecated.strip(" \n\"") }}")]
#[deprecated(note="{{ attr.deprecated | replace('\n', ' ') | replace('"', '') | trim }}")]
{% endif %}
pub const {{ attr.name | screaming_snake_case }}: &str = "{{ attr.name }}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#[cfg(feature = "semconv_experimental")]
{% endif %}
{% if metric is deprecated %}
#[deprecated(note="{{ metric.deprecated.strip(" \n\"") }}")]
#[deprecated(note="{{ metric.deprecated | replace('"', '') | replace('\n', ' ') | trim }}")]
{% endif %}
pub const {{ metric.metric_name | screaming_snake_case }}: &str = "{{ metric.metric_name }}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ comment_formats:
default_comment_format: rust

params:
schema_url: "https://opentelemetry.io/schemas/1.31.0"
schema_url: "https://opentelemetry.io/schemas/1.32.0"
exclude_root_namespace: []
excluded_attributes: ["messaging.client_id"]

Expand Down
Loading
Loading