Skip to content

Commit

Permalink
Jaeger now accepts OTLP protocol, remove jaeger exporter stuff. (#3792)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmassot authored Sep 4, 2023
1 parent ab77072 commit ac3b93a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 100 deletions.
16 changes: 3 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,12 @@ You will be notified by email from the CI system if any issues are discovered, b
1. Ensure Docker and Docker Compose are correctly installed on your machine (see above)
2. Start the Jaeger services (UI, collector, agent, ...) running the command `make docker-compose-up DOCKER_SERVICES=jaeger`
3. Start Quickwit with the following environment variables:

```
QW_ENABLE_JAEGER_EXPORTER=true
OTEL_BSP_MAX_EXPORT_BATCH_SIZE=8
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER=true
```

If you are on MacOS, the default UDP packet size is 9216 bytes which is too low compared to the jaeger exporter max size set by default at 65000 bytes. As a workaround, you can increase the limit at your own risk: `sudo sysctl -w net.inet.udp.maxdgram=65535`.

The `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` is the key parameter, it sets the maximum number of spans sent to Jaeger in one batch. Quickwit tends to produce spans of relatively big size and if the batch size is greater than the maximum UDP packet size, the sending of the batch to Jaeger will fail and the following error will appear in the logs:

```
OpenTelemetry trace error occurred. Exporter jaeger encountered the following error(s): thrift agent failed with transport error
```

Ref: https://github.com/open-telemetry/opentelemetry-rust/issues/851


4. Open your browser and visit [localhost:16686](http://localhost:16686/)

## Using tokio console
Expand Down
17 changes: 8 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,22 +164,18 @@ services:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning

jaeger:
image: jaegertracing/all-in-one:${JAEGER_VERSION:-1.20.0}
image: jaegertracing/all-in-one:${JAEGER_VERSION:-1.48.0}
container_name: jaeger
ports:
- "${MAP_HOST_JAEGER:-127.0.0.1}:5775:5775/udp"
- "${MAP_HOST_JAEGER:-127.0.0.1}:5778:5778"
- "${MAP_HOST_JAEGER:-127.0.0.1}:6831:6831/udp"
- "${MAP_HOST_JAEGER:-127.0.0.1}:6832:6832/udp"
- "${MAP_HOST_JAEGER:-127.0.0.1}:14250:14250"
- "${MAP_HOST_JAEGER:-127.0.0.1}:14268:14268"
- "${MAP_HOST_JAEGER:-127.0.0.1}:16686:16686"
- "${MAP_HOST_JAEGER:-127.0.0.1}:4317:4317" # OTLP over gRPC
- "${MAP_HOST_JAEGER:-127.0.0.1}:4318:4318" # OTLP over HTTP
- "${MAP_HOST_JAEGER:-127.0.0.1}:16686:16686" # Frontend
profiles:
- jaeger
- monitoring

otel-collector:
image: otel/opentelemetry-collector:${OTEL_VERSION:-0.75.0}
image: otel/opentelemetry-collector:${OTEL_VERSION:-0.84.0}
container_name: otel-collector
ports:
- "${MAP_HOST_OTEL:-127.0.0.1}:1888:1888" # pprof extension
Expand Down Expand Up @@ -210,6 +206,9 @@ services:
- "host.docker.internal:host-gateway"

gcp-pubsub-emulator:
profiles:
- gcp-pubsub
- all
# It is not an official docker image
# if we prefer we can build a docker from the official docker image (gcloud cli)
# and install the pubsub emulator https://cloud.google.com/pubsub/docs/emulator
Expand Down
55 changes: 0 additions & 55 deletions quickwit/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion quickwit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ oneshot = "0.1.5"
openssl = { version = "0.10.55", default-features = false }
openssl-probe = "0.1.5"
opentelemetry = { version = "0.19", features = ["rt-tokio"] }
opentelemetry-jaeger = { version = "0.18", features = ["rt-tokio"] }
opentelemetry-otlp = "0.12.0"
pin-project = "1.1.0"
pnet = { version = "0.33.0", features = ["std"] }
Expand Down
1 change: 0 additions & 1 deletion quickwit/quickwit-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ itertools = { workspace = true }
once_cell = { workspace = true }
openssl-probe = { workspace = true, optional = true }
opentelemetry = { workspace = true }
opentelemetry-jaeger = { workspace = true }
opentelemetry-otlp = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true }
Expand Down
2 changes: 0 additions & 2 deletions quickwit/quickwit-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ pub mod tool;
/// Throughput calculation window size.
const THROUGHPUT_WINDOW_SIZE: usize = 5;

pub const QW_ENABLE_JAEGER_EXPORTER_ENV_KEY: &str = "QW_ENABLE_JAEGER_EXPORTER";

pub const QW_ENABLE_TOKIO_CONSOLE_ENV_KEY: &str = "QW_ENABLE_TOKIO_CONSOLE";

pub const QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER_ENV_KEY: &str =
Expand Down
21 changes: 2 additions & 19 deletions quickwit/quickwit-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ use quickwit_cli::checklist::RED_COLOR;
use quickwit_cli::cli::{build_cli, CliCommand};
#[cfg(feature = "jemalloc")]
use quickwit_cli::jemalloc::start_jemalloc_metrics_loop;
use quickwit_cli::{
busy_detector, QW_ENABLE_JAEGER_EXPORTER_ENV_KEY, QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER_ENV_KEY,
};
use quickwit_cli::{busy_detector, QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER_ENV_KEY};
use quickwit_serve::BuildInfo;
use tracing::Level;
use tracing_subscriber::fmt::time::UtcTime;
Expand Down Expand Up @@ -70,22 +68,7 @@ fn setup_logging_and_tracing(
);
// Note on disabling ANSI characters: setting the ansi boolean on event format is insufficient.
// It is thus set on layers, see https://github.com/tokio-rs/tracing/issues/1817
if std::env::var_os(QW_ENABLE_JAEGER_EXPORTER_ENV_KEY).is_some() {
let tracer = opentelemetry_jaeger::new_agent_pipeline()
.with_service_name("quickwit")
.with_auto_split_batch(true)
.install_batch(opentelemetry::runtime::Tokio)
.context("Failed to initialize Jaeger exporter.")?;
registry
.with(tracing_opentelemetry::layer().with_tracer(tracer))
.with(
tracing_subscriber::fmt::layer()
.event_format(event_format)
.with_ansi(ansi),
)
.try_init()
.context("Failed to set up tracing.")?;
} else if std::env::var_os(QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER_ENV_KEY).is_some() {
if std::env::var_os(QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER_ENV_KEY).is_some() {
let otlp_exporter = opentelemetry_otlp::new_exporter().tonic().with_env();
let trace_config = trace::config().with_resource(Resource::new([
KeyValue::new("service.name", "quickwit"),
Expand Down

0 comments on commit ac3b93a

Please sign in to comment.