Skip to content

Commit

Permalink
Make sure that events contain metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
MaeIsBad committed Mar 1, 2024
1 parent d891379 commit 38f0c44
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
jaeger:
image: jaegertracing/all-in-one:1.35
ports:
- "16685:16685"
- "16686:16686"
- "55681:55681"
environment:
COLLECTOR_OTLP_ENABLED: "true"
Expand Down
23 changes: 23 additions & 0 deletions tests/e2e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,26 @@ async fn traces_are_sent_to_datadog() {
let msg = spans[0].logs[0].fields[0].v_str.as_str();
assert_eq!(log_message, msg);
}

#[cfg(feature = "traces")]
#[tokio::test(flavor = "multi_thread")]
async fn events_contain_metadata() {
let spans = get_spans(|| {
let span = tracing::info_span!("my span");
span.in_scope(|| {
tracing::info!(hello = "meta!", "meta?");
});
})
.await
.expect("Failed to fetch traces from jaeger");

assert_eq!(
"meta!",
&spans[0].logs[0]
.fields
.iter()
.find(|f| f.key == "hello")
.unwrap()
.v_str
);
}

0 comments on commit 38f0c44

Please sign in to comment.