Giter VIP home page Giter VIP logo

trubka's Introduction

GitHub release Build Status Go Report Card Mentioned in Awesome Go

logo-small

Trubka is a Kafka CLI tool built in Go which gives you everything you need to

  • Manage, query and troubleshoot your Kafka clusters.
  • Consume protocol buffer and plain text messages from Kafka.
  • Publish protocol buffer and plain text messages to Kafka.

Documentation

Acknowledgments

Special thanks to Joshua Humphries for building the fascinating protoreflect package.

I would also like to mention some of the amazing libraries and packages I used for building Trubka:

trubka's People

Contributors

xitonix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trubka's Issues

List topic lag?

Thanks for making this one, really neat!

Is there a way to get the lag per topic?

Thanks!

[BUG]: Using TRUBKA_PROTO_ROOT does not work

Describe the bug
Setting TRUBKA_PROTO_ROOT environment variable still gives an error about requiring the --proto-root flag.

To Reproduce

$ echo $TRUBKA_PROTO_ROOT
/Users/jeff/dev/platypus

$ trubka consume proto --topic-filter wifi --proto-filter Blip --brokers localhost:9092 --kafka-version 2.2.0 -i
ERROR: Required flag --proto-root not provided

Expected behavior
If I provide this environment variable I shouldn't have to provide --proto-root. According to the wiki:

It is possible to ask Trubka to read the cli flags from the system's environment variables. The flags must be in TRUBKA_FLAG_NAME format. For example the value of --proto-root parameter can be read from TRUBKA_PROTO_ROOT if it's provided.

[Feature]: Ability to format consumed proto bytes as a hex string

Is your feature request related to a problem? Please describe.
When using trubka consume proto if you have a protobuf with a field of type bytes, the field will be formatted as base64, but I would like to look at them in hex string format. There is an option to format your entire message as hex using -F hex but not just bytes fields.

Describe the solution you'd like
An option to output in -F json-indent format, but with individual fields of type bytes as hex strings.
For example adding a flag --bytes-format [base64|hex].
You could take this concept even further and have custom formatting for any type with some kind of configuration file. For example you may want timestamps in a different format as well.

[Feature]: Add a --to parameter to consumer

Is your feature request related to a problem? Please describe.
It would be nice to have a --to parameter in the consumer.
One benefit is that you can pipe your consumed messages to a file and the consumer will finish once the --to condition is reached.
Another benefit is that if you're searching through messages, it allows you to narrow your search.

Describe the solution you'd like
The ability to stop consuming by timestamp, by latest offset at the time of starting the consumer, and/or by specific offsets by partition.

For example you could consume messages between 3pm and 4pm like:

$ trubka consume plain <topic name> --brokers <broker:port> --from 22-02-2020T15:00:00 --to 22-02-2020T16:00:00

Or you could consume messages from 3pm until now like:

$ trubka consume plain <topic name> --brokers <broker:port> --from 22-02-2020T15:0:00 --to newest

[Feature]: add JSON output format

Consider adding JSON output format. For better or worse it's now the standard data interchange, and with tools like jq is easily manipulated, filtered, etc. This would be especially useful for creating input to tools like kafka-reassign-partitions.sh. For reference here's what that looks like, first for input to --topics-to-move-json-file:

{
  "topics": [
    {
      "topic": "topic1" 
    },
    {
      "topic": "topic2" 
    },
    {
      "topic": "topic3" 
    }
  ],
  "version": 1
}

Then for input to --reassignment-json-file:

{
  "version": 1,
  "partitions": [
    {
      "topic": "topic1",
      "partition": 0,
      "replicas": [1, 2],
      "log_dirs": ["any","any"]
    },
    {
      "topic": "topic2",
      "partition": 0,
      "replicas": [2, 3],
      "log_dirs": ["any","any"]
    },
    {
      "topic": "topic3",
      "partition": 0,
      "replicas": [1, 3],
      "log_dirs": ["any","any"]
    }
  ]
}

[Feature]: Make "plain" list output plainer

Plain text output is often very useful, and allows for output to be piped to standard unix tools for manipulation. However, the current "plain" output format has some decoration that impedes this, e.g.

$ trubka list topics -f plain
Topics (96)
───────────
 ● __consumer_offsets
 ● topic1
 ● topic2
 ● topic3
[...]

 Total
─────
    Topics: 96
Partitions: 180

Please change plain, or add a different output format, that is just a simple plain-text list, with no decoration, headers, or footers, e.g.

$ trubka list topics -f plain
topic1
topic2
topic3

[Feature]:

Hi, nice work. It would be great if it would be able to read and write avro format as well.

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.