Class ClientIdKeyStrategy
- java.lang.Object
-
- io.factorhouse.kpow.key.ClientIdKeyStrategy
-
- All Implemented Interfaces:
KeyStrategy
public class ClientIdKeyStrategy extends Object implements KeyStrategy
AKeyStrategyimplementation that derives the key for metrics data using the client ID and application ID of the active Kafka Streams instance.This strategy simplifies the configuration process by relying solely on the client ID and application ID, eliminating the need for a Kafka
AdminClient. It is particularly suitable for constrained environments where creating anAdminClientmay not be feasible or appropriate due to security concerns.Important: In a multi-cluster Kpow deployment, where the same application ID and client ID are used across multiple environments (e.g., staging, development, production), this strategy cannot determine which cluster the Kafka Streams instance is associated with. This limitation may impact the accuracy of metrics alignment in the Kpow UI for such setups.
This strategy is most effective in single-cluster deployments, lightweight environments, or scenarios where client IDs and application IDs are guaranteed to be unique across clusters.
-
-
Constructor Summary
Constructors Constructor Description ClientIdKeyStrategy()Constructs a new instance of theClientIdKeyStrategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaxongetTaxon(String clientId, String applicationId)Resolves the unique key for metric records based on the provided clientID and applicationID of the registered Kafka Streams application.
-
-
-
Constructor Detail
-
ClientIdKeyStrategy
public ClientIdKeyStrategy()
Constructs a new instance of theClientIdKeyStrategy.
-
-
Method Detail
-
getTaxon
public Taxon getTaxon(String clientId, String applicationId)
Description copied from interface:KeyStrategyResolves the unique key for metric records based on the provided clientID and applicationID of the registered Kafka Streams application.The resolved key, represented as a
Taxon, serves as the primary identifier for grouping and organizing metrics data in Kpow's snapshots topic. This enables Kpow to align the metrics with the correct Kafka Streams application in the UI.- Specified by:
getTaxonin interfaceKeyStrategy- Parameters:
clientId- The client ID of the registered streams application.applicationId- The application ID of the registered Kafka streams application.- Returns:
- The unique Taxon object representing the key.
-
-