Hello,

I’m new to the Kafka project and would like to contribute. I came across the
“SSL hot reload support” ticket and started working on a KIP for it.
This feature
is particularly relevant for my use case, as we rely on mTLS with short-lived
client certificates and want to avoid restarting client applications.

During the mailing list discussion, it was suggested to add metrics,
which makes
sense from an observability and operability standpoint. Since I’m still getting
familiar with the Kafka codebase, I’d like to clarify the recommended approach
for introducing new metrics.

I see that org.apache.kafka.common.metrics.Metrics provides multiple
constructors.
Is the expected pattern to reuse an existing Metrics instance from a
higher layer
and pass it down (e.g., to SslFactory), or is it acceptable to create
a new instance
locally?

If the preferred approach is to reuse an existing instance and
propagate it downwards,
wouldn’t that imply changing method signatures to pass the Metrics
instance through
the relevant layers?

If creating a new instance is acceptable, is using the no-arg constructor the
right approach, or should it be initialized with specific components
(e.g., reporters,
time, config)?

If there are existing examples in the codebase or documentation that illustrate
the preferred pattern, pointers would be very helpful.

Thanks,
Skander

Reply via email to