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 setting to enable log timestamps #2147

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

AlanGreene
Copy link
Member

@AlanGreene AlanGreene commented Jul 26, 2021

Changes

Depends on #2146
Closes #2145

Add a toggle to the Settings page to allow users to display timestamps
on the step container logs. This produces a timestamp prefix on each
line in the same way as kubectl logs <pod> --timestamps and uses
the functionality provided by the Kubernetes API server.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 26, 2021
@AlanGreene AlanGreene force-pushed the log_timestamps_settings branch 2 times, most recently from d807bd0 to bac12da Compare July 28, 2021 09:17
@AlanGreene AlanGreene marked this pull request as ready for review July 28, 2021 09:17
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 28, 2021
@AlanGreene AlanGreene requested review from briangleeson and removed request for ziheng July 28, 2021 09:17
@LyndseyBu
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2021
Copy link
Contributor

@briangleeson briangleeson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2021
@tekton-robot tekton-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm Indicates that a PR is ready to be merged. labels Jul 29, 2021
@AlanGreene AlanGreene force-pushed the log_timestamps_settings branch 2 times, most recently from fd16f9a to 7db295b Compare July 29, 2021 14:25
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2021
@AlanGreene
Copy link
Member Author

@briangleeson rebased to resolve merge conflict

Add a toggle to the Settings page to allow users to display timestamps
on the step container logs. This produces a timestamp prefix on each
line in the same way as `kubectl logs <pod> --timestamps` and uses
the functionality provided by the Kubernetes API server.
Copy link
Contributor

@briangleeson briangleeson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2021
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: briangleeson

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot merged commit 2bf35bd into tektoncd:main Jul 29, 2021
@AlanGreene AlanGreene deleted the log_timestamps_settings branch July 29, 2021 16:28
@qaifshaikh
Copy link

Is this working? Can someone confirm what versions this actually works on?
we still don't see timestamps on the logs even when enabled on the dashboard 🤔
Can someone share a working screenshot?
cc @AlanGreene 🙏🏻

@AlanGreene
Copy link
Member Author

AlanGreene commented Oct 24, 2022

This was introduced in Dashboard v0.19.0 and is working as expected in recent releases.

Here's an example with it disabled:

image

Enable it in the settings:
image

View the same logs, now with timestamps:
image

You can test it for yourself at https://dashboard.dogfooding.tekton.dev/#/namespaces/tekton-ci/pipelineruns/9887b780-53c4-check-pr-has-kind-label-logs-stop?pipelineTask=create-data&step=write-data
(logs currently available but pod may be pruned soon)

If you're having trouble with this feature please open an issue with details or join us on Slack and we'll see what we can do to help.

@qaifshaikh
Copy link

qaifshaikh commented Oct 24, 2022

Great! Can confirm, it works on v0.19.0 and above. Thanks @AlanGreene

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add timestamps fo console log
5 participants