apache / apache/pulsar-client-go
Add PhysicalAddr() method to interface Producer and Consumer for client-side metric report?
- Dominant language
- Go
- Stars
- 745
- Forks
- 389
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 3
Description
**Is your feature request related to a problem? Please describe.**
No
**Describe the solution you'd like**
Add method PhysicalAddr() to interface [Producer](https://github.com/apache/pulsar-client-go/blob/master/pulsar/producer.go#L174) and interface [Consumer](https://github.com/apache/pulsar-client-go/blob/master/pulsar/consumer.go#L188) which exposes the broker address to which the producer or consumer connect to.
From the client view, we need to report some metrics such as time-cost, return code and so on everytime we send or consume a msg. It's neccesary to distinguish such metrics among difference brokers for a better observation. While there is no way for the user to obtain the address of the broker connected to, now.
So I think it's useful to add PhysicalAddr() to Producer and Consumer interface.
Contributor guide
Research direction
Start with the Producer interface in pulsar/producer.go around line 174 and the Consumer interface in pulsar/consumer.go around line 188. Locate their concrete implementations and existing tests, then verify how the connected broker address is represented. Done means both interfaces expose PhysicalAddr() and callers can distinguish metrics by broker address.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100