#Hey all! I've been stuck on this for a
1 messages · Page 1 of 1 (latest)
Hi! 👋 @wise spruce
// Emit custom spans for each test result file created
log := "🧪 Test Result:\n" + "test file:\n" + name + "\n" + "contents:\n" + content
_, span := Tracer().Start(ctx, log)
span.SetStatus(codes.Ok, "STATUS")
span.End()
Here's an example where I emit custom otel spans for each test file including the
- test file name
- test file contents
and then return the Directory full of test files at the end.
dagger call -m github.com/jpadams/suchacrisis test
At verbosity=2, I can see everything (dagger call test -v)
https://github.com/jpadams/suchacrisis/blob/main/main.go
I experimented with events, attributes, but couldn't get them to work. This simple span text and status works, though.
reference: https://opentelemetry.io/docs/concepts/signals/traces/#spans
Looks good in Dagger Cloud too!
cc @flint spear @opal elm @trail notch (since we're seeking examples for docs)
I notice that newlines (in each 🧪 Test Result:) are respected in the TUI, but not in the WebUI cc @hollow sparrow