tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.72k stars 307 forks source link

Allow for configuration of snapshot log limit #5966

Open geraldhumphries opened 2 years ago

geraldhumphries commented 2 years ago

Describe the Feature You Want

A flag or configuration option to change the max size of logs that will be included in snapshots.

Current Behavior

Tilt currently truncates logs to a hard-coded, 1MB limit: https://github.com/tilt-dev/tilt/blob/master/web/src/HUD.tsx#L46

This limit was introduced to solve a Tilt Cloud issue: https://github.com/tilt-dev/tilt/issues/3687

I am not sure if this limit is still necessary or not. Would it make sense to allow for unlimited logs in snapshots again?

Why Do You Want This?

While testing out snapshots for my team, I noticed a lot of missing logs in resources. Most were missing logs completely which was quite confusing until I found it in the source code and #3687. The log limit does not seem to be documented anywhere else.

Some of our resources are very verbose in dev mode, which quickly causes snapshots to hit the 1MB size limit. These logs could be necessary for debugging issues a dev is having. Without them, snapshots are definitely less useful for us than they could be.

nicks commented 2 years ago

Thanks for the report! It's not ENTIRELY true that this limit was introduced to solve a Tilt Cloud issue.

There are also issues where the UI can only really handle a certain number of logs before becoming unwieldy, see - https://github.com/tilt-dev/tilt/issues/3359

We also cap the number of logs client-side as well, see - https://github.com/tilt-dev/tilt/blob/master/web/src/LogStore.ts#L16