Skip to content

Commit

Permalink
Cleanup unused legacy semconv tags (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeschastny authored Oct 7, 2024
1 parent 9e6cae0 commit 0c20ab8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 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: 6 additions & 4 deletions src/middleware/aws/operations/dynamodb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ use crate::{semconv, Key, KeyValue, StringValue};

use super::*;

#[allow(deprecated)]
pub const LEGACY_DB_NAME: &str = semconv::DB_NAME;

pub enum DynamodbSpanBuilder {}

impl<'a> AwsSpanBuilder<'a> {
Expand All @@ -15,14 +18,13 @@ 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(LEGACY_DB_NAME, table_names[0].clone()),
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 @@ -72,8 +74,8 @@ macro_rules! dynamodb_table_arn_operation {
std::iter::empty::<StringValue>(),
)
.attributes(vec![
KeyValue::new(semconv::DB_NAMESPACE, table_arn.clone()),
KeyValue::new(semconv::legacy::DB_NAME, table_arn),
KeyValue::new(LEGACY_DB_NAME, table_arn.clone()),
KeyValue::new(semconv::DB_NAMESPACE, table_arn),
])
}
}
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 0c20ab8

Please sign in to comment.