Class MonitoringStreamsInterceptorConfig
- java.lang.Object
-
- io.streamthoughts.azkarra.runtime.interceptors.MonitoringStreamsInterceptorConfig
-
public class MonitoringStreamsInterceptorConfig extends Object
The configuration class forMonitoringStreamsInterceptor
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
MONITORING_INTERCEPTOR_ADVERTISED_SERVER_CONFIG
monitoring.streams.interceptor.advertised.server
static String
MONITORING_INTERCEPTOR_ENABLE_STORES_LAG_CONFIG
monitoring.streams.interceptor.info.enabled.stores.lag
static String
MONITORING_INTERCEPTOR_EXTENSIONS_CONFIG
monitoring.streams.interceptor.ce.extensions
static String
MONITORING_INTERCEPTOR_INTERVAL_MS_CONFIG
monitoring.streams.interceptor.interval.ms
static long
MONITORING_INTERCEPTOR_INTERVAL_MS_DEFAULT
static String
MONITORING_INTERCEPTOR_PRODUCER_PREFIX
Prefix used to isolateproducer
configs from other client configs.static String
MONITORING_INTERCEPTOR_REPORTERS_CLASSES_CONFIG
monitoring.streams.interceptor.info.enabled.stores.lag
static String
MONITORING_INTERCEPTOR_TOPIC_CONFIG
monitoring.streams.interceptor.topic
static String
MONITORING_INTERCEPTOR_TOPIC_DEFAULT
static String
MONITORING_STREAMS_INTERCEPTOR_ENABLE_CONFIG
monitoring.streams.interceptor.enable
static String
MONITORING_STREAMS_INTERCEPTOR_KAFKA_REPORTER_ENABLE_CONFIG
monitoring.streams.interceptor.enable
-
Constructor Summary
Constructors Constructor Description MonitoringStreamsInterceptorConfig(Conf originals)
Creates a newMonitoringStreamsInterceptorConfig
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
getAdvertisedServer()
Get the server name that will be included in monitoring events.CloudEventsExtension
getExtensions()
Get the list of extension attributes that should be included in monitoring events.Optional<Long>
getIntervalMs()
Get the period the interceptor should use to send a streams state event (Default is 10 seconds).Map<String,Object>
getProducerConfigs(String clientId)
Get the configs for theproducer
.Collection<MonitoringReporter>
getReporters()
Optional<String>
getTopic()
Get the topic on which monitoring event will be sent (Default is _azkarra-streams-monitoring).boolean
isKafkaReporterEnabled()
boolean
isStoresLagsEnabled()
Checks if offset lags should be monitored for all local state stores.static String
producerPrefix(String producerProp)
Prefix a property withMONITORING_INTERCEPTOR_PRODUCER_PREFIX
.
-
-
-
Field Detail
-
MONITORING_STREAMS_INTERCEPTOR_ENABLE_CONFIG
public static String MONITORING_STREAMS_INTERCEPTOR_ENABLE_CONFIG
monitoring.streams.interceptor.enable
-
MONITORING_INTERCEPTOR_PRODUCER_PREFIX
public static final String MONITORING_INTERCEPTOR_PRODUCER_PREFIX
Prefix used to isolateproducer
configs from other client configs. It is recommended to useproducerPrefix(String)
to add this prefix toproducer properties
.- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_INTERVAL_MS_CONFIG
public static final String MONITORING_INTERCEPTOR_INTERVAL_MS_CONFIG
monitoring.streams.interceptor.interval.ms
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_INTERVAL_MS_DEFAULT
public static final long MONITORING_INTERCEPTOR_INTERVAL_MS_DEFAULT
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_TOPIC_CONFIG
public static final String MONITORING_INTERCEPTOR_TOPIC_CONFIG
monitoring.streams.interceptor.topic
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_TOPIC_DEFAULT
public static final String MONITORING_INTERCEPTOR_TOPIC_DEFAULT
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_ADVERTISED_SERVER_CONFIG
public static final String MONITORING_INTERCEPTOR_ADVERTISED_SERVER_CONFIG
monitoring.streams.interceptor.advertised.server
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_ENABLE_STORES_LAG_CONFIG
public static final String MONITORING_INTERCEPTOR_ENABLE_STORES_LAG_CONFIG
monitoring.streams.interceptor.info.enabled.stores.lag
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_EXTENSIONS_CONFIG
public static final String MONITORING_INTERCEPTOR_EXTENSIONS_CONFIG
monitoring.streams.interceptor.ce.extensions
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_REPORTERS_CLASSES_CONFIG
public static final String MONITORING_INTERCEPTOR_REPORTERS_CLASSES_CONFIG
monitoring.streams.interceptor.info.enabled.stores.lag
- See Also:
- Constant Field Values
-
MONITORING_STREAMS_INTERCEPTOR_KAFKA_REPORTER_ENABLE_CONFIG
public static String MONITORING_STREAMS_INTERCEPTOR_KAFKA_REPORTER_ENABLE_CONFIG
monitoring.streams.interceptor.enable
-
-
Constructor Detail
-
MonitoringStreamsInterceptorConfig
public MonitoringStreamsInterceptorConfig(Conf originals)
Creates a newMonitoringStreamsInterceptorConfig
instance.- Parameters:
originals
- theConf
instance.
-
-
Method Detail
-
producerPrefix
public static String producerPrefix(String producerProp)
Prefix a property withMONITORING_INTERCEPTOR_PRODUCER_PREFIX
. This is used to isolateproducer configs
.- Parameters:
producerProp
- the producer property to be masked- Returns:
- WATCHER_PRODUCER_PREFIX +
producerProp
-
isKafkaReporterEnabled
public boolean isKafkaReporterEnabled()
-
getReporters
public Collection<MonitoringReporter> getReporters()
-
getIntervalMs
public Optional<Long> getIntervalMs()
Get the period the interceptor should use to send a streams state event (Default is 10 seconds).- Returns:
- the period in milliseconds.
-
getAdvertisedServer
public Optional<String> getAdvertisedServer()
Get the server name that will be included in monitoring events. If not specified, the streamsapplication.server
property is used."- Returns:
- an optional advertised server name.
-
getTopic
public Optional<String> getTopic()
Get the topic on which monitoring event will be sent (Default is _azkarra-streams-monitoring).- Returns:
- the name of the topic.
-
getExtensions
public CloudEventsExtension getExtensions()
Get the list of extension attributes that should be included in monitoring events.- Returns:
- the
CloudEventsExtension
.
-
isStoresLagsEnabled
public boolean isStoresLagsEnabled()
Checks if offset lags should be monitored for all local state stores.- Returns:
false
by default.
-
getProducerConfigs
public Map<String,Object> getProducerConfigs(String clientId)
Get the configs for theproducer
. Properties using the prefixMONITORING_INTERCEPTOR_PRODUCER_PREFIX
will be used in favor over their non-prefixed versions .- Parameters:
clientId
- clientId- Returns:
- Map of the producer configuration.
-
-