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

broken header streamer after v3.48.0 #2464

Open
jiaquan1 opened this issue Oct 30, 2023 · 3 comments
Open

broken header streamer after v3.48.0 #2464

jiaquan1 opened this issue Oct 30, 2023 · 3 comments

Comments

@jiaquan1
Copy link

The ansi-timestamps experiment is enabled in v3.48.0 by default. The header line begins with _bk;t=1698038886128~~~ , the header streamer for header regex https://github.com/buildkite/agent/blob/24c562342c8dd3944b16bc6b87b501e304490e67/agent/header_times_streamer.go#L167C25-L167C74 broken, no header streamer anymore. The regex needs to be updated to headerRE = regexp.MustCompile(^(_bk;t=\d+(?:---|~~~|+++)\s(.+))$) to fix the header streamer.

@moskyb
Copy link
Contributor

moskyb commented Oct 30, 2023

hi there @jiaquan1! the old behaviour can be retained by specifying --no-ansi-timestamps in your agent configuration - this will remove the ansi-timestamps and go back to untimestamped output, which should match the header time regex.

ANSI timestamped output is sent without header times by design; the backend had to do a fair bit of work to untangle them and pull time between headers out for displaying the little histogram on the righthand side of the job logs:

CleanShot 2023-10-31 at 09 47 25@2x

the ansi timestamps feature attaches timestamps to lines individually, so it removes the need for the agent or the backend to do this extra work.

can i ask what your specific need for header times is, and how you were accessing them?

@jiaquan1
Copy link
Author

jiaquan1 commented Oct 30, 2023

We would like to have the timestamp and header times at the same time. In our log system, we get header streamer and the length of header time set in one job log, then our system will have to identify the same number of headers from this log. We use this log span tool to track how much time in each step (between each header). Now the length of header time set from our buildkite client API is 0, then our system won't work either.
Is there anyway to have ansi-timestamp steamer, similar as the header streamer in the past? We need to count how many headers in one job log, then identify the same number of the headers.

@moskyb
Copy link
Contributor

moskyb commented Nov 2, 2023

hey, thanks for updating us - this really helps us out.

i think ideally, we'd like to avoid header-timestamping ANSI-timestamped output, as it requires our backend to do a bunch of work on job logs that we'd ideally like to avoid, but i can see how this would break your use case.

i presume that at some point in your log span tool, you're inspecting the logs themselves to match them up to the header times - would it be possible to alter that logic to look for headers in the log, and use the ANSI timestamp as the "header time" in this case?

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

No branches or pull requests

2 participants