Configuration file syntax and settings ¶
The configuration files passed as inputs to the kafka-connect-watcher are going to be evaluated and checked with jsonschema which validates the structure and validity of the input.
Below is the JSON schema definition, found in kafka_connect_watcher/watcher-config.spec.json
Kafka Connect Watcher configuration input ¶
watcher-config.spec.json |
|||||
Schema of the configuration for Kafka Connect Watcher |
|||||
type |
object |
||||
properties |
|||||
|
List of Connect clusters to monitor. |
||||
type |
array |
||||
items |
#/definitions/ConnectCluster |
||||
uniqueItems |
True |
||||
|
|||||
|
#/definitions/NotificationChannels |
||||
|
type |
object |
|||
properties |
|||||
|
override log group name to publish metrics to. Importance: High |
||||
type |
string |
||||
default |
kafka/connect/watcher/metrics |
||||
|
override value for EMF Service name. Importance: Low |
||||
type |
string |
||||
|
#/definitions/aws_emf |
||||
|
intervals converted to seconds between scans of all clusters. |
||||
type |
string |
||||
patternProperties |
|||||
|
|||||
additionalProperties |
False |
||||
definitions |
|||||
|
type |
object |
|||
properties |
|||||
|
Connect cluster endpoint/IP Address |
||||
type |
string |
||||
|
Connect cluster API Port |
||||
type |
integer |
||||
default |
8083 |
||||
|
The URL to the connect cluster, instead of hostname/port combination. |
||||
type |
string |
||||
|
Basic Authentication |
||||
#/definitions/BasicAuth |
|||||
|
Ignore SSL related errors (CA, self-signed) |
||||
type |
boolean |
||||
|
Configure metrics export for the connect cluster |
||||
#/definitions/ClusterMetrics |
|||||
|
List of rules (in-order) to execute if matching connectors state is not RUNNING |
||||
type |
array |
||||
items |
#/definitions/ErrorHandlingRule |
||||
uniqueItems |
True |
||||
|
type |
object |
|||
properties |
|||||
|
List of regular expressions or single regular expression to match and include for the error rule handling |
||||
oneOf |
type |
string |
|||
type |
array |
||||
items |
type |
string |
|||
|
List of regular expressions or single regular expression to exclude connectors for the error rule handling |
||||
oneOf |
type |
string |
|||
type |
array |
||||
items |
type |
string |
|||
|
If the connector is in PAUSED state, ignores it. |
||||
type |
boolean |
||||
default |
False |
||||
|
List (in-order) of actions to take in attempt to restore the connector. |
||||
type |
array |
||||
items |
#/definitions/AutoCorrectAction |
||||
additionalProperties |
False |
||||
|
type |
object |
|||
properties |
|||||
|
type |
string |
|||
enum |
restart, pause, cycle, notify_only |
||||
|
duration to wait before checking on the connector status post action |
||||
type |
string |
||||
|
type |
array |
|||
items |
#/definitions/AutoCorrectActionNotify |
||||
|
#/definitions/OnActionFailure |
||||
|
type |
object |
|||
properties |
|||||
|
type |
string |
|||
|
type |
object |
|||
properties |
|||||
|
type |
string |
|||
enum |
INFO, ERROR, DEBUG, TRACE, WARN |
||||
|
type |
object |
|||
properties |
|||||
|
type |
object |
|||
properties |
|||||
|
type |
boolean |
|||
|
#/definitions/aws_emf |
||||
|
type |
object |
|||
properties |
|||||
|
type |
string |
|||
|
|||||
type |
boolean |
||||
default |
False |
||||
|
Dimension name and value to set in a key/value format. |
||||
type |
object |
||||
patternProperties |
|||||
|
Value for the given dimension |
||||
type |
string |
||||
maxProperties |
25 |
||||
minProperties |
1 |
||||
|
type |
boolean |
|||
|
type |
object |
|||
properties |
|||||
|
type |
string |
|||
|
type |
string |
|||
additionalProperties |
False |
||||
|
type |
object |
|||
properties |
|||||
|
type |
object |
|||
patternProperties |
|||||
|
#/definitions/SnsTopicChannel |
||||
additionalProperties |
False |
||||
|
type |
object |
|||
properties |
|||||
|
ARN of the SNS topic. |
||||
type |
string |
||||
|
Optional - Use IAM role to publish messages using another IAM role |
||||
type |
string |
||||
|
Prevents exception if true when an exception occurs. |
||||
type |
boolean |
||||
|
Allows to set specific templates for email and sms |
||||
type |
object |
||||
properties |
|||||
|
Optional - Path to a template for SNS Email messages |
||||
type |
string |
||||
|
Optional - Path to a template for SNS SMS messages |
||||
type |
string |
||||
additionalProperties |
False |
||||
additionalProperties |
False |
Definition ¶
{
"$schema": "http://json-schema.org/draft-07/schema#",
"id": "watcher-config.spec.json",
"$id": "watcher-config.spec.json",
"title": "Kafka Connect Watcher configuration input",
"description": "Schema of the configuration for Kafka Connect Watcher",
"type": "object",
"additionalProperties": false,
"properties": {
"clusters": {
"description": "List of Connect clusters to monitor.",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/ConnectCluster"
}
},
"prometheus": {},
"notification_channels": {
"$ref": "#/definitions/NotificationChannels"
},
"aws_emf": {
"type": "object",
"properties": {
"log_group_name": {
"type": "string",
"description": "override log group name to publish metrics to. Importance: High",
"default": "kafka/connect/watcher/metrics"
},
"service_name": {
"type": "string",
"description": "override value for EMF Service name. Importance: Low"
},
"watcher_config": {
"$ref": "#/definitions/aws_emf"
}
}
},
"watch_interval": {
"type": "string",
"description": "intervals converted to seconds between scans of all clusters."
}
},
"definitions": {
"ConnectCluster": {
"type": "object",
"required": [
"hostname"
],
"properties": {
"hostname": {
"description": "Connect cluster endpoint/IP Address",
"type": "string"
},
"port": {
"description": "Connect cluster API Port",
"type": "integer",
"default": 8083
},
"url": {
"type": "string",
"description": "The URL to the connect cluster, instead of hostname/port combination."
},
"authentication": {
"description": "Basic Authentication",
"$ref": "#/definitions/BasicAuth"
},
"ignore_https_error": {
"type": "boolean",
"description": "Ignore SSL related errors (CA, self-signed)"
},
"metrics": {
"description": "Configure metrics export for the connect cluster",
"$ref": "#/definitions/ClusterMetrics"
},
"error_handling_rules": {
"type": "array",
"uniqueItems": true,
"description": "List of rules (in-order) to execute if matching connectors state is not RUNNING",
"items": {
"$ref": "#/definitions/ErrorHandlingRule"
}
}
}
},
"ErrorHandlingRule": {
"type": "object",
"additionalProperties": false,
"properties": {
"include_regex": {
"description": "List of regular expressions or single regular expression to match and include for the error rule handling",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"exclude_regex": {
"description": "List of regular expressions or single regular expression to exclude connectors for the error rule handling",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"ignore_paused": {
"type": "boolean",
"description": "If the connector is in PAUSED state, ignores it.",
"default": false
},
"auto_correct_actions": {
"description": "List (in-order) of actions to take in attempt to restore the connector.",
"type": "array",
"items": {
"$ref": "#/definitions/AutoCorrectAction"
}
}
}
},
"AutoCorrectAction": {
"type": "object",
"required": [
"action"
],
"properties": {
"action": {
"type": "string",
"enum": [
"restart",
"pause",
"cycle",
"notify_only"
]
},
"wait_for_status": {
"type": "string",
"description": "duration to wait before checking on the connector status post action"
},
"notify": {
"type": "array",
"items": {
"$ref": "#/definitions/AutoCorrectActionNotify"
}
},
"on_action_failure": {
"$ref": "#/definitions/OnActionFailure"
}
}
},
"AutoCorrectActionNotify": {
"type": "object",
"properties": {
"target": {
"type": "string"
}
}
},
"OnActionFailure": {
"type": "object",
"properties": {
"log_level": {
"type": "string",
"enum": [
"INFO",
"ERROR",
"DEBUG",
"TRACE",
"WARN"
]
}
}
},
"ClusterMetrics": {
"type": "object",
"properties": {
"prometheus": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
},
"aws_emf": {
"$ref": "#/definitions/aws_emf"
}
}
},
"aws_emf": {
"type": "object",
"required": [
"namespace"
],
"properties": {
"namespace": {
"type": "string"
},
"high_resolution_metrics": {
"type": "boolean",
"default": false,
"description": "https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics"
},
"dimensions": {
"type": "object",
"uniqueItems": true,
"minProperties": 1,
"maxProperties": 25,
"description": "Dimension name and value to set in a key/value format.",
"patternProperties": {
"^\\w+$": {
"type": "string",
"description": "Value for the given dimension"
}
}
},
"enabled": {
"type": "boolean"
}
}
},
"BasicAuth": {
"type": "object",
"additionalProperties": false,
"required": [
"username",
"password"
],
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"NotificationChannels": {
"type": "object",
"additionalProperties": false,
"properties": {
"sns": {
"type": "object",
"uniqueItems": true,
"patternProperties": {
"^[a-zA-Z0-9-_]+$": {
"$ref": "#/definitions/SnsTopicChannel"
}
}
}
}
},
"SnsTopicChannel": {
"type": "object",
"additionalProperties": false,
"required": ["topic_arn"],
"properties": {
"topic_arn": {
"type": "string",
"description": "ARN of the SNS topic."
},
"role_arn": {
"type": "string",
"description": "Optional - Use IAM role to publish messages using another IAM role"
},
"ignore_errors": {
"type": "boolean",
"description": "Prevents exception if true when an exception occurs."
},
"template": {
"type": "object",
"description": "Allows to set specific templates for email and sms ",
"additionalProperties": false,
"properties": {
"email": {
"type": "string",
"description": "Optional - Path to a template for SNS Email messages"
},
"sms": {
"type": "string",
"description": "Optional - Path to a template for SNS SMS messages"
}
}
}
}
}
},
"patternProperties": {
"^x-": {}
}
}