Skip to content

v4.0.0-beta.1

Choose a tag to compare

@flc1125 flc1125 released this 09 Jul 08:26
· 276 commits to 4.x since this release
v4.0.0-beta.1
36f5802

Fries v4.0.0-beta.1

This is the first beta release of Fries 4.x.

Fries 4.x is a major version update focused on aligning the project with Kratos v3 and Go's standard library log/slog. This release also updates module paths to /v4, refreshes component APIs, and removes legacy Kratos logging integrations that are no longer suitable for the 4.x line.

Because this is a beta release, APIs are intended to represent the 4.x direction, but minor adjustments may still happen before the stable v4.0.0 release.

Highlights

Kratos v3 support

Fries integrations have been upgraded from github.com/go-kratos/kratos/v2 to github.com/go-kratos/kratos/v3.

This affects Kratos middleware, transport-related helpers, error helpers, and related examples.

Standard library slog migration

Logging-related components now use Go's standard log/slog model.

Notable changes:

  • Added log/slog/multi
  • Added log/slog/syslog
  • Migrated component loggers to *slog.Logger
  • Migrated HTTP framework loggers for chi, gin, and http/server
  • Migrated Kratos wrapper component logging to slog
  • Migrated OTLP lifecycle logs to slog
  • Removed legacy kratos/log/* components

For OpenTelemetry log bridging, use the official go.opentelemetry.io/contrib/bridges/otelslog package.

Module and package cleanup

The repository module line has moved to /v4.

The previous contract module has been renamed to capability:

github.com/go-fries/fries/contract/v4

should be replaced with:

github.com/go-fries/fries/capability/v4

OpenTelemetry alignment

Kratos v3 telemetry behavior has been aligned for 4.x.

Instrumentation scope names now follow the v4 package paths. If your dashboards, collectors, or tests match scope names or scope versions, review and update those matchers.

Server lifecycle behavior

HTTP server-related components keep the standard net/http behavior around http.ErrServerClosed.

For callers that want to ignore normal server shutdown errors, http/server provides an explicit helper.

Breaking Changes

  • Module paths now use /v4.
  • Kratos dependencies now use github.com/go-kratos/kratos/v3.
  • Component logger options now use *slog.Logger.
  • kratos/log/multi was removed. Use log/slog/multi.
  • kratos/log/syslog was removed. Use log/slog/syslog.
  • kratos/log/otel was removed. Use go.opentelemetry.io/contrib/bridges/otelslog.
  • contract/v4 was renamed to capability/v4.
  • OTel instrumentation scope names now follow v4 package paths.

Migration Notes

  1. Replace Fries imports from /v3 to /v4.
  2. Replace Kratos imports from /v2 to /v3.
  3. Replace contract/v4 imports with capability/v4.
  4. Replace Kratos log components:
    • kratos/log/multi -> log/slog/multi
    • kratos/log/syslog -> log/slog/syslog
    • kratos/log/otel -> go.opentelemetry.io/contrib/bridges/otelslog
  5. Update logger configuration to pass *slog.Logger.
  6. Review OTel scope name and scope version matchers.
  7. Run module tests and lint after import updates.

What's Changed

v4 baseline

Logging

  • feat(log): add slog multi handler by @flc1125 in #2566
  • feat(log): add slog syslog handler by @flc1125 in #2567
  • refactor(log): retire kratos log components by @flc1125 in #2569
  • refactor(log): migrate component loggers to slog by @flc1125 in #2576
  • refactor(log): migrate http framework loggers to slog by @flc1125 in #2577
  • refactor(log): migrate kratos wrapper logging to slog by @flc1125 in #2578
  • refactor(log): migrate otlp lifecycle logs to slog by @flc1125 in #2580

Kratos v3 and integrations

  • chore(kratos): upgrade integrations to kratos v3 by @flc1125 in #2581
  • fix(errors): align with kratos v3 error helpers by @flc1125 in #2582
  • fix(transport): clarify server closed behavior by @flc1125 in #2583
  • fix(otel): align kratos v3 telemetry behavior by @flc1125 in #2584

Cleanup and docs

Full Changelog

v3.15.0...v4.0.0-beta.1