Open anuragagarwal561994 opened 3 months ago
The deletion of a node is already covered by onNodeClose(). If a node is added and logging is enabled (https://aerospike.com/developer/client/logging?client=java), the client sends a log message starting with "Add node".
If this is not sufficient, an extra MetricsListener method called "onNodeOpen(Node node)" could be added. We are currently busy with other tasks, so it needs to wait for now.
I think reading the log message is not the right way, moreover it won't give me the instance of the new node.
I think I can contribute for this simple functionality, also what are your thoughts about using micrometer or any instrumentation in the client?
The goal is to minimize dependencies on 3rd party libraries, so adding an extra instrumentation library dependency is not likely.
May be if possible a separate module can be provided which adds the support or help with OpenTelemetry auto instrumentation.
We tried it ourselves but it will be helpful if done from the side of aerospike I feel.
I am trying to record metrics of aerospike via micrometer client.
So for example if I need to record the connections stats as a gauge I would need to declare it like
Node I can touch the node instance here, once the guage is configured it is done, it will keep monitoring the node.
I can set this up at the start of the client, but when new nodes get added or removed, this is not changed.
If I would have had a listener of when the node is added or removed, I can create a new gauge with the new instance and remove the old one respectively from recording via micrometer.
There exists a MetricListener with the help of which I can somewhat achieve this, in a way:
Now when I know there is a new entry, I can start tracking the gauge. But this metric listener also starts recording the aerospike internal latency metrics as well on which I don't have much control and managing this listener is like an added responsibility for the client.
I think aerospike can provide listeners on addition and deletion of new nodes and moreover if possible I would say do provide the micromerter implementation itself, because that will help larger audience to consistently track client metrics.