Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21208

Ability to open the console at a certain line, identified by a timestamp

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major Major
    • timestamper-plugin
    • None

      For example:
      http://localhost:8080/job/frog/11/console?elapsed=01:21

      ...could open the console at the line that was logged 1 hour 21 minutes after the build started.

      It is already possible to add anchor names into the time-stamp format, but this has several drawbacks:

      • There is no way to differentiate between multiple lines with the same time-stamp.
      • When opening the link, the breadcrumb bar appears on top of the target line.
      • Not all lines are displayed at the /console URL, and so some anchor links have no effect unless using the /consoleFull URL.

      Perhaps an offset could be used to distinguish between multiple lines with the same time-stamp, e.g.
      http://localhost:8080/job/frog/11/console?elapsed=01:21
      http://localhost:8080/job/frog/11/console?elapsed=01:21+1
      http://localhost:8080/job/frog/11/console?elapsed=01:21+2

      Raised in response to JENKINS-21171.

          [JENKINS-21208] Ability to open the console at a certain line, identified by a timestamp

          I'm happy with this behaviour

          Pedro Algarvio added a comment - I'm happy with this behaviour

          Oh, not only for elapsed please.

          Pedro Algarvio added a comment - Oh, not only for elapsed please.

          Steven G Brown added a comment - - edited

          I think it may be better to implement this in the Line Numbers plugin, so I've raised some issues there: JENKINS-41283, JENKINS-41284.

          Steven G Brown added a comment - - edited I think it may be better to implement this in the Line Numbers plugin, so I've raised some issues there: JENKINS-41283 , JENKINS-41284 .

          Sorin Sbarnea added a comment -

          There are several critical issue with line-number-plugin which rules it out as a solution for adding anchors/bookmarks to console output: is not maintained (last release in 2015) and it also has a breaking "feature" of also enabling collapsible sections, one feature that cannot be disabled.

          Now regarding the original request for implementing this feature: I would point out that using timestamp itself as the anchor is a bad idea. That's because timestamper is relative to the user: it can time elapsed time or a time, time that can be UTC or browser time, making the entire URL not sharable.

          Instead we should get this implemented in a simple and reliable way: just use the console line number, this one does not change and is sharable. Probably it would be easier if the timestamp text itself would become the anchor, but the anchor should be just `#linenumber`.

          I really hate that I am not able to share links to specific log lines, all the other major CI systems do have this implemented.

          Sorin Sbarnea added a comment - There are several critical issue with line-number-plugin which rules it out as a solution for adding anchors/bookmarks to console output: is not maintained (last release in 2015) and it also has a breaking "feature" of also enabling collapsible sections, one feature that cannot be disabled. Now regarding the original request for implementing this feature: I would point out that using timestamp itself as the anchor is a bad idea. That's because timestamper is relative to the user: it can time elapsed time or a time, time that can be UTC or browser time, making the entire URL not sharable. Instead we should get this implemented in a simple and reliable way: just use the console line number, this one does not change and is sharable. Probably it would be easier if the timestamp text itself would become the anchor, but the anchor should be just `#linenumber`. I really hate that I am not able to share links to specific log lines, all the other major CI systems do have this implemented.

          Sorin Sbarnea added a comment -

          In the long term, I would love to see the main 3 console annotating plugins merged into a single one so we can easily deployment and enable instance wide without having to modify job configs (xml or pipeline) in order to enable them.

          Doing ansi-colorer { timestamper { line-numbering

          { ... }

          } } seems like a lot of boilerplate for something that should live outside jenkins job definition. Still, that's a long term dream.

          Sorin Sbarnea added a comment - In the long term, I would love to see the main 3 console annotating plugins merged into a single one so we can easily deployment and enable instance wide without having to modify job configs (xml or pipeline) in order to enable them. Doing ansi-colorer { timestamper { line-numbering { ... } } } seems like a lot of boilerplate for something that should live outside jenkins job definition. Still, that's a long term dream.

          Daniel Beck added a comment -

          without having to modify job configs (xml or pipeline) in order to enable them.

          https://jenkins.io/doc/book/pipeline/shared-libraries/

          Daniel Beck added a comment - without having to modify job configs (xml or pipeline) in order to enable them. https://jenkins.io/doc/book/pipeline/shared-libraries/

          Sorin Sbarnea added a comment -

          danielbeck Yep, for pipelines we may have some workarounds but for freestyle jobs I don't see one, yet.

          Sorin Sbarnea added a comment - danielbeck Yep, for pipelines we may have some workarounds but for freestyle jobs I don't see one, yet.

          ssbarnea, I agree with you that using the line numbers is better. Couldn't the critical issues with the line numbers plugin be fixed?

          Steven G Brown added a comment - ssbarnea , I agree with you that using the line numbers is better. Couldn't the critical issues with the line numbers plugin be fixed?

          Sorin Sbarnea added a comment - - edited

          stevengbrown In fact I would vote for adding this functionality to this plugin. There are other concerns that do make me believe that we can provide a better UX if these two functionalities would be under the same plugin.

          They both add a prefix and we don't want two prefixes (both line number and timestamps) as this would cut from the horizontal real estate which is already an issue (imagine that I use a 13" monitor).

          So, I would consider this possible use cases:

          • System time, with checkbox for browser timezone
          • Elapsed time
          • *Line numbers (new feature)*
          • None

          Please note that I do see the anchoring/bookmarking as an assumed feature that is enabled for all options but None. In fact is very easy to implement this feature because all you have to do is to add:

          <a href=#L123>{current_annotation_prefix}</a>
          

          When a use wants to share a link, they only have to hover over the timestamp area, right click and copy link. Have a look at "competition" https://travis-ci.org/pycontribs/jira/jobs/194455319#L144

          Sorin Sbarnea added a comment - - edited stevengbrown In fact I would vote for adding this functionality to this plugin. There are other concerns that do make me believe that we can provide a better UX if these two functionalities would be under the same plugin. They both add a prefix and we don't want two prefixes (both line number and timestamps) as this would cut from the horizontal real estate which is already an issue (imagine that I use a 13" monitor). So, I would consider this possible use cases: System time, with checkbox for browser timezone Elapsed time * Line numbers (new feature) * None Please note that I do see the anchoring/bookmarking as an assumed feature that is enabled for all options but None. In fact is very easy to implement this feature because all you have to do is to add: <a href=#L123>{current_annotation_prefix}</a> When a use wants to share a link, they only have to hover over the timestamp area, right click and copy link. Have a look at "competition" https://travis-ci.org/pycontribs/jira/jobs/194455319#L144

          The Line Numbers Plugin provides a URL for each line in the console output, and the issues I raised for that plugin have now been fixed. Using line numbers in the URL is more straightforward than using timestamps and still provides the ability to jump to a line. Closing issue.

          s0undt3ch, please re-open if you would still like the ability to link based on a timestamp

          ssbarnea, please feel free to open a new issue about screen real estate

          Steven G Brown added a comment - The Line Numbers Plugin provides a URL for each line in the console output, and the issues I raised for that plugin have now been fixed. Using line numbers in the URL is more straightforward than using timestamps and still provides the ability to jump to a line. Closing issue. s0undt3ch , please re-open if you would still like the ability to link based on a timestamp ssbarnea , please feel free to open a new issue about screen real estate

            stevengbrown Steven G Brown
            stevengbrown Steven G Brown
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: