dodjdnh opened a new pull request, #3838:
URL: https://github.com/apache/dubbo-go/pull/3838

   ### Description
   
   Fixes #3831
   
   #### Problem
   `otelClientFilter` runs inside `ProtocolFilterWrapper` per endpoint attempt 
rather than once per logical consumer RPC. As a result, `failover` retries emit 
disconnected client spans, pre-filter cluster failures (such as no available 
provider) emit no trace at all, and error paths omit `RecordError` and 
consistent error classification.
   
   #### Changes
   - Add a consumer `ClusterInterceptor` (`SpanKindInternal`, 
`<ActualMethodName> cluster`) enabled only when `otelClientTrace` is present in 
`reference.filter` (and not excluded via `-otelClientTrace`), with zero 
allocations when disabled and `invocation`-pointer binding to isolate nested or 
unsampled calls.
   - Emit low-cardinality `cluster.select`, `cluster.retry`, and 
`cluster.no_provider` events from `BaseClusterInvoker` and serial `failover` 
via context-local `cluster.Diagnostics`, while guarding nil URLs and redacting 
credentials in `CheckInvokers` errors.
   - Keep existing per-attempt `SpanKindClient` naming and independent 
`traceparent` injection unchanged so provider `Server` spans attach to the 
exact attempt; record `exception` events and `error.type` attributes aligned 
with `metrics/rpc` precedence.
   - Ensure single `span.End()` across normal completion, deadline/cancellation 
(`context.AfterFunc` + `sync.Once` without overwriting completed RPC results), 
and panics. (`forking` shared-invocation concurrency and async callback 
completion are outside this scope.)
   
   #### Verification
   - `PASS` (`04f468980`): `go test -count=1 -p 2 -race ./filter/otel/trace/... 
./cluster/...` (27 packages `ok`, including HTTP loopback retry, no-provider, 
cancellation race, disabled `0 allocs`, and error-category precedence).
   - `PASS` (`04f468980`): `go vet ./cluster/cluster/... 
./filter/otel/trace/...` and `git diff --check origin/develop...HEAD`.
   - `PASS` (isolated E2E on pre-review revision; not re-run after the final 
review-fix refactor, which is covered by `go test -count=1 -p 2 -race` above): 
Triple + Nacos + Jaeger + Grafana fault-injection runs verified by Jaeger API 
assertions:
     - Failover retry success (`ce3e81c0324ede99633849d89f797ddd`)
     - No available provider (`70c813fe217a88cb1883558585ab3796`)
     - Timeout cancellation (`3547a1784c836bc2f75633061e76044d`)
   - `NOT VERIFIED` locally: full-repo `make fmt`, `make lint`, full-repo `make 
test` / `make test-race`, and `./integrate_test.sh` (scoped formatting ran on 
changed packages; full-repo checks will run in GitHub Actions CI).
   
   #### E2E Evidence
   
![jaeger-retry-success](https://gist.githubusercontent.com/dodjdnh/1172b7fcc70481c60f95601e093379dd/raw/50135c5f1c88d55c7269d3de09782adb9a4216d3/jaeger-retry-success.png)
   
![jaeger-no-provider](https://gist.githubusercontent.com/dodjdnh/1172b7fcc70481c60f95601e093379dd/raw/50135c5f1c88d55c7269d3de09782adb9a4216d3/jaeger-no-provider.png)
   
![jaeger-timeout](https://gist.githubusercontent.com/dodjdnh/1172b7fcc70481c60f95601e093379dd/raw/50135c5f1c88d55c7269d3de09782adb9a4216d3/jaeger-timeout.png)
   
![grafana-trace](https://gist.githubusercontent.com/dodjdnh/1172b7fcc70481c60f95601e093379dd/raw/50135c5f1c88d55c7269d3de09782adb9a4216d3/grafana-trace.png)
   
   Related to #3562, #3338, #3551, #3784, #3837
   
   ### Checklist
   - [x] I confirm the target branch is `develop`
   - [ ] I have run `make fmt` to format my code (scoped formatting ran on 
changed packages; full-repo `make fmt` pending CI)
   - [ ] I have run `make test` to run local tests (27 affected packages passed 
`-race`; full-repo `make test` pending CI)
   - [x] I have added tests that prove my fix is effective or that my feature 
works


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to