#Custom Spans
1 messages · Page 1 of 1 (latest)
Yes! Underneath it’s all OTEL so we support custom spans out of the box.
Were still ironing out the DX but you can see an example in dagger/dagger here: https://github.com/dagger/dagger/blob/c344425308ad48d5634393328a3d937da19eb006/.dagger/docs.go#L60
There are also some ideas kicking around regarding search for span names/data in Dagger Cloud UI.
The filtering out/down use case is also interesting.
cc @bright walrus
I've also wondered if there should be a way to promote spans from deep within a call to the top level, which we could do with a special span attribute or something (dagger.io/ui.zoom=true, or dagger.io/ui.primary=true if we think there should just be one). All up in the air though
I have a few of these ugly spans i'd like to make prettier haha
okay i got around to cleaning up and figured out a nice pattern to avoid my ugly "bash -c ..." spans.
func ExecScript(container *dagger.Container, name string, contents string, optsMaybe ...dagger.ContainerWithExecOpts) *dagger.Container {
scriptFile := dag.Directory().WithNewFile(name, contents).File(name)
return container.WithFile(name, scriptFile).WithExec([]string{"sh", name}, optsMaybe...)
}
Now I use ```go
ExecScript(container, "START.sh", "<many-lines...>")
And see a nicer span based on `START.sh`.