#jaeger #jaegertracing

bin+lib jaegercat

A handy command line tool showing traces emitted by Jaeger clients

2 releases

Uses old Rust 2015

0.1.1 Jan 31, 2018
0.1.0 Jan 31, 2018

#1585 in Development tools

Download history 3/week @ 2023-11-13 3/week @ 2023-11-20 8/week @ 2023-11-27 2/week @ 2023-12-11 4/week @ 2023-12-25 3/week @ 2024-01-15 1/week @ 2024-01-22 4/week @ 2024-01-29 1/week @ 2024-02-05 12/week @ 2024-02-12 62/week @ 2024-02-19

79 downloads per month

MIT license

23KB
516 lines

jaegercat

jaegercat Documentation License: MIT

A handy command line tool showing traces emitted by Jaeger clients.

Install

Precompiled binaries

A precompiled binary for Linux environment is available in the releases page.

$ curl -L https://github.com/sile/jaegercat/releases/download/0.1.1/jaegercat-0.1.1.linux -o jaegercat
$ chmod +x jaegercat
$ ./jaegercat -h
jaegercat 0.1.1

USAGE:
    jaegercat [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --binary-thrift-port <BINARY_THRIFT_PORT>       [default: 6832]
        --compact-thrift-port <COMPACT_THRIFT_PORT>     [default: 6831]
    -f, --format <FORMAT>                               [default: json]  [values: raw, json, json-pretty]
        --log-level <LOG_LEVEL>                         [default: info]  [values: debug, info, error]
    -b, --udp-buffer-size <UDP_BUFFER_SIZE>             [default: 65000]

Using Cargo

If you have already installed Cargo, you can install jaegercat easily in the following command:

$ cargo install jaegercat

Examples

Basic Usage

Starts jaegercat in a terminal:

$ jaegercat
Jan 31 14:18:06.989 INFO UDP server started, port: 6831
Jan 31 14:18:06.990 INFO UDP server started, port: 6832

Emits a trace in another terminal:

$ git clone https://github.com/sile/rustracing_jaeger.git
$ cd rustracing_jaeger
$ cargo run --example report

jaegercat will output a JSON like the following:

$ jaegercat
{"emit_batch":{"process":{"service_name":"example","tags":{"hello":"world","hostname":"DESKTOP-FJQCKIF","jaeger.version":"rustracing_jaeger-0.1.3"}},"spans":[{"trace_id":"0x154050ce43d48b612ae64ad7cd070e8e","span_id":"0x4c123d1fd41219d5","parent_span_id":"0x87a5fd207c065420","operation_name":"sub","references":[{"ChildOf":{"trace_id":"0x154050ce43d48b612ae64ad7cd070e8e","span_id":"0x87a5fd207c065420"}}],"flags":1,"start_datetime":"2018-01-31 14:24:18","start_unixtime":1517376258.665418,"duration":0.010196,"tags":{"foo":"bar"},"logs":[{"datetime":"2018-01-31 14:24:18","unixtime":1517376258.665475,"fields":{"event":"error","message":"something wrong"}}]},{"trace_id":"0x154050ce43d48b612ae64ad7cd070e8e","span_id":"0x87a5fd207c065420","operation_name":"main","flags":1,"start_datetime":"2018-01-31 14:24:18","start_unixtime":1517376258.654844,"duration":0.020779}]}}

Using jq command

It is convenient to use jq command for processing the resulting JSON.

// Filter only spans whose operation name is "main".
$ jaegercat | jq '.emit_batch.spans[] | select(.operation_name == "main")'
{
  "trace_id": "0x3dfcffdfe5b53b1d1fb792d1fbea9f8b",
  "span_id": "0xeba0e30f2f2d6e51",
  "operation_name": "main",
  "flags": 1,
  "start_datetime": "2018-01-31 14:36:01",
  "start_unixtime": 1517376961.354905,
  "duration": 0.020933
}

References

Jaeger Data Model(IDL):

Dependencies

~7–18MB
~214K SLoC