Setting a time limit for each stage
I have created a DevOps pipeline with multiple stages. The entire pipeline takes a lot of time to finish. So I want a quick way to monitor if the pipeline is stuck in some stage or not, and would like to add better monitoring on stage-level.
Is there an option to set a time limit on stage, beyond which I will get notified about the delay. It doesn't need to cancel the stage beyond the time limit, just notify me.
azure-devops devops
add a comment |
I have created a DevOps pipeline with multiple stages. The entire pipeline takes a lot of time to finish. So I want a quick way to monitor if the pipeline is stuck in some stage or not, and would like to add better monitoring on stage-level.
Is there an option to set a time limit on stage, beyond which I will get notified about the delay. It doesn't need to cancel the stage beyond the time limit, just notify me.
azure-devops devops
add a comment |
I have created a DevOps pipeline with multiple stages. The entire pipeline takes a lot of time to finish. So I want a quick way to monitor if the pipeline is stuck in some stage or not, and would like to add better monitoring on stage-level.
Is there an option to set a time limit on stage, beyond which I will get notified about the delay. It doesn't need to cancel the stage beyond the time limit, just notify me.
azure-devops devops
I have created a DevOps pipeline with multiple stages. The entire pipeline takes a lot of time to finish. So I want a quick way to monitor if the pipeline is stuck in some stage or not, and would like to add better monitoring on stage-level.
Is there an option to set a time limit on stage, beyond which I will get notified about the delay. It doesn't need to cancel the stage beyond the time limit, just notify me.
azure-devops devops
azure-devops devops
edited Nov 13 '18 at 16:00
Federico Grandi
3,27521230
3,27521230
asked Nov 13 '18 at 9:12
Pranav RajPranav Raj
366214
366214
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can set timeout for build step and also check "Continue on error". However timeout will cancel build step that takes too long, so they won't complete successfully. It depends on how the build step / script is implemented.
Then after every step add conditional build step for sending notification into mail/slack/teams/whatever.
An easy way to test this is create a command line build step and add "Sleep 120" as command. Then set timeout of that build step to 1 minute.
Timeout is shown in log:
This is log of build step:
1. Echo "starting sleep"
2. sleep 120
3. echo "slept"
Notice that slept is also print out!
What if I do not want to cancel the running script? I just want to be notified that it is taking more time than I expected and this might result in the delay of completion of the release pipeline.
– Pranav Raj
Nov 13 '18 at 16:02
That is not possible without custom implementation around your build steps like, timer in powershell script.
– Panu Oksala
Nov 13 '18 at 16:26
add a comment |
It seems like you cannot set a timeout for a stage, however you can set timeouts for individual agent jobs. That means if your stage has exactly one agent job, then that's what you need. If your stage has more than one job, then you'll have to split your desired stage timeout into smaller job timeouts.
See the screenshot, you can set it here.
As for the second part of your question, such a thing is not supported. But you can always cheat. There are a number of ways in which you can do this. The simplest option would probably be to have an additional agent job that is triggered in a way that it runs concurrently to your other/main job. In this job you could have a PS script running a loop for as long as your timeout is and if it exeeds the timeout it sends a delay notification.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53277466%2fsetting-a-time-limit-for-each-stage%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can set timeout for build step and also check "Continue on error". However timeout will cancel build step that takes too long, so they won't complete successfully. It depends on how the build step / script is implemented.
Then after every step add conditional build step for sending notification into mail/slack/teams/whatever.
An easy way to test this is create a command line build step and add "Sleep 120" as command. Then set timeout of that build step to 1 minute.
Timeout is shown in log:
This is log of build step:
1. Echo "starting sleep"
2. sleep 120
3. echo "slept"
Notice that slept is also print out!
What if I do not want to cancel the running script? I just want to be notified that it is taking more time than I expected and this might result in the delay of completion of the release pipeline.
– Pranav Raj
Nov 13 '18 at 16:02
That is not possible without custom implementation around your build steps like, timer in powershell script.
– Panu Oksala
Nov 13 '18 at 16:26
add a comment |
You can set timeout for build step and also check "Continue on error". However timeout will cancel build step that takes too long, so they won't complete successfully. It depends on how the build step / script is implemented.
Then after every step add conditional build step for sending notification into mail/slack/teams/whatever.
An easy way to test this is create a command line build step and add "Sleep 120" as command. Then set timeout of that build step to 1 minute.
Timeout is shown in log:
This is log of build step:
1. Echo "starting sleep"
2. sleep 120
3. echo "slept"
Notice that slept is also print out!
What if I do not want to cancel the running script? I just want to be notified that it is taking more time than I expected and this might result in the delay of completion of the release pipeline.
– Pranav Raj
Nov 13 '18 at 16:02
That is not possible without custom implementation around your build steps like, timer in powershell script.
– Panu Oksala
Nov 13 '18 at 16:26
add a comment |
You can set timeout for build step and also check "Continue on error". However timeout will cancel build step that takes too long, so they won't complete successfully. It depends on how the build step / script is implemented.
Then after every step add conditional build step for sending notification into mail/slack/teams/whatever.
An easy way to test this is create a command line build step and add "Sleep 120" as command. Then set timeout of that build step to 1 minute.
Timeout is shown in log:
This is log of build step:
1. Echo "starting sleep"
2. sleep 120
3. echo "slept"
Notice that slept is also print out!
You can set timeout for build step and also check "Continue on error". However timeout will cancel build step that takes too long, so they won't complete successfully. It depends on how the build step / script is implemented.
Then after every step add conditional build step for sending notification into mail/slack/teams/whatever.
An easy way to test this is create a command line build step and add "Sleep 120" as command. Then set timeout of that build step to 1 minute.
Timeout is shown in log:
This is log of build step:
1. Echo "starting sleep"
2. sleep 120
3. echo "slept"
Notice that slept is also print out!
answered Nov 13 '18 at 15:52
Panu OksalaPanu Oksala
2,0981324
2,0981324
What if I do not want to cancel the running script? I just want to be notified that it is taking more time than I expected and this might result in the delay of completion of the release pipeline.
– Pranav Raj
Nov 13 '18 at 16:02
That is not possible without custom implementation around your build steps like, timer in powershell script.
– Panu Oksala
Nov 13 '18 at 16:26
add a comment |
What if I do not want to cancel the running script? I just want to be notified that it is taking more time than I expected and this might result in the delay of completion of the release pipeline.
– Pranav Raj
Nov 13 '18 at 16:02
That is not possible without custom implementation around your build steps like, timer in powershell script.
– Panu Oksala
Nov 13 '18 at 16:26
What if I do not want to cancel the running script? I just want to be notified that it is taking more time than I expected and this might result in the delay of completion of the release pipeline.
– Pranav Raj
Nov 13 '18 at 16:02
What if I do not want to cancel the running script? I just want to be notified that it is taking more time than I expected and this might result in the delay of completion of the release pipeline.
– Pranav Raj
Nov 13 '18 at 16:02
That is not possible without custom implementation around your build steps like, timer in powershell script.
– Panu Oksala
Nov 13 '18 at 16:26
That is not possible without custom implementation around your build steps like, timer in powershell script.
– Panu Oksala
Nov 13 '18 at 16:26
add a comment |
It seems like you cannot set a timeout for a stage, however you can set timeouts for individual agent jobs. That means if your stage has exactly one agent job, then that's what you need. If your stage has more than one job, then you'll have to split your desired stage timeout into smaller job timeouts.
See the screenshot, you can set it here.
As for the second part of your question, such a thing is not supported. But you can always cheat. There are a number of ways in which you can do this. The simplest option would probably be to have an additional agent job that is triggered in a way that it runs concurrently to your other/main job. In this job you could have a PS script running a loop for as long as your timeout is and if it exeeds the timeout it sends a delay notification.
add a comment |
It seems like you cannot set a timeout for a stage, however you can set timeouts for individual agent jobs. That means if your stage has exactly one agent job, then that's what you need. If your stage has more than one job, then you'll have to split your desired stage timeout into smaller job timeouts.
See the screenshot, you can set it here.
As for the second part of your question, such a thing is not supported. But you can always cheat. There are a number of ways in which you can do this. The simplest option would probably be to have an additional agent job that is triggered in a way that it runs concurrently to your other/main job. In this job you could have a PS script running a loop for as long as your timeout is and if it exeeds the timeout it sends a delay notification.
add a comment |
It seems like you cannot set a timeout for a stage, however you can set timeouts for individual agent jobs. That means if your stage has exactly one agent job, then that's what you need. If your stage has more than one job, then you'll have to split your desired stage timeout into smaller job timeouts.
See the screenshot, you can set it here.
As for the second part of your question, such a thing is not supported. But you can always cheat. There are a number of ways in which you can do this. The simplest option would probably be to have an additional agent job that is triggered in a way that it runs concurrently to your other/main job. In this job you could have a PS script running a loop for as long as your timeout is and if it exeeds the timeout it sends a delay notification.
It seems like you cannot set a timeout for a stage, however you can set timeouts for individual agent jobs. That means if your stage has exactly one agent job, then that's what you need. If your stage has more than one job, then you'll have to split your desired stage timeout into smaller job timeouts.
See the screenshot, you can set it here.
As for the second part of your question, such a thing is not supported. But you can always cheat. There are a number of ways in which you can do this. The simplest option would probably be to have an additional agent job that is triggered in a way that it runs concurrently to your other/main job. In this job you could have a PS script running a loop for as long as your timeout is and if it exeeds the timeout it sends a delay notification.
edited Nov 13 '18 at 15:58
answered Nov 13 '18 at 15:51
DanDanDanDan
1411212
1411212
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53277466%2fsetting-a-time-limit-for-each-stage%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown