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

Provide / improve "timestamp" logging #419

Closed
oalyman opened this issue Jan 24, 2022 · 4 comments
Closed

Provide / improve "timestamp" logging #419

oalyman opened this issue Jan 24, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@oalyman
Copy link
Contributor

oalyman commented Jan 24, 2022

Currently it is pretty hard to tell which parts of the build took how long.

Especially inside one task you have no chance to see where the most time is spent, if the called piece of logic does not tell you by it's nature.

It would be nice to alleviate this at least a little, for example by using the time command.

@oalyman oalyman added the enhancement New feature or request label Jan 24, 2022
@henrjk
Copy link
Member

henrjk commented Feb 15, 2022

In PR #412 I also proposed to add some code to show how long commands which are expected to take long take.

Now I had seconds thoughts on this as one can get already timestamps like this:

oc logs --timestamps admin-feature-foo-749-explore-caching-during-builds-69z39-656jt -c step-build-typescript
2022-02-15T10:28:15.528200620Z ++ node --version
2022-02-15T10:28:15.536235689Z + echo node version: v16.13.1
2022-02-15T10:28:15.536266379Z node version: v16.13.1
...
2022-02-15T10:28:36.921472418Z + npm run build
2022-02-15T10:28:37.303839957Z 
...
2022-02-15T10:28:43.548732756Z + cp -r node_modules ../docker/dist-be/dist/node_modules
2022-02-15T10:28:44.511437067Z Testing ...

However it is a bit difficult to figure out the pod id and also one would need a view where it is easier to see which particular commands take long.

I found a few tidbits of info related to this:

  • Add setting to enable log timestamps by AlanGreene · Pull Request #2147 · tektoncd/dashboard. However I am not sure whether this dashboard is even part of our operator (version)?
  • Kibana shows timestamp and this might be the best tool to use. However it appears to require extra manual steps to get to the place of interest and appears to convoluted to use.
  • The Kubernetes vscode extension allows to list the timestamps at least, but does not make it easy to see which lines take long.
  • k9s can also provide timestamps. However I did not manage to retrieve it from a tekton pod, where it only shows an EOF. This could be a pilot error.

Assuming the timestamps are reliable it feels a bit silly to add our own timestamps just because there is currently no convenient tool to highlight what takes long during a build.
Perhaps we could even write a small command line tool which would easily download the tekton build logs and highlight steps taking most of the time for example. On the other hand this seems silly as well as you'd expect such tools to already exist.

Thoughts?

@michaelsauter
Copy link
Member

michaelsauter commented Feb 15, 2022

@henrjk Nice find! Also I agree with the points you raise.

So ... at least we have a solution of some sort now, maybe something to document in the FAQ?

FWIW, I believe the dashboard is not part of the OpenShift Pipelines operator. I think the UI is a custom development. At least there is no reference in https://docs.openshift.com/container-platform/4.9/cicd/pipelines/op-release-notes.html.

@henrjk
Copy link
Member

henrjk commented Apr 29, 2022

I recently discovered that one can enable showing timestamps on the GitHub actions log console.

Screen Shot 2022-04-29 at 07 48 13

@michaelsauter
Copy link
Member

There is a relatively easy way to see timestamps via the tkn binary. I have documented this in the FAQ: https://github.com/opendevstack/ods-pipeline/wiki/FAQ#how-can-i-see-pipeline-run-logs-with-timestamps.

Since the feature already exists and it would not be valuable to do something on top in ODS Pipeline, I am going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants