Repository: go-kratos/kratos
Pull request #3047 (2023-10-23 12:54:27)

build(deps): bump google.golang.org/grpc from 1.56.1 to 1.59.0 in /contrib/registry/etcd
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.1 to 1.59.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's releases</a>.</em></p>
<blockquote>
<h2>Release 1.58.3</h2>
<h1>Security</h1>
<ul>
<li>
<p>server: prohibit more than MaxConcurrentStreams handlers from running at once (CVE-2023-44487)</p>
<p>In addition to this change, applications should ensure they do not leave running tasks behind related to the RPC before returning from method handlers, or should enforce appropriate limits on any such work.</p>
</li>
</ul>
<h2>Release 1.58.2</h2>
<h1>Bug Fixes</h1>
<ul>
<li>
<p>balancer/weighted_round_robin: fix ticker leak on update</p>
<p>A new ticker is created every time there is an update of addresses or configuration, but was not properly stopped.  This change stops the ticker when it is no longer needed.</p>
</li>
</ul>
<h2>Release 1.58.1</h2>
<h1>Bug Fixes</h1>
<ul>
<li>grpc: fix a bug that was decrementing active RPC count too early for streaming RPCs; leading to channel moving to IDLE even though it had open streams</li>
<li>grpc: fix a bug where transports were not being closed upon channel entering IDLE</li>
</ul>
<h2>Release 1.58.0</h2>
<h1>API Changes</h1>
<p>See <a href="https://redirect.github.com/grpc/grpc-go/issues/6472">#6472</a> for details about these changes.</p>
<ul>
<li>balancer: add <code>StateListener</code> to <code>NewSubConnOptions</code> for <code>SubConn</code> state updates and deprecate <code>Balancer.UpdateSubConnState</code> (<a href="https://redirect.github.com/grpc/grpc-go/issues/6481">#6481</a>)
<ul>
<li><code>UpdateSubConnState</code> will be deleted in the future.</li>
</ul>
</li>
<li>balancer: add <code>SubConn.Shutdown</code> and deprecate <code>Balancer.RemoveSubConn</code> (<a href="https://redirect.github.com/grpc/grpc-go/issues/6493">#6493</a>)
<ul>
<li><code>RemoveSubConn</code> will be deleted in the future.</li>
</ul>
</li>
<li>resolver: remove deprecated <code>AddressType</code> (<a href="https://redirect.github.com/grpc/grpc-go/issues/6451">#6451</a>)
<ul>
<li>This was previously used as a signal to enable the &quot;grpclb&quot; load balancing policy, and to pass LB addresses to the policy.  Instead, <code>balancer/grpclb/state.Set()</code> should be used to add these addresses to the name resolver's output.  The built-in &quot;dns&quot; name resolver already does this.</li>
</ul>
</li>
<li>resolver: add new field <code>Endpoints</code> to <code>State</code> and deprecate <code>Addresses</code> (<a href="https://redirect.github.com/grpc/grpc-go/issues/6471">#6471</a>)
<ul>
<li><code>Addresses</code> will be deleted in the future.</li>
</ul>
</li>
</ul>
<h1>New Features</h1>
<ul>
<li>balancer/leastrequest: Add experimental support for least request LB policy and least request configured as a custom xDS policy (<a href="https://redirect.github.com/grpc/grpc-go/issues/6510">#6510</a>, <a href="https://redirect.github.com/grpc/grpc-go/issues/6517">#6517</a>)
<ul>
<li>Set <code>GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST=true</code> to enable</li>
</ul>
</li>
<li>stats: Add an RPC event for blocking caused by the LB policy's picker (<a href="https://redirect.github.com/grpc/grpc-go/issues/6422">#6422</a>)</li>
</ul>
<h1>Bug Fixes</h1>
<ul>
<li>clusterresolver: fix deadlock when dns resolver responds inline with update or error at build time (<a href="https://redirect.github.com/grpc/grpc-go/issues/6563">#6563</a>)</li>
<li>grpc: fix a bug where the channel could erroneously report <code>TRANSIENT_FAILURE</code> when actually moving to <code>IDLE</code> (<a href="https://redirect.github.com/grpc/grpc-go/issues/6497">#6497</a>)</li>
<li>balancergroup: do not cache closed sub-balancers by default; affects <code>rls</code>, <code>weightedtarget</code> and <code>clustermanager</code> LB policies (<a href="https://redirect.github.com/grpc/grpc-go/issues/6523">#6523</a>)</li>
<li>client: fix a bug that prevented detection of RPC status in trailers-only RPC responses when using <code>ClientStream.Header()</code>, and prevented retry of the RPC (<a href="https://redirect.github.com/grpc/grpc-go/issues/6557">#6557</a>)</li>
</ul>
<h1>Performance Improvements</h1>
<ul>
<li>client &amp; server: Add experimental <code>[With]SharedWriteBuffer</code> to improve performance by reducing allocations when sending RPC messages. (Disabled by default.) (<a href="https://redirect.github.com/grpc/grpc-go/issues/6309">#6309</a>)
<ul>
<li>Special Thanks: <a href="https://github.com/s-matyukevich"><code>@​s-matyukevich</code></a></li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/grpc/grpc-go/commit/7765221f4bf6104973db7946d56936cf838cad46"><code>7765221</code></a> Change version to 1.59.0 (<a href="https://redirect.github.com/grpc/grpc-go/issues/6695">#6695</a>)</li>
<li><a href="https://github.com/grpc/grpc-go/commit/e88f12e0517d465cb892ef58e1debf10b4e5607f"><code>e88f12e</code></a> server: prohibit more than MaxConcurrentStreams handlers from running at once...</li>
<li><a href="https://github.com/grpc/grpc-go/commit/be7919c3dc3c26f54489c778af7bbfea608ad9bc"><code>be7919c</code></a> transport: Pass Header metadata to tap handle. (<a href="https://redirect.github.com/grpc/grpc-go/issues/6652">#6652</a>)</li>
<li><a href="https://github.com/grpc/grpc-go/commit/e3f1514cdb8fcbcacc30b53473042dbb40a54791"><code>e3f1514</code></a> Reapply &quot;status: fix/improve status handling (<a href="https://redirect.github.com/grpc/grpc-go/issues/6662">#6662</a>)&quot; (<a href="https://redirect.github.com/grpc/grpc-go/issues/6673">#6673</a>) (<a href="https://redirect.github.com/grpc/grpc-go/issues/6688">#6688</a>)</li>
<li><a href="https://github.com/grpc/grpc-go/commit/696faa982cdc0914929a64848a8ff3bf7a924166"><code>696faa9</code></a> client: add a test for NewSubConn / StateListener / cc.Close racing (<a href="https://redirect.github.com/grpc/grpc-go/issues/6678">#6678</a>)</li>
<li><a href="https://github.com/grpc/grpc-go/commit/318c717a659ec55a2f92e1c84313153dd278bf55"><code>318c717</code></a> readme: fix badges (<a href="https://redirect.github.com/grpc/grpc-go/issues/6687">#6687</a>)</li>
<li><a href="https://github.com/grpc/grpc-go/commit/39972fdd744873a2b829ab98962ab0e85800d591"><code>39972fd</code></a> github: add code coverage with codecov.io (<a href="https://redirect.github.com/grpc/grpc-go/issues/6676">#6676</a>)</li>
<li><a href="https://github.com/grpc/grpc-go/commit/93dbc059f561340a14aeb96ea2925b9a669c5673"><code>93dbc05</code></a> xds: move virtual host matcher test to the xdsresource package (<a href="https://redirect.github.com/grpc/grpc-go/issues/6680">#6680</a>)</li>
<li><a href="https://github.com/grpc/grpc-go/commit/2c00469782f1dd8c7456dcc7238a957781246e84"><code>2c00469</code></a> github: update actions/setup-go and actions/checkout (<a href="https://redirect.github.com/grpc/grpc-go/issues/6675">#6675</a>)</li>
<li><a href="https://github.com/grpc/grpc-go/commit/1f73ed5fcf75b3e464c83ab17fc73144e2161620"><code>1f73ed5</code></a> Replace the gRFC pull request with the permanent link. (<a href="https://redirect.github.com/grpc/grpc-go/issues/6674">#6674</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/grpc/grpc-go/compare/v1.56.1...v1.59.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.56.1&new-version=1.59.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

codecov-commenter: ## [Codecov](https://app.codecov.io/gh/go-kratos/kratos/pull/3047?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-kratos) Report
> Merging [#3047](https://app.codecov.io/gh/go-kratos/kratos/pull/3047?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-kratos) (f9405cb) into [main](https://app.codecov.io/gh/go-kratos/kratos/commit/6cdd81811e102620ec93b125ea6ed38f06a5e03c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-kratos) (6cdd818) will **not change** coverage.
> The diff coverage is `n/a`.

> :exclamation: Current head f9405cb differs from pull request most recent head 084d092. Consider uploading reports for the commit 084d092 to get more accurate results

:exclamation: Your organization needs to install the [Codecov GitHub app](https://github.com/apps/codecov/installations/select_target) to enable full functionality.

```diff
@@           Coverage Diff           @@
##             main    #3047   +/-   ##
=======================================
  Coverage   84.34%   84.34%           
=======================================
  Files          88       88           
  Lines        3986     3986           
=======================================
  Hits         3362     3362           
  Misses        448      448           
  Partials      176      176           
```





Patch:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index a100e19c..f4d42161 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -11,7 +11,7 @@ jobs:
 
     steps:
     - name: Checkout repo
-      uses: actions/checkout@v3
+      uses: actions/checkout@v4
 
     - name: Initialize CodeQL
       uses: github/codeql-action/init@v2
diff --git a/.github/workflows/gitee-sync.yml b/.github/workflows/gitee-sync.yml
index 58d7f352..b527f329 100644
--- a/.github/workflows/gitee-sync.yml
+++ b/.github/workflows/gitee-sync.yml
@@ -12,7 +12,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - name: Checkout source code
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
       - name: Mirror Github to Gitee
         uses: Yikun/hub-mirror-action@v1.3
         with:
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 2ed19dc9..a8717450 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -42,7 +42,7 @@ jobs:
           - 8091:8091
           - 8093:8093
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Go
         uses: actions/setup-go@v4.1.0
         with:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 6aea7003..225b90a9 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -15,7 +15,7 @@ jobs:
       matrix: ${{ steps.set-matrix.outputs.matrix }}
     steps:
       - name: Checkout Repo
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
 
       - id: set-matrix
         run: ./hack/resolve-modules.sh
@@ -27,7 +27,7 @@ jobs:
     strategy:
       matrix: ${{ fromJson(needs.resolve-modules.outputs.matrix) }}
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Lint
         uses: golangci/golangci-lint-action@v3
         with:
diff --git a/.golangci.yml b/.golangci.yml
index b38bf368..556fcfbc 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -29,6 +29,7 @@ linters:
     - whitespace
     - wastedassign
     - unconvert
+    - misspell
 
   # don't enable:
   # - asciicheck
@@ -66,3 +67,5 @@ linters-settings:
     min-complexity: 50
   goimports:
     local-prefixes: github.com/go-kratos # Put imports beginning with prefix after 3rd-party packages
+  misspell: # Finds commonly misspelled English words in comments
+    locale: US
diff --git a/cmd/kratos/go.mod b/cmd/kratos/go.mod
index 0f7bf1bb..64d03ae4 100644
--- a/cmd/kratos/go.mod
+++ b/cmd/kratos/go.mod
@@ -19,7 +19,7 @@ require (
 	github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/stretchr/testify v1.7.0 // indirect
-	golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
+	golang.org/x/sys v0.1.0 // indirect
 	golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
 	gopkg.in/yaml.v3 v3.0.0 // indirect
 )
diff --git a/cmd/kratos/go.sum b/cmd/kratos/go.sum
index 182fe6a2..df2fa0e5 100644
--- a/cmd/kratos/go.sum
+++ b/cmd/kratos/go.sum
@@ -60,6 +60,8 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
diff --git a/contrib/config/apollo/watcher.go b/contrib/config/apollo/watcher.go
index ad842420..8431fca2 100644
--- a/contrib/config/apollo/watcher.go
+++ b/contrib/config/apollo/watcher.go
@@ -27,18 +27,15 @@ func (c *customChangeListener) onChange(namespace string, changes map[string]*st
 	kv := make([]*config.KeyValue, 0, 2)
 	if strings.Contains(namespace, ".") && !strings.HasSuffix(namespace, "."+properties) &&
 		(format(namespace) == yaml || format(namespace) == yml || format(namespace) == json) {
-		value, err := c.apollo.client.GetConfigCache(namespace).Get("content")
-		if err != nil {
-			log.Warnw("apollo get config failed", "err", err)
-			return nil
+		if value, ok := changes["content"]; ok {
+			kv = append(kv, &config.KeyValue{
+				Key:    namespace,
+				Value:  []byte(value.NewValue.(string)),
+				Format: format(namespace),
+			})
+
+			return kv
 		}
-		kv = append(kv, &config.KeyValue{
-			Key:    namespace,
-			Value:  []byte(value.(string)),
-			Format: format(namespace),
-		})
-
-		return kv
 	}
 
 	next := make(map[string]interface{})
diff --git a/contrib/config/etcd/go.mod b/contrib/config/etcd/go.mod
index 4ff40cb7..6953bbf6 100644
--- a/contrib/config/etcd/go.mod
+++ b/contrib/config/etcd/go.mod
@@ -5,7 +5,7 @@ go 1.19
 require (
 	github.com/go-kratos/kratos/v2 v2.7.1
 	go.etcd.io/etcd/client/v3 v3.5.10
-	google.golang.org/grpc v1.58.3
+	google.golang.org/grpc v1.59.0
 )
 
 require (
@@ -23,9 +23,9 @@ require (
 	golang.org/x/net v0.17.0 // indirect
 	golang.org/x/sys v0.13.0 // indirect
 	golang.org/x/text v0.13.0 // indirect
-	google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
-	google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
-	google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
+	google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
+	google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
+	google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
 	google.golang.org/protobuf v1.31.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
diff --git a/contrib/config/etcd/go.sum b/contrib/config/etcd/go.sum
index d0b74694..4e4cd27a 100644
--- a/contrib/config/etcd/go.sum
+++ b/contrib/config/etcd/go.sum
@@ -75,14 +75,14 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g=
-google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0=
-google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw=
-google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=
-google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
-google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
+google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY=
+google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
+google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q=
+google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
+google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
+google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
diff --git a/contrib/log/aliyun/go.mod b/contrib/log/aliyun/go.mod
index 25413ceb..8448e928 100644
--- a/contrib/log/aliyun/go.mod
+++ b/contrib/log/aliyun/go.mod
@@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/log/aliyun/v2
 go 1.19
 
 require (
-	github.com/aliyun/aliyun-log-go-sdk v0.1.65
+	github.com/aliyun/aliyun-log-go-sdk v0.1.66
 	github.com/go-kratos/kratos/v2 v2.7.1
 	google.golang.org/protobuf v1.31.0
 )
diff --git a/contrib/log/aliyun/go.sum b/contrib/log/aliyun/go.sum
index 0867116c..b921ec4c 100644
--- a/contrib/log/aliyun/go.sum
+++ b/contrib/log/aliyun/go.sum
@@ -40,8 +40,8 @@ github.com/alibabacloud-go/tea-utils/v2 v2.0.1 h1:K6kwgo+UiYx+/kr6CO0PN5ACZDzE3n
 github.com/alibabacloud-go/tea-utils/v2 v2.0.1/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4=
 github.com/alibabacloud-go/tea-xml v1.1.2 h1:oLxa7JUXm2EDFzMg+7oRsYc+kutgCVwm+bZlhhmvW5M=
 github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8=
-github.com/aliyun/aliyun-log-go-sdk v0.1.65 h1:F5HsYYTFwkkoEa1h2U0ekELC3+0IXd+zwPBC/2QUOc8=
-github.com/aliyun/aliyun-log-go-sdk v0.1.65/go.mod h1:FSKcIjukUy+LeUKhRk13PCO+9gPMTfGsYhFBHQbDqmM=
+github.com/aliyun/aliyun-log-go-sdk v0.1.66 h1:my4x9WLaHgkf5AUgefX+/6KTlcuAPvlgWOT8Aroi9sI=
+github.com/aliyun/aliyun-log-go-sdk v0.1.66/go.mod h1:FSKcIjukUy+LeUKhRk13PCO+9gPMTfGsYhFBHQbDqmM=
 github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY=
 github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw=
 github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
diff --git a/contrib/metrics/prometheus/go.mod b/contrib/metrics/prometheus/go.mod
index 089f347a..3886f0bb 100644
--- a/contrib/metrics/prometheus/go.mod
+++ b/contrib/metrics/prometheus/go.mod
@@ -5,14 +5,13 @@ go 1.19
 require (
 	github.com/go-kratos/kratos/v2 v2.7.1
 	github.com/prometheus/client_golang v1.17.0
-	github.com/prometheus/common v0.44.0
+	github.com/prometheus/common v0.45.0
 )
 
 require (
 	github.com/beorn7/perks v1.0.1 // indirect
 	github.com/cespare/xxhash/v2 v2.2.0 // indirect
-	github.com/golang/protobuf v1.5.3 // indirect
-	github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
+	github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
 	github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
 	github.com/prometheus/procfs v0.11.1 // indirect
 	golang.org/x/sys v0.13.0 // indirect
diff --git a/contrib/metrics/prometheus/go.sum b/contrib/metrics/prometheus/go.sum
index e50ad46e..a15317e9 100644
--- a/contrib/metrics/prometheus/go.sum
+++ b/contrib/metrics/prometheus/go.sum
@@ -2,27 +2,22 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
 github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
 github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
-github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
-github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
+github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg=
+github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
 github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
 github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
 github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
 github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
-github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
-github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
+github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM=
+github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY=
 github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
 github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
 golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
 google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
diff --git a/contrib/opensergo/go.mod b/contrib/opensergo/go.mod
index d58cbc22..21821bb7 100644
--- a/contrib/opensergo/go.mod
+++ b/contrib/opensergo/go.mod
@@ -6,21 +6,21 @@ require (
 	github.com/go-kratos/kratos/v2 v2.7.1
 	github.com/opensergo/opensergo-go v0.0.0-20220331070310-e5b01fee4d1c
 	golang.org/x/net v0.18.0
-	google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529
-	google.golang.org/grpc v1.56.1
+	google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d
+	google.golang.org/grpc v1.59.0
 	google.golang.org/protobuf v1.31.0
 )
 
 require (
 	github.com/go-playground/form/v4 v4.2.0 // indirect
 	github.com/golang/protobuf v1.5.3 // indirect
-	github.com/google/uuid v1.3.0 // indirect
+	github.com/google/uuid v1.3.1 // indirect
 	github.com/kr/text v0.2.0 // indirect
 	golang.org/x/sync v0.3.0 // indirect
 	golang.org/x/sys v0.14.0 // indirect
 	golang.org/x/text v0.14.0 // indirect
-	google.golang.org/genproto v0.0.0-20230629202037-9506855d4529 // indirect
-	google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 // indirect
+	google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
+	google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
 
diff --git a/contrib/opensergo/go.sum b/contrib/opensergo/go.sum
index a5c52120..e8b1cfa4 100644
--- a/contrib/opensergo/go.sum
+++ b/contrib/opensergo/go.sum
@@ -49,8 +49,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
 github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
-github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
+github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
 github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
@@ -110,12 +110,12 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA
 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20230629202037-9506855d4529 h1:9JucMWR7sPvCxUFd6UsOUNmA5kCcWOfORaT3tpAsKQs=
-google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64=
-google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 h1:s5YSX+ZH5b5vS9rnpGymvIyMpLRJizowqDlOuyjXnTk=
-google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 h1:DEH99RbiLZhMxrpEJCZ0A+wdTe0EOgou/poSLx9vWf4=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
+google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY=
+google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
+google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q=
+google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
@@ -123,8 +123,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
 google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
 google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
 google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
-google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ=
-google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
+google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
+google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
 google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
 google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
 google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
diff --git a/contrib/polaris/go.mod b/contrib/polaris/go.mod
index 0fa90082..e297e1c8 100644
--- a/contrib/polaris/go.mod
+++ b/contrib/polaris/go.mod
@@ -37,7 +37,7 @@ require (
 	golang.org/x/sys v0.13.0 // indirect
 	golang.org/x/text v0.13.0 // indirect
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 // indirect
-	google.golang.org/grpc v1.56.1 // indirect
+	google.golang.org/grpc v1.56.3 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
diff --git a/contrib/polaris/go.sum b/contrib/polaris/go.sum
index 44c2f18c..c457f9a0 100644
--- a/contrib/polaris/go.sum
+++ b/contrib/polaris/go.sum
@@ -541,8 +541,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp
 google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
 google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
-google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ=
-google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
+google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
+google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
 google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
 google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
 google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
diff --git a/contrib/registry/discovery/impl_discover.go b/contrib/registry/discovery/impl_discover.go
index fb1b01d1..38b1fc5c 100644
--- a/contrib/registry/discovery/impl_discover.go
+++ b/contrib/registry/discovery/impl_discover.go
@@ -64,7 +64,7 @@ func (w *watcher) Next() ([]*registry.ServiceInstance, error) {
 	case <-event:
 	// change event come
 	case <-w.cancelCtx.Done():
-		return nil, fmt.Errorf("watch context cancelled: %v", w.cancelCtx.Err())
+		return nil, fmt.Errorf("watch context canceled: %v", w.cancelCtx.Err())
 	}
 
 	ctx, cancel := context.WithTimeout(context.TODO(), 15*time.Second)
diff --git a/contrib/registry/etcd/go.mod b/contrib/registry/etcd/go.mod
index 63820b74..59eec4e1 100644
--- a/contrib/registry/etcd/go.mod
+++ b/contrib/registry/etcd/go.mod
@@ -5,7 +5,7 @@ go 1.19
 require (
 	github.com/go-kratos/kratos/v2 v2.7.1
 	go.etcd.io/etcd/client/v3 v3.5.10
-	google.golang.org/grpc v1.58.3
+	google.golang.org/grpc v1.59.0
 )
 
 require (
@@ -21,9 +21,9 @@ require (
 	golang.org/x/net v0.17.0 // indirect
 	golang.org/x/sys v0.13.0 // indirect
 	golang.org/x/text v0.13.0 // indirect
-	google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
-	google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
-	google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
+	google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
+	google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
+	google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
 	google.golang.org/protobuf v1.31.0 // indirect
 )
 
diff --git a/contrib/registry/etcd/go.sum b/contrib/registry/etcd/go.sum
index 88e668d8..460bf8b8 100644
--- a/contrib/registry/etcd/go.sum
+++ b/contrib/registry/etcd/go.sum
@@ -68,14 +68,14 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g=
-google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0=
-google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw=
-google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=
-google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
-google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
+google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY=
+google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
+google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q=
+google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
+google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
+google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
diff --git a/log/filter.go b/log/filter.go
index 7ef96655..993fa926 100644
--- a/log/filter.go
+++ b/log/filter.go
@@ -1,7 +1,5 @@
 package log
 
-import "context"
-
 // FilterOption is filter option.
 type FilterOption func(*Filter)
 
@@ -41,7 +39,6 @@ func FilterFunc(f func(level Level, keyvals ...interface{}) bool) FilterOption {
 
 // Filter is a logger filter.
 type Filter struct {
-	ctx    context.Context
 	logger Logger
 	level  Level
 	key    map[interface{}]struct{}
@@ -70,9 +67,6 @@ func (f *Filter) Log(level Level, keyvals ...interface{}) error {
 	// prefixkv contains the slice of arguments defined as prefixes during the log initialization
 	var prefixkv []interface{}
 	l, ok := f.logger.(*logger)
-	if ok {
-		l.ctx = f.ctx
-	}
 	if ok && len(l.prefix) > 0 {
 		prefixkv = make([]interface{}, 0, len(l.prefix))
 		prefixkv = append(prefixkv, l.prefix...)
diff --git a/log/log.go b/log/log.go
index 38cef805..b3c34d37 100644
--- a/log/log.go
+++ b/log/log.go
@@ -50,28 +50,16 @@ func With(l Logger, kv ...interface{}) Logger {
 // WithContext returns a shallow copy of l with its context changed
 // to ctx. The provided ctx must be non-nil.
 func WithContext(ctx context.Context, l Logger) Logger {
-	c, ok := l.(*logger)
-	if ok {
-		return &logger{
-			logger:    c.logger,
-			prefix:    c.prefix,
-			hasValuer: c.hasValuer,
-			ctx:       ctx,
-		}
-	}
-
-	f, ok := l.(*Filter)
-	if ok {
-		f.ctx = ctx
-		return &Filter{
-			ctx:    ctx,
-			logger: f.logger,
-			level:  f.level,
-			key:    f.key,
-			value:  f.value,
-			filter: f.filter,
-		}
+	switch v := l.(type) {
+	default:
+		return &logger{logger: l, ctx: ctx}
+	case *logger:
+		lv := *v
+		lv.ctx = ctx
+		return &lv
+	case *Filter:
+		fv := *v
+		fv.logger = WithContext(ctx, fv.logger)
+		return &fv
 	}
-
-	return &logger{logger: l, ctx: ctx}
 }
diff --git a/transport/http/calloption.go b/transport/http/calloption.go
index e8329410..921e18ac 100644
--- a/transport/http/calloption.go
+++ b/transport/http/calloption.go
@@ -17,9 +17,10 @@ type CallOption interface {
 }
 
 type callInfo struct {
-	contentType  string
-	operation    string
-	pathTemplate string
+	contentType   string
+	operation     string
+	pathTemplate  string
+	headerCarrier *http.Header
 }
 
 // EmptyCallOption does not alter the Call configuration.
@@ -102,6 +103,11 @@ type HeaderCallOption struct {
 	header *http.Header
 }
 
+func (o HeaderCallOption) before(c *callInfo) error {
+	c.headerCarrier = o.header
+	return nil
+}
+
 func (o HeaderCallOption) after(_ *callInfo, cs *csAttempt) {
 	if cs.res != nil && cs.res.Header != nil {
 		*o.header = cs.res.Header
diff --git a/transport/http/client.go b/transport/http/client.go
index 2d2a352c..7784a1c2 100644
--- a/transport/http/client.go
+++ b/transport/http/client.go
@@ -231,6 +231,10 @@ func (client *Client) Invoke(ctx context.Context, method, path string, args inte
 	if err != nil {
 		return err
 	}
+	if c.headerCarrier != nil {
+		req.Header = *c.headerCarrier
+	}
+
 	if contentType != "" {
 		req.Header.Set("Content-Type", c.contentType)
 	}


Test patch:
diff --git a/contrib/config/apollo/watcher_test.go b/contrib/config/apollo/watcher_test.go
new file mode 100644
index 00000000..5341b769
--- /dev/null
+++ b/contrib/config/apollo/watcher_test.go
@@ -0,0 +1,79 @@
+package apollo
+
+import (
+	"testing"
+
+	"github.com/apolloconfig/agollo/v4/storage"
+
+	"github.com/go-kratos/kratos/v2/config"
+	"github.com/go-kratos/kratos/v2/encoding"
+)
+
+func Test_onChange(t *testing.T) {
+	s := map[string]struct {
+		Name string `yaml:"name"`
+	}{
+		"app": {
+			Name: "new",
+		},
+	}
+	codec := encoding.GetCodec(yaml)
+	val, _ := codec.Marshal(s)
+	c := customChangeListener{}
+	tests := []struct {
+		name      string
+		namespace string
+		changes   map[string]*storage.ConfigChange
+		kvs       []*config.KeyValue
+	}{
+		{
+			"test yaml onChange",
+			"app.yaml",
+			map[string]*storage.ConfigChange{
+				"name": {
+					OldValue:   "old",
+					NewValue:   "new",
+					ChangeType: storage.MODIFIED,
+				},
+			},
+			[]*config.KeyValue{
+				{
+					Key:    "app.yaml",
+					Value:  val,
+					Format: yaml,
+				},
+			},
+		},
+		{
+			"test json onChange",
+			"app.json",
+			map[string]*storage.ConfigChange{
+				"content": {
+					OldValue:   `{"name":"old"}`,
+					NewValue:   `{"name":"new"}`,
+					ChangeType: storage.MODIFIED,
+				},
+			},
+			[]*config.KeyValue{
+				{
+					Key:    "app.json",
+					Value:  []byte(`{"name":"new"}`),
+					Format: json,
+				},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			kvs := c.onChange(tt.namespace, tt.changes)
+			if len(kvs) != len(tt.kvs) {
+				t.Errorf("len(kvs) = %v, want %v", len(kvs), len(tt.kvs))
+			}
+			for i := range kvs {
+				if kvs[i].Format != tt.kvs[i].Format || kvs[i].Key != tt.kvs[i].Key || string(kvs[i].Value) != string(tt.kvs[i].Value) {
+					t.Errorf("got %v, want %v", kvs[i], tt.kvs[i])
+				}
+			}
+		})
+	}
+}
diff --git a/contrib/metrics/prometheus/gauge_test.go b/contrib/metrics/prometheus/gauge_test.go
index 31744a5a..fdeb94e9 100644
--- a/contrib/metrics/prometheus/gauge_test.go
+++ b/contrib/metrics/prometheus/gauge_test.go
@@ -7,21 +7,21 @@ import (
 	"github.com/prometheus/client_golang/prometheus"
 )
 
-func TestGuage(t *testing.T) {
-	expect := `# HELP test_request_test_guage_metric test
-# TYPE test_request_test_guage_metric gauge
-test_request_test_guage_metric{code="test",kind="test",operation="test",reason="test"} %d
+func TestGauge(t *testing.T) {
+	expect := `# HELP test_request_test_gauge_metric test
+# TYPE test_request_test_gauge_metric gauge
+test_request_test_gauge_metric{code="test",kind="test",operation="test",reason="test"} %d
 `
 
 	guageVec := prometheus.NewGaugeVec(prometheus.GaugeOpts{
 		Namespace: "test",
-		Name:      "test_guage_metric",
+		Name:      "test_gauge_metric",
 		Subsystem: "request",
 		Help:      "test",
 	}, []string{"kind", "operation", "code", "reason"})
 
-	guage := NewGauge(guageVec)
-	guage.With("test", "test", "test", "test").Set(1)
+	gauge := NewGauge(guageVec)
+	gauge.With("test", "test", "test", "test").Set(1)
 
 	reg := prometheus.NewRegistry()
 	reg.MustRegister(guageVec)
@@ -35,7 +35,7 @@ test_request_test_guage_metric{code="test",kind="test",operation="test",reason="
 		t.Fatal("metrics error")
 	}
 
-	guage.With("test", "test", "test", "test").Add(1)
+	gauge.With("test", "test", "test", "test").Add(1)
 	result, err = gatherLatest(reg)
 	if err != nil {
 		t.Fatal(err)
@@ -44,7 +44,7 @@ test_request_test_guage_metric{code="test",kind="test",operation="test",reason="
 		t.Fatal("metrics error")
 	}
 
-	guage.With("test", "test", "test", "test").Sub(1)
+	gauge.With("test", "test", "test", "test").Sub(1)
 	result, err = gatherLatest(reg)
 	if err != nil {
 		t.Fatal(err)
diff --git a/contrib/registry/consul/registry_test.go b/contrib/registry/consul/registry_test.go
index 791c2efc..02b61720 100644
--- a/contrib/registry/consul/registry_test.go
+++ b/contrib/registry/consul/registry_test.go
@@ -333,7 +333,7 @@ func TestRegistry_Watch(t *testing.T) {
 			},
 		},
 		{
-			name: "ctx has been cancelled",
+			name: "ctx has been canceled",
 			args: args{
 				ctx:      canceledCtx,
 				cancel:   cancel,
diff --git a/log/filter_test.go b/log/filter_test.go
index 679fbe8c..8463a472 100644
--- a/log/filter_test.go
+++ b/log/filter_test.go
@@ -5,7 +5,9 @@ import (
 	"context"
 	"io"
 	"strings"
+	"sync"
 	"testing"
+	"time"
 )
 
 func TestFilterAll(_ *testing.T) {
@@ -172,3 +174,52 @@ func TestFilterWithContext(t *testing.T) {
 		t.Error("don't read ctx value")
 	}
 }
+
+type traceIDKey struct{}
+
+func setTraceID(ctx context.Context, tid string) context.Context {
+	return context.WithValue(ctx, traceIDKey{}, tid)
+}
+
+func traceIDValuer() Valuer {
+	return func(ctx context.Context) any {
+		if ctx == nil {
+			return ""
+		}
+		if tid := ctx.Value(traceIDKey{}); tid != nil {
+			return tid
+		}
+		return ""
+	}
+}
+
+func TestFilterWithContextConcurrent(t *testing.T) {
+	var buf bytes.Buffer
+	pctx := context.Background()
+	l := NewFilter(
+		With(NewStdLogger(&buf), "trace-id", traceIDValuer()),
+		FilterLevel(LevelInfo),
+	)
+
+	var wg sync.WaitGroup
+	wg.Add(1)
+	go func() {
+		defer wg.Done()
+		time.Sleep(time.Second)
+		NewHelper(l).Info("done1")
+	}()
+
+	wg.Add(1)
+	go func() {
+		defer wg.Done()
+		tid := "world"
+		ctx := setTraceID(pctx, tid)
+		NewHelper((WithContext(ctx, l))).Info("done2")
+	}()
+
+	wg.Wait()
+	expected := "INFO trace-id=world msg=done2\nINFO trace-id= msg=done1\n"
+	if got := buf.String(); got != expected {
+		t.Errorf("got: %#v", got)
+	}
+}
diff --git a/log/log_test.go b/log/log_test.go
index 8221d9ef..7adbba8d 100644
--- a/log/log_test.go
+++ b/log/log_test.go
@@ -1,7 +1,6 @@
 package log
 
 import (
-	"context"
 	"testing"
 )
 
@@ -11,7 +10,3 @@ func TestInfo(_ *testing.T) {
 	logger = With(logger, "caller", DefaultCaller)
 	_ = logger.Log(LevelInfo, "key1", "value1")
 }
-
-func TestWithContext(_ *testing.T) {
-	WithContext(context.Background(), nil)
-}
diff --git a/transport/http/calloption_test.go b/transport/http/calloption_test.go
index 4fe6f3a5..42c2dac0 100644
--- a/transport/http/calloption_test.go
+++ b/transport/http/calloption_test.go
@@ -86,6 +86,19 @@ func TestHeader(t *testing.T) {
 	}
 }
 
+func TestHeaderCallOption_before(t *testing.T) {
+	h := http.Header{"A": []string{"123"}}
+	c := &callInfo{}
+	o := Header(&h)
+	err := o.before(c)
+	if err != nil {
+		t.Errorf("unexpected error: %v", err)
+	}
+	if !reflect.DeepEqual(&h, c.headerCarrier) {
+		t.Errorf("want: %v,got: %v", &h, o.(HeaderCallOption).header)
+	}
+}
+
 func TestHeaderCallOption_after(t *testing.T) {
 	h := http.Header{"A": []string{"123"}}
 	c := &callInfo{}