Hi! Is the duration for each substep (the right hand side of the back box) stored as an environment variable or retrievable via the API? Thanks!
Hey @tachpolapplied
,
This is Suma from Buildkite support team. First of all welcome to Buildkite community and thank you for reaching out to us with your question.
Each substep duration you see in the UI is not available as part of environment variable or via API as it is calculated on the fly based on the log timestamps while log grouping happens.
One option is you can get each job log output using the API Jobs API | Buildkite Documentation where it has header timestamps from which you can calculate that. I agree it involves additional work but thats an option at the moment.
Please let us know if you have any follow up questions.
Thanks,
Suma
Sounds like that should work. Thank you!
hi @suma , I was able to make a get request request here based on the docs, where it returned the full logs successfully with the size, but the header_times is empty:
get (“https://api.buildkite.com/v2/organizations/{}/pipelines/{}/builds/{}/jobs/{}/log”)
is there anything I can do here to get the header_times?
I am getting an empty list in return:
{super long content,
‘size’: 267199,
‘header_times’: }
Hi @tachpolapplied ,
For the header_times to be set on a job, your agent must be started with the --no-ansi-timestamps flag enabled. You can read more about in in our docs buildkite-agent start v3 | Buildkite Documentation .
Hope this helps!
Cheers,
Lizette
