Skip to content

Commit 6d3bea7

Browse files
authored
Add name to info logs in OTLP Example (#1802)
1 parent 6d4ae87 commit 6d3bea7

File tree

1 file changed

+2
-2
lines changed
  • opentelemetry-otlp/examples/basic-otlp/src

1 file changed

+2
-2
lines changed

opentelemetry-otlp/examples/basic-otlp/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
142142
);
143143
span.set_attribute(KeyValue::new("another.key", "yes"));
144144

145-
info!(target: "my-target", "hello from {}. My price is {}. I am also inside a Span!", "banana", 2.99);
145+
info!(name: "my-event-inside-span", target: "my-target", "hello from {}. My price is {}. I am also inside a Span!", "banana", 2.99);
146146

147147
tracer.in_span("Sub operation...", |cx| {
148148
let span = cx.span();
@@ -151,7 +151,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
151151
});
152152
});
153153

154-
info!(target: "my-target", "hello from {}. My price is {}", "apple", 1.99);
154+
info!(name: "my-event", target: "my-target", "hello from {}. My price is {}", "apple", 1.99);
155155

156156
global::shutdown_tracer_provider();
157157
logger_provider.shutdown()?;

0 commit comments

Comments
 (0)