Interface Provider
- All Superinterfaces:
org.apache.kafka.common.Configurable
- All Known Implementing Classes:
ControlCenterProvider, KafkaClientProvider, KafkaConnectProvider, KafkaRestProvider, KafkaServerProvider, KafkaStreamsProvider, KsqlProvider, SchemaRegistryProvider
public interface Provider
extends org.apache.kafka.common.Configurable
Implement this interface to collect metrics for your component. You will need to register your
implementation in
ProviderRegistry.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionInclude list for configvoidcontextChange(org.apache.kafka.common.metrics.MetricsContext metricsContext) Sets the metrics labels for the service or library exposing metrics.domain()Domain of the active provider.default List<MetricsCollector> extraCollectors(Context ctx) The collector for Kafka Metrics library is enabled by default.The metrics include regular expression list used as a default value for this provider.io.opentelemetry.proto.resource.v1.Resourceresource()The resource for this provider.booleanValidate that all the data required for generating correct metrics is present.Methods inherited from interface org.apache.kafka.common.Configurable
configure
-
Field Details
-
EXCLUDE_ALL
-
-
Method Details
-
validate
boolean validate(org.apache.kafka.common.metrics.MetricsContext metricsContext, Map<String, ?> config) Validate that all the data required for generating correct metrics is present. The provider will be disabled if validation fails.- Parameters:
metricsContext-MetricsContext- Returns:
- false if all the data required for generating correct metrics is missing, true otherwise.
-
domain
String domain()Domain of the active provider. This is used by other parts of the reporter.- Returns:
- Domain in string format.
-
resource
io.opentelemetry.proto.resource.v1.Resource resource()The resource for this provider.- Returns:
- A fully formed
Resourcewill all the tags.
-
contextChange
void contextChange(org.apache.kafka.common.metrics.MetricsContext metricsContext) Sets the metrics labels for the service or library exposing metrics. This will be called beforeMetricsReporter.init(List)and may be called anytime after that.- Parameters:
metricsContext-MetricsContext
-
metricsIncludeRegexDefault
-
extraCollectors
The collector for Kafka Metrics library is enabled by default. If you need any more, add them here.- Parameters:
ctx-Context- Returns:
- List of extra collectors
-
configInclude
-