Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add created_at field to workflow_job event #1881

Closed
npalm opened this issue May 10, 2022 · 6 comments
Closed

Add created_at field to workflow_job event #1881

npalm opened this issue May 10, 2022 · 6 comments
Labels
Actions Feature Feature requires both runner, pipelines service and launch changes enhancement New feature or request

Comments

@npalm
Copy link

npalm commented May 10, 2022

Describe the enhancement
At field created_at toworkflow_job event to calculate time that it takes start jobs from the moment the event was created.

Code Snippet
n/a

Additional information
We are creating some metrics to keep track of our fleet of self-hosted runners. For our users one of the most important things is, is the time it takes to start a job from the moment the event was created. This indicator indicates the time it takes from the moment a job is triggered it got start on the agent. For our self-hosted runners it means the time it takes to potentially create an istance start the agent. See also issue

The workflow jobs event sent when the job is queued contains a field started_at. This is the moment the job is triggerd. Later we got an event when the job is started. Now the field started_at is updated. The diff between two timestamps is the time it takes to start the job. Calculationg the diff seems trivvial, but requires keep track on the state and or matching the events. The actions/runs API contains a created_at timestamp. Looks like the suite created for the job once the job was started.

To calculate the time in uncomplicated way it would be very helpfull when the created_at time is added to the workflow_job events.

@ruvceskistefan
Copy link
Contributor

Hi @npalm,
Thanks for reporting this enhancement request. I added it to the board, so we're going to consider it and work on it in the future.

@npalm
Copy link
Author

npalm commented May 16, 2022

@ruvceskistefan is the board also public?

@ruvceskistefan
Copy link
Contributor

@npalm no, the board is private and only team members can view it.

@nikola-jokic nikola-jokic added the Actions Feature Feature requires both runner, pipelines service and launch changes label Jul 11, 2022
@jacola
Copy link

jacola commented Nov 30, 2022

@npalm, not sure if it helps, but I created a sample webhook for someone looking to monitor queue time that shows how to capture that data after receiving similar requests from several GitHub admins.

@equalizer999
Copy link

There is actively work being done to add this to the event body (PR pending). ETA (for GA) - unknown still.

@TingluoHuang
Copy link
Member

The change has been deployed, and the workflow_job payload should have a created_at field now. 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Feature Feature requires both runner, pipelines service and launch changes enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants