jaegerplugin

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2020 License: MIT Imports: 1 Imported by: 0

README

jaegerplugin

jaeger 插件通过grpc接口查询和上报数据

根据proto生成go代码

下载 idl 代码

git clone https://github.com/jaegertracing/jaeger-idl.git
cd jaeger-idl

并创建目标路径

mkdir go_out

修改 proto 文件

jaeger-idl 中的代码没有根目录信息,需要添加上

jaeger-idl/proto/api_v2/model.proto 中将

option go_package = "model";

修改为:

option go_package = "github.com/aimuke/jaegerplugin/proto/model";

同理分别修改 jaeger-idl/proto/api_v2/query.protojaeger-idl/proto/api_v2/collector.proto

option go_package = "api_v2";

修改为

option go_package = "github.com/aimuke/jaegerplugin/proto/api_v2";

生成代码

model.pb.go

docker run --rm -it -v${PWD}:${PWD} -w${PWD} \
    jaegertracing/protobuf:latest --proto_path=${PWD} \
    -I/usr/include/github.com/gogo/protobuf \
    --go_out=${PWD}/go_out \
    proto/api_v2/model.proto

query.pb.go

docker run --rm -it -v${PWD}:${PWD} -w${PWD} \
    jaegertracing/protobuf:latest --proto_path=${PWD} \
    -I/usr/include/github.com/gogo/protobuf \
    -I${PWD}/proto/api_v2\
    --go_out=plugins=grpc:${PWD}/go_out \
    proto/api_v2/query.proto

collector.pb.go

docker run --rm -it -v${PWD}:${PWD} -w${PWD} \
    jaegertracing/protobuf:latest --proto_path=${PWD} \
    -I/usr/include/github.com/gogo/protobuf \
    -I${PWD}/proto/api_v2\
    --go_out=plugins=grpc:${PWD}/go_out \
    proto/api_v2/collector.proto

然后将生成的代码分别放到对应的位置

编译

build.bat

将生成 linux 下的 jaeger-plugin 可执行文件

运行

运行 jaeger-plugin 功能如下:

jager-plugin is a plugin to access jaeger data through grpc

Usage:
  jager-plugin [command]

Available Commands:
  archiveTrace  get operations from jaeger collector
  download      download tracing data from jaeger collector
  findTraces    get operations from jaeger collector
  getOperations get operations from jaeger collector
  getServices   report tracing data to jaeger collector
  getTrace      get operations from jaeger collector
  help          Help about any command
  report        report tracing data to jaeger collector

Flags:
      --addr string   jaeger address (default "10.40.66.130:16686")
  -h, --help          help for jager-plugin

Use "jager-plugin [command] --help" for more information about a command.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
grpc
pkg
log
proto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL