Skip to main content

A tool for monitoring tasks and connectors in Kafka Connect.

Project description

ConnectMon

A tool for monitoring tasks and connectors in Kafka Connect.

Installation

With pip

pip install connectmon

With poetry

poetry add connectmon

Usage

from connectmon.config import settings
from connectmon.api import API

## Setup your API you can get your environment variables from connectmon.config.settings
connect = API(settings.CONNECT_URL)

if not connect.is_reachable():
    raise Exception("Cluster is not reachable")

## Get a list of connectors and their status
connectors = connect.get_all_connector_status()

## Restart any failed or paused connectors and collect messages along the way
errors_and_warning = connect.restart_failed_connectors_if_any(connectors)

## If any channels have been registered in the configuration supplied through CONFIG_PATH 
## And there were any connectors or tasks to reset
## Then process each channel
if settings.CHANNELS and len(errors_and_warnings) > 0:
    for channel in settings.CHANNELS.channels:
        
        if channel.type == "teams":
            print(f"Sending message to {channel.name}...")
            teams_msg = build_teams_message(channel.url, errors_and_warnings)
            teams_msg.send()

Configuration

Name Type Description
CONNECT_URL string The URL of the Connect cluster
ENVIRONMENT string The environment the application is running in
LOG_LEVEL string The log level for the application
LOG_FORMAT string The log format for the application
CONFIG_PATH Optional string The path to the configuration file

If CONFIG_PATH is provided, the application will attempt to load configuration from the file, which will set settings.CHANNELS with the channels configured in the supplied configuration file.

A config file could look like this

channels:
  - name: my-teams-team-name
    type: teams
    url: https://my-org.webhook.office.com/webhookb2/...
    include:
        - i-want-to-monitor-this-connector
        - this-too
    exclude:
        - who-cares-about-this-connector
        - this-is-someone-elses-problem

Current only Microsoft Teams is supported. More will come if requested.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

connectmon-0.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

connectmon-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file connectmon-0.1.1.tar.gz.

File metadata

  • Download URL: connectmon-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.10 Darwin/22.2.0

File hashes

Hashes for connectmon-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ee97da0ad495fc7a799869dde661d6728986ef1f909efe24e145f3291d7b9e83
MD5 7cef48823db6cf12b9028f4674edf659
BLAKE2b-256 4001549b7d034cc88c068bbac01520498ba0f5d7d89b599dbb69f4522d7261fd

See more details on using hashes here.

Provenance

File details

Details for the file connectmon-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: connectmon-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.10 Darwin/22.2.0

File hashes

Hashes for connectmon-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da807c8a1f4639f3d78e8d1865d281bb3c2595b34e32472ce1f237f306f41903
MD5 1b025055291b175eb0c4d7e07811fc35
BLAKE2b-256 7d72b0d8039f26ef258f17c589752793a238671f40f87867d3950a2fcf432e8a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page