Conversation
8 tasks
* refactor(log)!: use slog logger facade Replace the legacy Kratos log abstraction with a lightweight slog facade. Move OpenTelemetry log, tracing, and metrics integrations into contrib. Refs #3820 BREAKING CHANGE: The log package now uses *slog.Logger and removes the legacy Logger interface, helper, std logger, value helpers, and core OTEL tracing and metrics middleware. * chore(log): align lint and module versions Keep contrib logging modules on their existing dependency baselines and use Go 1.22-compatible OpenTelemetry bridge versions for contrib/otel. Refs #3820 * fix(log): update polaris error logging Use slog-style Error calls after the log facade refactor. Refs #3820 * feat(log): add WithLogOptions to contrib adapters and otel/log Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(log): add With helper to create logger with pre-attached attributes Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * style(log): fix import ordering in contrib tests Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor: add context to log.Fatal calls for better error diagnostics Replace bare `log.Fatal(err.Error())` with `log.Fatalf()` that includes descriptive context about the failed operation, improving debuggability. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(log): preallocate context attrs * refactor(log): use handler-first logger construction --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Move protobuf JSON handling out of encoding/json so the json codec uses only the Go standard library. Add encoding/protojson for explicit protojson registration and keep gRPC JSON behavior backed by protojson. Part of #3820 BREAKING CHANGE: encoding/json no longer handles protobuf JSON.
Move the JWT middleware into a standalone contrib module so the core module no longer pulls in golang-jwt as a direct dependency. Refs #3820
Remove the exported metadata API package from the core module and stop the gRPC server from registering kratos.api.Metadata by default. BREAKING CHANGE: the github.com/go-kratos/kratos/v3/api/metadata package is no longer provided by the core module. Refs #3820
Move the default circuit breaker, rate limiter, and subset selection into internal packages so the core module no longer imports aegis. Refs #3820
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the default config merge hook with an internal map merge implementation so the core module no longer depends on mergo. Refs #3820
…pdates unconditionally Remove the printDiscoveryDebugLog option from gRPC client and the debugLog field from the discovery builder/resolver. The instance update log in the resolver is now always printed, removing an unnecessary toggle that defaulted to on. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(transport): support http streaming Add protoc-gen-go-http generation for server-streaming SSE and client or bidirectional streaming over WebSocket. Support google.api.HttpBody upload and download paths and select stream codecs from Accept and Content-Type headers. Refs #3820 * fix(ci): resolve http streaming lint failures
Add a contrib JSON codec that preserves the v2 behavior of handling proto.Message values through protojson while keeping the json codec name for migration. Refresh the root English and Chinese READMEs around examples, v3 structure, and migration entry points, and add v2-to-v3 migration guides. Refs #3820
… across codebase Remove all fmt.Sprintf-based log functions (Debugf, Infof, Warnf, Errorf, Fatalf and Context variants) and Fatal functions. Add WithGroup, Handler, and Enabled convenience functions. Use runtime.Callers for correct source attribution instead of delegating directly to slog. Migrate all call sites from printf-style to structured key-value logging. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description (what this PR does / why we need it):
github.com/go-kratos/kratos/v2togithub.com/go-kratos/kratos/v3.cmdandcontribmodule paths, imports, docs, and generated references from/v2to/v3, includingcmd/protoc-gen-go-errors/v3.requireandreplacereferences togithub.com/go-kratos/kratos/v3 v3.0.0.v2.12.2and fix new lint findings.Which issue(s) this PR fixes (resolves / be part of):
Refs #3820.
This PR owns the shared
v3integration branch; follow-up v3 feature PRs should targetv3first.Other special notes for the reviewers:
Local validation:
make cleanmake lintgo build ./...go test ./...go test -race ./...go build ./...incmd/kratosgo test ./...incmd/protoc-gen-go-errorsgo test ./...incmd/protoc-gen-go-httpService-backed contrib tests are covered by GitHub Actions, which starts etcd, Consul, Nacos, and Polaris.