Skip to content

Commit 481b841

Browse files
committed
Make MESSAGING_DESTINATION_PUBLISH_* consts public
1 parent cee5807 commit 481b841

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use tracing_subscriber::layer::SubscriberExt;
1313

1414
pub use opentelemetry::{Array, Context, Key, KeyValue, StringValue, Value};
1515
pub use opentelemetry_sdk::trace::TracerProvider;
16-
pub use opentelemetry_semantic_conventions::{resource, trace as semconv};
16+
pub use opentelemetry_semantic_conventions::resource;
1717
pub use tracing_opentelemetry::OpenTelemetrySpanExt;
1818

1919
pub mod middleware;
@@ -35,6 +35,15 @@ pub mod future;
3535
mod filter;
3636
mod util;
3737

38+
pub mod semconv {
39+
pub use opentelemetry_semantic_conventions::trace::*;
40+
41+
pub const MESSAGING_DESTINATION_PUBLISH_NAME: &str =
42+
"messaging.destination_publish.name";
43+
pub const MESSAGING_DESTINATION_PUBLISH_ANONYMOUS: &str =
44+
"messaging.destination_publish.anonymous";
45+
}
46+
3847
#[derive(Debug, Default)]
3948
pub struct DetectResource {
4049
fallback_service_name: &'static str,

src/middleware/lambda/context.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::semconv;
12
use lambda_runtime::LambdaInvocation;
23
use opentelemetry::trace::SpanKind;
34
use opentelemetry_sdk::trace::TracerProvider;
@@ -9,11 +10,6 @@ use super::{
910
OtelLambdaLayer,
1011
};
1112

12-
mod semconv {
13-
pub use crate::semconv::*;
14-
pub const MESSAGING_DESTINATION_PUBLISH_NAME: &str = "messaging.destination_publish.name";
15-
}
16-
1713
pub trait LambdaServiceContext {
1814
fn create_span(&self, req: &LambdaInvocation, coldstart: bool) -> Span;
1915
}

0 commit comments

Comments
 (0)