github shuttle-hq/shuttle v0.26.0

latest releases: v0.51.0, v0.50.0, v0.49.0...
16 months ago

Shuttle: v0.26.0 update

We're excited to release shuttle v0.26.0! 🚀

New Logger Service

⚠️ Upgrading your deployer to 0.26.0 (with cargo shuttle project restart) will make all logs from prior deployments inaccessible! See the details below for how to save your old logs if you need them. ⚠️

This release features a big refactor of how we handle logs. The result? Fancier and more detailed logs from our side, and much more freedom in how you handle your logging.

  • Everything that your app prints to stdout now shows up in the logs. This means that you can do some logging quickly with just println!().
  • The default tracing subscriber that we initialize behind the scenes is now a default feature of shuttle-runtime, and can be disabled by disabling default features.
  • The filter in the default subscriber is RUST_LOG="info,shuttle=trace". You can override these levels on a local run by setting the RUST_LOG variable. The other alternative, which is required for modifying the log levels in a Shuttle deployment, is by dropping the default tracing layer and implementing your own, with a specific level filter of your choosing.
  • shuttle-next projects have a default tracing subscriber too, but this can not be opted out for the moment.
  • Disabling the default subscriber allows you to set up your own tracing subscriber, for example:
// In your Cargo.toml
shuttle-runtime = { version = "0.26.0", default-features = false }
tracing = "0.1.37"
tracing-subscriber = "0.3.17"

// In your Shuttle main function.
tracing_subscriber::fmt()
    .with_env_filter(
        EnvFilter::builder()
            .with_default_directive(LevelFilter::INFO.into())
            .from_env_lossy(),
    )
    .init();
tracing::info!("tracing is initialized");

Other updates

  • cargo shuttle init: Interactive mode now warns you if the directory of choice is not empty & improved handling of the path argument. #1198
  • Simplified the shuttle-persist API by removing an explicit lifetime in the error enum. #1195

Contributions

Considerations

  • If you do a cargo shuttle project restart or a cargo shuttle project stop followed by a start, you will not be able to access logs from before the restart. If you want to retain your old logs, you can do a cargo shuttle logs before restarting and then persist the output to a local file.
  • If you upgrade the cargo-shuttle CLI you will have to upgrade your deployer by doing a cargo shuttle project restart, since it will expect to receive the updated output from cargo shuttle logs. If you upgraded the CLI but you’re not ready to restart your project, you can downgrade the CLI again.
  • If you restart your project with a cargo shuttle project restart your project container will be upgraded. You will then have to upgrade your cargo-shuttle CLI, since it will receive logs in a new format from the updated project container.

Upgrading

Refer to the upgrading docs for how to upgrade your projects.

Commits for this release

  • feat: merge logger service from feat/shuttle-runtime-scaling by @oddgrd in #1139
  • deployer: update logs APIs to fetch the logs from shuttle-logger by @iulianbarbu in #1143
  • logger: store span names by @iulianbarbu in #1166
  • logger: adjust logger to receive logs blobs by @iulianbarbu in #1172
  • feat(deployer): send runtime logs to the logger service by @orhun in #1173
  • refactor: remove tracing from runtime by @chesedo in #1185
  • refactor: remove println from shuttle-logger by @chesedo in #1186
  • feat(runtime): write next runtime logs to stdout by @orhun in #1187
  • refactor(runtime): replace trace with println by @orhun in #1190
  • feat: logs batching by @chesedo in #1188
  • Create the local setup for replacing shuttle-logger sqlite with postgres by @iulianbarbu in #1145
  • feat(gateway): special error if own project is already running by @d4ckard in #1192
  • chore: update readme with new persist methods by @sentinel1909 in #1184
  • fix(persist): don't use lifetime in error by @jonaro00 in #1195
  • feat(gateway): inform project owner about running state by @d4ckard in #1194
  • chore(gateway): stop setting RUST_LOG in deployers by @orhun in #1197
  • feat(deployer): StateChangeLayer, DeploymentLogLayer, new log item structure by @jonaro00 in #1171
  • bug: service name being unknown by @chesedo in #1202
  • feat(cargo-shuttle): prompt for init path when not given, warn if init dir not empty by @jonaro00 in #1198
  • chore(changelog): add git-cliff configuration by @orhun in #1200
  • feat: remove publish steps from the Makefile by @melkir in #1196
  • feat(runtime): set up a tracing-subscriber as a default feature by @orhun in #1203
  • test(deployer): fixed deployer tests and removed unnecessary runtime logger_uri arg by @iulianbarbu in #1204
  • chore(services): disable default features for shuttle-runtime by @orhun in #1205
  • refactor(proto): fix the use of deprecated chrono datetime by @orhun in #1207
  • fix: missing readmes in deployers local source by @oddgrd in #1206
  • Revert "feat(shuttle-axum) Make AxumService generic to be able to use axum::State with it (#924)" by @jonaro00 in #1199
  • refactor(runtime,codegen): avoid double timestamps problem by @iulianbarbu in #1210
  • feat(deployer): handle errors from corrupted resource data by @oddgrd in #1208
  • feat(codegen): restore default log level, improve error messages by @jonaro00 in #1211
  • fix(logger): resolve CI failures caused by recent changes by @iulianbarbu in #1212
  • feat(containerfile): improve deployer build caching by @jonaro00 in #1214
  • fix: span names, log levels and messages by @jonaro00 in #1213
  • Enable auto-sharding in shuttle-poise by @jdh8 in #1217
  • refactor: match local logs with deployer logs by @chesedo in #1216
  • fix(otel): restore honeycomb and dd exporters by @oddgrd in #1218
  • feat(shuttle-next): enable tracing by default by @iulianbarbu in #1219
  • refactor: switch to LOGGER_POSTGRES_URI by @chesedo in #1220
  • refactor: improve stream logs by @chesedo in #1221
  • refactor: add index to deployment id by @chesedo in #1224
  • batch in 1 sec intervals by @jonaro00 in #1222
  • fix: logger branch cleanups by @oddgrd in #1226
  • ci: logger postgres uri by @oddgrd in #1228
  • fix: truncate log item strings by @jonaro00 in #1227
  • feat(common): change request_span macro to info level by @oddgrd in #1230
  • feat(logger): refactor to loop, add traces by @oddgrd in #1232
  • feat(logger): logger queue size trace by @oddgrd in #1235
  • ci: uncomment deployment branch filters by @oddgrd in #1238
  • feat: dedicated logger service by @chesedo in #1225
  • chore: v0.26.0 by @oddgrd in #1239
  • fix(makefile): remove duplicate command by @oddgrd in #1241
  • fix(Containerfile): copied shuttle-logger service in the final image by @iulianbarbu in #1242
  • feat: outdated log parse warning by @jonaro00 in #1243
  • chore: bump examples by @oddgrd in #1246

New Contributors

Full Changelog: v0.25.1...v0.26.0

Don't miss a new shuttle release

NewReleases is sending notifications on new releases.