Hazenix opened a new pull request, #3843:
URL: https://github.com/apache/dubbo-go/pull/3843
Refs #3841 (the RPC histogram exemplar slice).
## Summary
`metrics.histogram.exemplars` enables trace correlation for RPC latency
samples and OpenMetrics negotiation on the existing Prometheus endpoint.
```text
Local RPC Span
→ carry trace ID and span ID through any generic invocation rewrite
→ snapshot the IDs when the latency observation starts
→ record an exemplar when the RPC observation completes
→ expose it through /metrics with Accept: application/openmetrics-text
```
Automatic filter chains run tracing before metrics when exemplars are
enabled. Explicit filter ordering is preserved. Unsampled or unrelated spans
still yield ordinary observations, and expired async observations produce no
latency sample.
## Evidence
- **Before** — The RPC histogram scrape exposed bucket counts without trace
IDs.
- **After** — In a real Triple generic call with tracing before the
provider's generic filter, the consumer and provider exemplars match the IDs of
their respective recorded spans.
- The regression suite covers both sides of generic rewrites, nested calls,
retries, late and expired async completions, and the OpenMetrics label limit.
The disabled tracing benchmark matched baseline allocations in both noop and
sampled cases.
- `go test ./...` and the affected packages under `-race` passed with the
repository's existing race test exclusions.
## Merge Danger
Reversible with a single revert. The option defaults to off. For enabled
automatic chains, the latency measurement excludes tracing setup and teardown.
### Checklist
- [x] I confirm the target branch is `develop`
- [ ] I have run `make fmt` to format my code
- [ ] I have run `make test` to run local tests
- [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]