Setting a time limit for each stage












3















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.










share|improve this question





























    3















    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.










    share|improve this question



























      3












      3








      3


      1






      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '18 at 16:00









      Federico Grandi

      2,82321127




      2,82321127










      asked Nov 13 '18 at 9:12









      Pranav RajPranav Raj

      363214




      363214
























          2 Answers
          2






          active

          oldest

          votes


















          1














          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.



          enter image description here



          Timeout is shown in log:
          enter image description here



          This is log of build step:
          1. Echo "starting sleep"
          2. sleep 120
          3. echo "slept"



          Notice that slept is also print out!
          enter image description here






          share|improve this answer
























          • 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



















          0














          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.



          enter image description here






          share|improve this answer

























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            1














            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.



            enter image description here



            Timeout is shown in log:
            enter image description here



            This is log of build step:
            1. Echo "starting sleep"
            2. sleep 120
            3. echo "slept"



            Notice that slept is also print out!
            enter image description here






            share|improve this answer
























            • 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
















            1














            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.



            enter image description here



            Timeout is shown in log:
            enter image description here



            This is log of build step:
            1. Echo "starting sleep"
            2. sleep 120
            3. echo "slept"



            Notice that slept is also print out!
            enter image description here






            share|improve this answer
























            • 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














            1












            1








            1







            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.



            enter image description here



            Timeout is shown in log:
            enter image description here



            This is log of build step:
            1. Echo "starting sleep"
            2. sleep 120
            3. echo "slept"



            Notice that slept is also print out!
            enter image description here






            share|improve this answer













            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.



            enter image description here



            Timeout is shown in log:
            enter image description here



            This is log of build step:
            1. Echo "starting sleep"
            2. sleep 120
            3. echo "slept"



            Notice that slept is also print out!
            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 13 '18 at 15:52









            Panu OksalaPanu Oksala

            2,0601323




            2,0601323













            • 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











            • 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













            0














            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.



            enter image description here






            share|improve this answer






























              0














              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.



              enter image description here






              share|improve this answer




























                0












                0








                0







                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.



                enter image description here






                share|improve this answer















                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.



                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 13 '18 at 15:58

























                answered Nov 13 '18 at 15:51









                DanDanDanDan

                1101211




                1101211






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Bressuire

                    Vorschmack

                    Quarantine