Skip to content

Commit

Permalink
Cleanup legacy semconv tags
Browse files Browse the repository at this point in the history
this may be a breaking change
  • Loading branch information
lbeschastny committed Oct 7, 2024
1 parent 9e6cae0 commit 6ebc157
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ use tracing_subscriber::layer::SubscriberExt;
use opentelemetry::trace::TracerProvider as _;
pub use opentelemetry::{global, Array, Context, Key, KeyValue, StringValue, Value};
pub use opentelemetry_sdk::trace::TracerProvider;
pub use opentelemetry_semantic_conventions::attribute as semconv;
pub use tracing_opentelemetry::{OpenTelemetryLayer, OpenTelemetrySpanExt};

pub mod http;
pub mod middleware;
pub mod otlp;
pub mod propagation;
pub mod semconv;

#[cfg(feature = "axum")]
pub use tracing_opentelemetry_instrumentation_sdk;
Expand Down
10 changes: 4 additions & 6 deletions src/middleware/aws/operations/dynamodb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ impl<'a> AwsSpanBuilder<'a> {
let mut attributes = vec![
KeyValue::new(semconv::DB_SYSTEM, "dynamodb"),
KeyValue::new(semconv::DB_OPERATION_NAME, method.clone()),
KeyValue::new(semconv::legacy::DB_OPERATION, method.clone()),
];
match table_names.len() {
0 => {}
1 => {
attributes.extend([
KeyValue::new(semconv::DB_NAMESPACE, table_names[0].clone()),
KeyValue::new(semconv::legacy::DB_NAME, table_names[0].clone()),
Key::new(semconv::AWS_DYNAMODB_TABLE_NAMES).array(table_names),
]);
}
Expand Down Expand Up @@ -71,10 +69,10 @@ macro_rules! dynamodb_table_arn_operation {
stringify_camel!($op),
std::iter::empty::<StringValue>(),
)
.attributes(vec![
KeyValue::new(semconv::DB_NAMESPACE, table_arn.clone()),
KeyValue::new(semconv::legacy::DB_NAME, table_arn),
])
.attributes(vec![KeyValue::new(
semconv::DB_NAMESPACE,
table_arn.clone(),
)])
}
}
};
Expand Down
4 changes: 0 additions & 4 deletions src/middleware/aws/operations/firehose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ impl<'a> AwsSpanBuilder<'a> {
let mut attributes = vec![
KeyValue::new(semconv::MESSAGING_SYSTEM, "aws_firehose"),
KeyValue::new(semconv::MESSAGING_OPERATION_TYPE, operation_kind.as_str()),
KeyValue::new(
semconv::legacy::MESSAGING_OPERATION,
operation_kind.as_str(),
),
];
if let Some(stream_name) = stream_name {
attributes.push(KeyValue::new(
Expand Down
4 changes: 0 additions & 4 deletions src/middleware/aws/operations/sns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ impl<'a> AwsSpanBuilder<'a> {
let mut attributes = vec![
KeyValue::new(semconv::MESSAGING_SYSTEM, "aws_sns"),
KeyValue::new(semconv::MESSAGING_OPERATION_TYPE, operation_kind.as_str()),
KeyValue::new(
semconv::legacy::MESSAGING_OPERATION,
operation_kind.as_str(),
),
];
if let Some(topic_arn) = topic_arn {
attributes.push(KeyValue::new(
Expand Down
8 changes: 0 additions & 8 deletions src/semconv.rs

This file was deleted.

0 comments on commit 6ebc157

Please sign in to comment.