Extension Icon

Kafka

Kafka extension for Raycast
AvatarFrançois Onimus
93 Installs
Overview

Kafka extension

Extension to quickly consult topics and consumers of kafka broker

Configuration

NameRequiredDefaultExampleDescription
configDirectoryYes~/.kafka//kafka-config/Configuration directory containing env files

Environment file

Environment file must be a json in the configuration directory with following fields :

export interface KafkaEnv {
  // env name to display on raycast dropdown
  name: string;
  // to filter topics by keyword(s)
  filterTopics?: string[];
  // to filter consumers by keyword(s)
  filterConsumers?: string[];
  // kafka js configuration for broker, authentication, etc
  kafkaJs: KafkaConfig;
}

Following kafkaJS configuration is used by default :

const defaultConfiguration = {
  connectionTimeout: 10000,
  requestTimeout: 30000,
  logLevel: logLevel.ERROR
};

More info on configuring kafkaJS here

Example

{
  "name": "Dev",
  "filterTopics": [
    "my-prefix-for-dev"
  ],
  "filterConsumers": [
    "dev",
    "def"
  ],
  "kafkaJs": {
    "brokers": [
      "kafka-host:kafka-port"
    ],
    "sasl": {
      "mechanism": "plain",
      "username": "user",
      "password": "password"
    }
  }
}

Kafka command

  • List and consult topic configurations
  • List consumers with state, members and overall lag

Configuration

NameRequiredDefaultExampleDescription
extractRegexNo-topic_(.*)_(.*)_(.*)Regex to extract information from topic name
extractTitleGroupNo-1Group to get from regex to display title
extractSubTitleGroupNo-2Group to get from regex to display subtitle
extractMetadataNameAndGroupNo-Application=3Extract metadata from regex

Note: in this example, with a topic named topic_NAME_OWNER_APP, the title would be NAME, the subtitle OWNER, and in the side panel we would have the following metadata Application=APP. If you don't set extractRegex full topic name will be displayed.

Kafka menu bar command

Have kafka in menu bar with background actualization every 5 minutes

Configuration

NameRequiredDefaultDescription
hideWithoutLagNotrueHide consumers without lag to avoid long lists
sendNotificationNofalseSend macos notification if at least one consumer has lag
notificationThresholdNo1000Notification threshold to not exceed to send macos notification (need sendNotification to be true)