#Dagger Cloud full trace URL command?
1 messages ยท Page 1 of 1 (latest)
@ebon grove would it be better if you can the URL within your pipeline?
or you need / prefer to get it from the CLI stdout?
@orchid hatch we were hoping maybe to be able to display the link to dagger cloud inside a GitHub Actions job summary
Do you suggest we should try and extract the URL from the stdout by following a given pattern?
but the CLI already prints the URL each time you do a dagger call right?
exactly, the only thing is that it can be buried at the end of lots of logs, and it can be tedious to go and fetch it way down the workflow logs
I was wondering if there was a dedicated way of retrieving this info and then expose it differently
gotcha. You have two options:
-
You can print the URL withing your pipeline at the very end.
-
You can send the engine logs to a file with
dagger call | tee logs.txtand then run another command withgrep "https://dagger.cloud" logs.txtafter the dagger call
both work
Hmm, is the first option corresponding to the actual situation, where Dagger prints the URL automatically as soon as the token is set?
Or is there another way to have it printed? ๐
there's another way
you can print it within your pipeline
so it gets printed at the end of the function
what SDK are you currently using?
we are currently using Python SDK
Hello @orchid hatch, sorry to bother you, I'm really curious to know about this other way to retrieve the URL ๐
hey, sorry! let me give you an example really quick ๐
here's a way you can achieve it:
def container_echo(self, string_arg: str) -> dagger.Container:
with get_tracer().start_as_current_span("test") as span:
trace = span.get_span_context().trace_id
print(
f"the url is https://dagger.cloud/$org/traces/{trace:x}",
)
^ with that you get the trace_id and then you should be able to construct the URL to navigate to it
having said that, in v0.16.2 at least, the call trace URL gets printed at the very end of the pipeline so I'm wondering if you're being able to see it at the end of the pipeline in your case
here's my output for example:
122 : Pytest.containerEcho CACHED [1.5s] | CPU Pressure (some): 319ยตs | CPU Pressure (full): 319ยตs | Memory Bytes (current): 5.4 MB | Memory Bytes (peak): 61 MB
1 : stdout
130 : โ Container.stdout: String!
130 : โ Container.stdout DONE [0.0s]
1 : stdout
1 : [3.4s] | obye
1 : [3.4s] |
1 : stdout DONE [3.6s]
Full trace at https://dagger.cloud/marcos-test/traces/3ae36445d077a2f4505e5365dd706d5e
Thank you Marcos for your detailed answer!
Regarding the code sample, I would have hoped for a more direct access to the full URL (including the org value which is retrieved from the token), maybe something like a getter on the engine object or something like this ๐
I agree that the full trace URL is printed at the end of the pipeline, my concern is that we haven't found the right log level to set on our CI, and as I said before this URL can be buried under tons of logs. I wished I could find a way to easily print the cloud URL in GitHub actions job summary for instance.
Thanks again for the time taken! ๐