Giter Club home page Giter Club logo

kafqa's Introduction

KAFQA

Travis Build codecov build Golangci-lint

Kafka quality analyser, measuring data loss, ops, latency

Features

  • You can run as producer and consumer to verify kafka cluster doesn't have issues
  • You can run as producer and consumer separately to another kafka cluster where data is being mirrored and verify latency
  • Easy to increase throughput as it affects latency of cluster
  • Consume an existing topic from kafka cluster and measure latency
  • Live metrics for latencies, ack, throughput and easy to setup alerts on latency threshold breach
  • Deployable with helm chart, scalable with kubernetes

Getting Started

These instruction will help you run kafqa locally against a kafka cluster

Prerequisites

  • running kafka cluster
  • Go >= version 1.12

Steps

  • ensure go modules is enabled GO111MODULES=on if part of GOPATH and having old go version.
  • ensure kafka broker mentioned in config is up.
source kafkqa.env && go build && ./kafkqa

Running tests

  • run make to run tests including linting

Dashboard

prometheus metrics can be viewed in grafana by importing the dashboard in scripts/dasbhoard

The screenshot below shows setup for multiple cluster being tracked and we've alerts on that. 90,50 percentile could be added if required.

  • First pane have 99 %le e2e latency from produce till consume of a kafka message
  • Second pane shows the throughput

Kafqa Aggregated Dashboard

Report

Tool generates report which contains the following information.

  • latency: average, min, max of latency (consumption till msg received)
  • Total messages sent, received and lost
  • App run time
+---+--------------------------------+--------------+
|   |          DESCRIPTION           |    VALUE     |
+---+--------------------------------+--------------+
| 1 | Messages Lost                  |        49995 |
| 2 | Messages Sent                  |        50000 |
| 3 | Messages Received              |            5 |
| 3 | Min Consumption Latency Millis |         7446 |
| 3 | Max Consumption Latency Millis |         7461 |
| 3 | App Run Time                   | 8.801455502s |
+---+--------------------------------+--------------+

This is a static report which helps do quick test. We also have metrics being published runtime, where we've our alerts/dashboards configured on multiple cluster.

Data

Message format sent over kafka

message {
    sequence id
    id (unique) UUID
    timestamp
    random (size s/m/l)
}

Running separate consumer and producers

  • CONSUMER_ENABLED, PRODUCER_ENABLED can be set to only run specific component
  • setting PRODUCER_TOTAL_MESSAGES=-1 will produce the messages infinitely.
# run only consumer
CONSUMER_ENABLED="true"
PRODUCER_ENABLED="false"
  • If you want to consume message produce in proto format from non kafqa producer
  • The latency will be measured from the consumed time to the timestamp given in the proto.
export PROTO_PARSER_ENABLED="true"
export PROTO_PARSER_MESSAGE_NAME="com.test.user.UserLocationLogMessage"
export PROTO_PARSER_FILE_PATH=/proto/test.proto
export PROTO_PARSER_TIMESTAMP_INDEX=3
  • Requires redis store to track and ack messages
STORE_TYPE="redis"
STORE_REDIS_HOST="127.0.0.1:6379"
STORE_RUN_ID="run-$CONSUMER_GROUP_ID"

SSL Setup

Producer and consumer supports SSL, set the following env configuration

CONSUMER_SECURITY_PROTOCOL="ssl"
CONSUMER_CA_LOCATION="/certs/ca/rootCA.crt" # Public root ca certificate
CONSUMER_CERTIFICATE_LOCATION="/certs/client/client.crt" # certificate signed by ICA / root CA
CONSUMER_KEY_LOCATION="/certs/client/client.key" # private key

Disable consumer Auto commit

if consumer is restarted, some messages could be not tracked, as it's committed before processing. To disable and commit after processing the messages (This increases the run time though) set CONSUMER_ENABLE_AUTO_COMMIT="false"

Configuration of application is customisable with kafkq.env eg: tweak the concurrency of producers/consumers.

Deployment

You can install kafqa on kubernetes with helm chart with sample values file

helm install gojektech-incubator/kafqa --name kafqa-producer-001 --values=kafqa-producer.yaml

Contributing

  • Raise an issue to clarify scope/questions, followed by PR
  • Follow go guidelines for development
  • Ensure make succeeds

Thanks for all the Contributors.

License

Licensed under the Apache License, Version 2.0

kafqa's People

Contributors

goyalbhumika avatar devdinu avatar buildai avatar anbarasantr avatar u5surf avatar bhugoya avatar ys-achinta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.