All Projects → mre → Kafka Influxdb

mre / Kafka Influxdb

Licence: apache-2.0
High performance Kafka consumer for InfluxDB. Supports collectd message formats.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Kafka Influxdb

Performance Testing Framework
Framework allows to perform load testing with Apache Jmeter, view application/server metrics in real-time with Grafana, analyze errors cause with detailed traces for failed requests, compare different test runs in scripted dashboard and perform frontend performance testing with sitespeed.io+webpagetest
Stars: ✭ 275 (+33.5%)
Mutual labels:  influxdb, performance
Qbusbridge
The Apache Kafka Client SDK
Stars: ✭ 272 (+32.04%)
Mutual labels:  consumer, kafka-consumer
Snmpcollector
A full featured Generic SNMP data collector with Web Administration Interface for InfluxDB
Stars: ✭ 216 (+4.85%)
Mutual labels:  influxdb, performance
Appmetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
Stars: ✭ 1,986 (+864.08%)
Mutual labels:  influxdb, performance
Icinga2
Icinga is a monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting.
Stars: ✭ 1,670 (+710.68%)
Mutual labels:  influxdb, performance
Librdkafka
The Apache Kafka C/C++ library
Stars: ✭ 5,617 (+2626.7%)
Mutual labels:  consumer, kafka-consumer
Insulator
A client UI to inspect Kafka topics, consume, produce and much more
Stars: ✭ 53 (-74.27%)
Mutual labels:  consumer, kafka-consumer
Trickster
Open Source HTTP Reverse Proxy Cache and Time Series Dashboard Accelerator
Stars: ✭ 1,306 (+533.98%)
Mutual labels:  influxdb, performance
Quicklogger
Library for logging on files, console, memory, email, rest, eventlog, syslog, slack, telegram, redis, logstash, elasticsearch, influxdb, graylog, Sentry, Twilio, ide debug messages and throw events for Delphi/Firemonkey/freepascal/.NET (Windows/Linux/OSX/IOS/Android).
Stars: ✭ 137 (-33.5%)
Mutual labels:  logstash, influxdb
Parallel Consumer
Parallel Apache Kafka client wrapper with client side queueing, a simpler consumer/producer API with key concurrency and extendable non-blocking IO processing.
Stars: ✭ 154 (-25.24%)
Mutual labels:  kafka-consumer, performance
Awesome Casestudy
📕 Curated list of technical case studies on WebGL and creative development
Stars: ✭ 2,324 (+1028.16%)
Mutual labels:  performance
Autowebperf
AutoWebPerf provides a flexible and scalable framework for running web performance audits with arbitrary audit tools including PageSpeedInsights, WebPageTest and more.
Stars: ✭ 199 (-3.4%)
Mutual labels:  performance
Perfume.js
Web performance library for measuring all User-centric performance metrics
Stars: ✭ 2,533 (+1129.61%)
Mutual labels:  performance
Meter
Laravel package to find performance bottlenecks in your laravel application.
Stars: ✭ 204 (-0.97%)
Mutual labels:  performance
Bundle Buddy Webpack Plugin
🐐🐐🐐🐐 bundle-buddy-webpack-plugin 🐐🐐🐐🐐
Stars: ✭ 199 (-3.4%)
Mutual labels:  performance
Http2 Prioritization Issues
Tracks issues / notes for HTTP/2 prioritization across browsers, CDNs and servers
Stars: ✭ 204 (-0.97%)
Mutual labels:  performance
Aws Lambda Power Tuning
AWS Lambda Power Tuning is an open-source tool that can help you visualize and fine-tune the memory/power configuration of Lambda functions. It runs in your own AWS account - powered by AWS Step Functions - and it supports three optimization strategies: cost, speed, and balanced.
Stars: ✭ 3,040 (+1375.73%)
Mutual labels:  performance
Pi Hole Monitoring
Monitoring Pi-Hole statistics with Grafana
Stars: ✭ 196 (-4.85%)
Mutual labels:  influxdb
Scaffeine
Thin Scala wrapper for Caffeine (https://github.com/ben-manes/caffeine)
Stars: ✭ 195 (-5.34%)
Mutual labels:  performance
Docker Elastic
Deploy Elastic stack in a Docker Swarm cluster. Ship application logs and metrics using beats & GELF plugin to Elasticsearch
Stars: ✭ 202 (-1.94%)
Mutual labels:  logstash

Kafka-InfluxDB

Build Status Coverage Status Code Climate PyPi Version Scrutinizer

A Kafka consumer for InfluxDB written in Python.
Supports InfluxDB 0.9.x and up. For InfluxDB 0.8.x support, check out the 0.3.0 tag.

⚠️ The project should work as expected and bug fixes are very welcome, but activity on new functionality is quite low. For newer projects I recommend vector instead, which is both faster and more versatile.

Use cases

Kafka will serve as a buffer for your metric data during high load.
Also it's useful for sending metrics from offshore data centers with unreliable connections to your monitoring backend.

Quickstart

For a quick test, run kafka-influxdb inside a container alongside Kafka and InfluxDB. Some sample messages are generated automatically on startup (using kafkacat).

Python 2:

make
docker exec -it kafkainfluxdb
python -m kafka_influxdb -c config_example.yaml -s

Python 3:

make RUNTIME=py3
docker exec -it kafkainfluxdb
python -m kafka_influxdb -c config_example.yaml -s

PyPy 5.x

make RUNTIME=pypy
docker exec -it kafkainfluxdb
pypy3 -m kafka_influxdb -c config_example.yaml -s --kafka_reader=kafka_influxdb.reader.kafka_python

(Note that one additional flag is given: --kafka_reader=kafka_influxdb.reader.kafka_python. This is because PyPy is incompatible with the confluent kafka consumer which is a C-extension to librdkafka. Therefore we use the kafka_python library here, which is compatible with PyPy but a bit slower.)

Docker:

docker run mre0/kafka-influxdb

or simply

make run

Installation

pip install kafka_influxdb
kafka_influxdb -c config_example.yaml

Contributing

If you like to contribute, please create a pull request with your change.
Please run the tests before you submit the pull request make test.
If you're unsure, whether a change will be accepted, you can also create an issue first, to discuss.
Or look at the already existing issues for inspiration.

Thanks for contributing!

Performance

The following graph shows the number of messages/s read from Kafka for various Python versions and Kafka consumer plugins.
This is testing against a Kafka topic with 10 partitions and five message brokers. As you can see the best performance is achieved on Python 3 using the -O flag for bytecode optimization in combination with the confluent-kafka reader (default setup). Note that encoding and sending the data to InfluxDB might lower this maximum performance although you should still see a significant performance boost compared to logstash.

Benchmark results

Benchmark

For a quick benchmark, you can start a complete kafkacat -> Kafka -> kafka_influxdb -> Influxdb setup with the following command:

make

This will immediately start reading messages from Kafka and write them into InfluxDB. To see the output, you can use the InfluxDB cli.

docker exec -it docker_influxdb_1 bash # Double check your container name
influx
use metrics
show measurements

Supported formats

You can write a custom encoder to support any input and output format (even fancy things like Protobuf). Look at the examples inside the encoder directory to get started. The following formats are officially supported:

Input formats

mydatacenter.myhost.load.load.shortterm 0.45 1436357630
[{
    "values":[
       0.6
    ],
    "dstypes":[
       "gauge"
    ],
    "dsnames":[
       "value"
    ],
    "time":1444745144.824,
    "interval":10.000,
    "host":"xx.example.internal",
    "plugin":"cpu",
    "plugin_instance":"1",
    "type":"percent",
    "type_instance":"system"
 }]

Output formats

load_load_shortterm,datacenter=mydatacenter,host=myhost value="0.45" 1436357630

Custom encoders

If you are writing your custom encoder and you want to run it using the official docker image, you can simply mount it in the container:

docker run -v `pwd`/config.yaml:/usr/src/app/config.yaml -v `pwd`/myencoder.py:/usr/src/app/myencoder.py mre0/kafka-influxdb --encoder=myencoder

Another possibility is to create a custom Docker image that contains your encoder, for example:

FROM mre0/kafka-influxdb

ADD myencoder.py /usr/src/app/myencoder.py
ADD config.yaml /usr/src/app/

CMD python -m kafka_influxdb -c config.yaml -v --encoder=myencoder

Configuration

Take a look at the config-example.yaml to find out how to create a config file. You can overwrite the settings from the commandline. The following parameters are allowed:

Option Description
-h, --help Show help message and exit
--kafka_host KAFKA_HOST Hostname or IP of Kafka message broker (default: localhost)
--kafka_port KAFKA_PORT Port of Kafka message broker (default: 9092)
--kafka_topic KAFKA_TOPIC Topic for metrics (default: my_topic)
--kafka_group KAFKA_GROUP Kafka consumer group (default: my_group)
--kafka_reader KAFKA_READER Kafka client library to use (kafka_python or confluent) (default: kafka_influxdb.reader.confluent)
--influxdb_host INFLUXDB_HOST InfluxDB hostname or IP (default: localhost)
--influxdb_port INFLUXDB_PORT InfluxDB API port (default: 8086)
--influxdb_user INFLUXDB_USER InfluxDB username (default: root)
--influxdb_password INFLUXDB_PASSWORD InfluxDB password (default: root)
--influxdb_dbname INFLUXDB_DBNAME InfluxDB database to write metrics into (default: metrics)
--influxdb_use_ssl Use SSL connection for InfluxDB (default: False)
--influxdb_verify_ssl Verify the SSL certificate before connecting (default: False)
--influxdb_timeout INFLUXDB_TIMEOUT Max number of seconds to establish a connection to InfluxDB (default: 5)
--influxdb_use_udp Use UDP connection for InfluxDB (default: False)
--influxdb_retention_policy INFLUXDB_RETENTION_POLICY Retention policy for incoming metrics (default: autogen)
--influxdb_time_precision INFLUXDB_TIME_PRECISION Precision of incoming metrics. Can be one of 's', 'm', 'ms', 'u' (default: s)
--encoder ENCODER Input encoder which converts an incoming message to dictionary (default: collectd_graphite_encoder)
--buffer_size BUFFER_SIZE Maximum number of messages that will be collected before flushing to the backend (default: 1000)
-c CONFIGFILE, --configfile CONFIGFILE Configfile path (default: None)
-s, --statistics Show performance statistics (default: True)
-v, --verbose Set verbosity level. Increase verbosity by adding a v: -v -vv -vvv (default: 0)
--version Show version

Comparison with other tools

There is a Kafka input plugin and an InfluxDB output plugin for logstash. It supports Influxdb 0.9+. We've achieved a message throughput of around 5000 messages/second with that setup. Check out the configuration at docker/logstash/config.conf. You can run the benchmark yourself:

make RUNTIME=logstash
docker exec -it logstash
logstash -f config.conf

Please send a Pull Request if you know of other tools that can be mentioned here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].