From f79d38df8db4e699c2ede48ae2c6a3bf1aad0c4d Mon Sep 17 00:00:00 2001 From: "Aode (lion)" Date: Sun, 19 Dec 2021 12:59:51 -0600 Subject: [PATCH] Update rust-runner image, improve tokio-console support --- docker/drone/Dockerfile | 3 ++- src/init_tracing.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docker/drone/Dockerfile b/docker/drone/Dockerfile index 027d80d..ad52dd7 100644 --- a/docker/drone/Dockerfile +++ b/docker/drone/Dockerfile @@ -1,6 +1,6 @@ ARG REPO_ARCH -FROM asonix/rust-runner:$REPO_ARCH-latest +FROM asonix/rust-runner:latest-linux-$REPO_ARCH USER root RUN \ @@ -11,6 +11,7 @@ COPY pict-rs /usr/local/bin/pict-rs COPY docker/prod/root/ / USER app +EXPOSE 6669 EXPOSE 8080 VOLUME /mnt ENTRYPOINT ["/sbin/tini", "--"] diff --git a/src/init_tracing.rs b/src/init_tracing.rs index 6f3b0d4..f238d34 100644 --- a/src/init_tracing.rs +++ b/src/init_tracing.rs @@ -1,3 +1,4 @@ +use console_subscriber::ConsoleLayer; use opentelemetry::{ sdk::{propagation::TraceContextPropagator, Resource}, KeyValue, @@ -27,9 +28,15 @@ pub(super) fn init_tracing( .with_span_events(FmtSpan::NEW | FmtSpan::CLOSE) .with_filter(targets.clone()); + let console_layer = ConsoleLayer::builder() + .with_default_env() + .event_buffer_capacity(1024 * 1024) + .server_addr(([0, 0, 0, 0], 6669)) + .spawn(); + let subscriber = Registry::default() .with(format_layer) - .with(console_subscriber::spawn()) + .with(console_layer) .with(ErrorLayer::default()); if let Some(url) = opentelemetry_url {