Just curious if there are any useful tricks in the current state and/or future plans to be able to output more deliberate, high-level messages to the caller of a dagger function in a "nice" way.
Printing to stdout kinda does the job (IME works a bit better in the "unhappy" case when the overall dagger call errors out) but it still gets lost in the verbose dagger engine output.
I don't necessarily mind the verbose --progress plain output, but it would be great if we could have an API to print a high-level user-directed message that would somehow "stand out" there.
#API for user-friendly output messages?
1 messages · Page 1 of 1 (latest)
If you use an OTEL library, you can create custom spans that will be displayed in the default trace view both locally and in Cloud. Having said that, I'm not exactly sure what the current mechanism - if any - is to make them always be displayed in the output. cc @bleak frost who surely knows
OTel spans should just show up, yeah, no additional tricks needed, though whether they're visible enough for this is another question - I've mentioned in other threads an idea of promoting a span to the top-level, but the idea isn't fully baked
Is there a global trace (perhaps on the Context ?) I can add spans to? (sorry if this is in the docs somewhere, didn't manage to find anything)
You would need the ID of the root span, but I don't think there's a way to access it
so it's not really supported then or how else would I do it if that's not exposed?
Dagger already sets all the necessary traceparent settings so if you create OTEL spans withing your application, they will automatically be connected to your function's span in the trace
what Alex is referring to is that you don't have way to connect your spans to the root span, but they'll be connected to your dagger function span