Update rust-runner image, improve tokio-console support

This commit is contained in:
Aode (lion) 2021-12-19 12:59:51 -06:00
parent c48808c1e1
commit f79d38df8d
2 changed files with 10 additions and 2 deletions

View file

@ -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", "--"]

View file

@ -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 {