activesphere / kqm Goto Github PK
View Code? Open in Web Editor NEWKafka consumer lag offset monitor with StatsD support
Kafka consumer lag offset monitor with StatsD support
Instead of using recover
in the double defer
blocks to handle a panic
while writing to a closed channel, we should use the Done()
channel provided by the context
to see if the message
channel is closed and if it is, write to the error
channel so that the function becomes eligible for a retry
.
We should use docker-compose to spawn docker containers which will run the tests. Next step to this will be automating the test execution by configuring Travis CI (#4).
Essential components of the system should be placed in different containers instead of a single one. This will enable us to look out for corner cases related to network latencies, network failures etc. We should also use a tool like Toxiproxy to introduce network faults/throttles.
Container configuration should be as follows:
go
preinstalled. Let's call this Container A
.Container B
.Container C
.Container C
will act as an intermediary for all network requests between Container A
and Container B
i.e. it will act like a man-in-the-middle proxy, which will enable us to introduce network failures between kqm
and kafka
.
The objective of the tests for this configuration is pretty straightforward:
kqm
A
and B
from the tests (using Toxiproxy's http api).kqm
's behaviour (whether it fails or retries or something).kqm
functions properly.kqm
w.r.t connecting to kafka
..travis.yml
needs to be setup to run the tests in the docker container. When this is done we should be able to simply have Travis integrated with Github, with it's status on the repository homepage.
The test configuration for Travis CI currently pull and tests the master
branch only. This makes the running of tests for PRs on feature branches ineffective. Thus, we need to fetch the current branch from Travis CI's environment variables and pull the code from the concerned branch and run the tests accordingly.
Presently, consumeMessages()
signals that the messages
channel has been closed and that it's eligible for a retry (rather, a restart for this case). Theoretically, the message
channel in not supposed to close on errors, since errors are separately written to another channel called errors
(See: https://godoc.org/github.com/Shopify/sarama#PartitionConsumer).
We aren't using that errors
channel and so we do not need to worry about the errors returned by sarama's PartitionConsumer. What's important for us is that if in the odds that the messages
channel in the consumeMessages()
closes, we need to restart it, so that KQM
keeps functioning properly and is in sync with the __consumer_offsets
topic.
Our aim for this issue is to try and minimize the complexity associated with the restart of consumeMessages()
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.