Overview
Kpow is an enterprise-grade toolkit for managing and monitoring Apache Kafka. A central feature for maintaining data governance is its audit log, which records all user actions. To enhance real-time monitoring and integration, Kpow can forward these audit log records to external systems via webhooks.
Kpow has long supported sending these notifications to Slack, and now also supports Microsoft Teams and any generic HTTP webhook server. This makes it possible to receive immediate alerts in your collaboration tools or integrate with custom monitoring systems that accept HTTP POST
requests.
This guide provides a step-by-step walkthrough for configuring webhook integrations in Kpow for Slack, Microsoft Teams, and generic webhook servers. By the end, you’ll be able to stream real-time Kafka activity notifications directly into the platform of your choice.
💡 If you're interested in setting up monitoring and configuring alerts to stay on top of system performance, take a look at our earlier post: Kafka Alerting with Kpow, Prometheus, and Alertmanager.
About Factor House
Factor House is a leader in real-time data tooling, empowering engineers with innovative solutions for Apache Kafka® and Apache Flink®.
Our flagship product, Kpow for Apache Kafka, is the market-leading enterprise solution for Kafka management and monitoring.
Explore our live multi-cluster demo environment or grab a free Community license and dive into streaming tech on your laptop with Factor House Local.
Prerequisites
Webhook integration is an Enterprise feature of Kpow. To follow this guide, you will need an Enterprise license. If you do not have one, you can request a trial license from Factor House to explore this functionality.
Configure webhooks
Kpow has long supported sending webhook notifications to Slack, and now also supports Microsoft Teams and any generic HTTP webhook server. Configuration is handled via environment variables:
Variable | Required | Description |
---|---|---|
WEBHOOK_PROVIDER | Yes | The target provider: slack , teams , or generic |
WEBHOOK_URL | Yes | The endpoint that will receive webhook events via POST |
WEBHOOK_VERBOSITY | No | Event types to send: MUTATIONS , QUERIES , or ALL (default: MUTATIONS ) |
Before starting your Kafka environment, ensure that webhook URLs are created in your chosen platform (Slack, Teams, or generic endpoint).
Slack
To integrate Kpow with Slack, you need to create a Slack App and generate an incoming webhook URL.
Create a Slack app: Navigate to the Slack API website and click on "Create New App". Choose to create it "From scratch".
Name your app and choose a workspace: Provide a name for your application and select the Slack workspace you want to post messages to.
Enable incoming webhooks: In your app's settings page, go to "Incoming Webhooks" under the "Features" section. Toggle the feature on and then click "Add New Webhook to Workspace".
Select a channel: Choose the channel where you want the Kpow notifications to be posted and click "Allow".
Copy the webhook URL: After authorizing, you will be redirected back to the webhook configuration page. Copy the newly generated webhook URL. This URL is what you will use to configure Kpow.
Microsoft Teams
For Microsoft Teams, integration can be set up through workflows by creating a flow that listens for an HTTP request.
Create a new flow: Navigate to workflows and start creating a new flow.
Search for the webhook template: In the flow creation interface, search for the keyword "webhook" to find relevant templates. Select the "Send webhook alterts to a channel" template.
Name the flow and click next: Enter a name for your flow, then click Next.
Select the team and channel Name: Choose the Microsoft Teams team and channel name, then click Create flow.
Copy the webhook URL: Copy the newly generated webhook URL. This URL is what you will use to configure Kpow.
Generic webhook server
A generic webhook allows you to send Kpow's audit log events to any custom application or third-party service that can receive HTTP POST requests. This is useful for integrating with systems that are not officially supported out-of-the-box or for building custom automation workflows. The payload is sent in JSON format, allowing for easy parsing and processing.
For this guide, we will be using a simple web server developed using Python Flask.
Launch Kafka environment
To test the webhook functionality, use the webhook-demo in the features folder of the Factor House examples repository on GitHub. This demo spins up three Kpow instances, each configured to send audit log messages to a different destination: Slack, Microsoft Teams, and a generic web server running on ports 3000, 4000, and 5000.
# Clone the examples repository git clone https://github.com/factorhouse/examples.git # Move to the web cd features/webhook-demo # Start Kafka environment with multiple Kpow instances that target different webhook backends # Replace the placeholder values with your actual license and webhook URLs export KPOW_LICENSE="<path-to-license-file>" export SLACK_WEBHOOK_URL="<slack-webhook-url>" export TEAMS_WEBHOOK_URL="<teams-webhook-url>" export GENERIC_WEBHOOK_URL="http://webhook-server:9000" docker compose up
Verify Slack webhook messages
To test the Slack integration, perform an action in Kpow that generates an audit event, such as creating and then deleting a topic. You can access the Kpow UI at http://localhost:3000
.
Create a topic
The example below shows how to create a new topic in Kpow.
Delete a topic
Similarly, you can delete a topic in Kpow as shown here.
View audit logs
After performing these actions, you can verify they have been logged by navigating to Settings > Audit log in the Kpow UI.
On the Slack channel, you should see messages detailing the actions. Each message includes information such as the user who performed the action, the type of action (e.g., create-topic
), and the cluster environment name.
Verify Teams webhook messages
The process to verify messages in Microsoft Teams is the same. After creating and deleting a topic in the Kpow UI (accessible at http://localhost:4000
), your Power Automate flow will trigger, and you will see the corresponding formatted message in your designated Teams channel.
Verify generic webhook messages
For the generic webhook, inspect the logs of the webhook server container by running docker logs webhook-server
. The logs display the raw JSON payloads that Kpow sends for topic creation and deletion events, giving you insight into the data structure you can leverage for custom integrations.
Conclusion
Kpow's webhook integration is a powerful feature for enhancing the monitoring and security of your Apache Kafka environment. By sending real-time audit log notifications to platforms like Slack and Microsoft Teams, or to any custom endpoint via a generic webhook, you can ensure that your team is immediately aware of important events and changes. This capability not only improves transparency and collaboration but also allows for the creation of custom automation and integration with other operational tools, making your Kafka management more proactive and efficient.