influxdb/trace_exporters
Marco Neumann 0221820123
feat: rate-limit Jaeger UDP messages (#6354)
* feat: rate-limit Jaeger UDP messages

The Jaeger UDP protocol provides no way to signal backpressure /
overload. In certain situations, we are emitting that many tracing spans
in a short period of time that the OS, the network, or Jaeger drop them.
While a rate limit is not a perfect solution, it for sure helps a lot
(tested locally).

Note that the limiter does NOT lead to unlimited buffering because we
already have a limited outbox queue in place (see
`trace_exporters::export::CHANNEL_SIZE`).

Fixes #5446.

* fix: only warn ones when the tracing channel is full

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-09 09:46:07 +00:00
..
src feat: rate-limit Jaeger UDP messages (#6354) 2022-12-09 09:46:07 +00:00
Cargo.toml feat: rate-limit Jaeger UDP messages (#6354) 2022-12-09 09:46:07 +00:00
README.md feat: implement jaeger-agent protocol directly (#2607) 2021-09-22 17:30:37 +00:00

README.md

Trace Exporters

Regenerating Jaeger Thrift

The instructions below use docker, but this is optional.

Depending on your setup there may be permissions complications that require using-u

Startup a Debian bullseye image

docker run -it -v $PWD:/out debian:bullseye-slim

Install the thrift-compiler

$ apt-get update
$ apt-get install thrift-compiler wget

Verify the version of the compiler matches the version of thrift in Cargo.toml

$ thrift --version
Thrift version 0.13.0

Get the IDL definition

$ wget https://raw.githubusercontent.com/jaegertracing/jaeger-idl/master/thrift/jaeger.thrift https://raw.githubusercontent.com/jaegertracing/jaeger-idl/master/thrift/zipkincore.thrift https://raw.githubusercontent.com/jaegertracing/jaeger-idl/master/thrift/agent.thrift

Generate the code

$ thrift --out /out/src/thrift --gen rs agent.thrift
$ thrift --out /out/src/thrift --gen rs jaeger.thrift
$ thrift --out /out/src/thrift --gen rs zipkincore.thrift

Patch up imports

sed -i 's/use jaeger;/use super::jaeger;/g' /out/src/thrift/agent.rs 
sed -i 's/use zipkincore;/use super::zipkincore;/g' /out/src/thrift/agent.rs

Remove the clippy line

#![cfg_attr(feature = "cargo-clippy", allow(too_many_arguments, type_complexity))]