2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

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 ARG REPO_ARCH
FROM asonix/rust-runner:$REPO_ARCH-latest FROM asonix/rust-runner:latest-linux-$REPO_ARCH
USER root USER root
RUN \ RUN \
@ -11,6 +11,7 @@ COPY pict-rs /usr/local/bin/pict-rs
COPY docker/prod/root/ / COPY docker/prod/root/ /
USER app USER app
EXPOSE 6669
EXPOSE 8080 EXPOSE 8080
VOLUME /mnt VOLUME /mnt
ENTRYPOINT ["/sbin/tini", "--"] ENTRYPOINT ["/sbin/tini", "--"]

View file

@ -1,3 +1,4 @@
use console_subscriber::ConsoleLayer;
use opentelemetry::{ use opentelemetry::{
sdk::{propagation::TraceContextPropagator, Resource}, sdk::{propagation::TraceContextPropagator, Resource},
KeyValue, KeyValue,
@ -27,9 +28,15 @@ pub(super) fn init_tracing(
.with_span_events(FmtSpan::NEW | FmtSpan::CLOSE) .with_span_events(FmtSpan::NEW | FmtSpan::CLOSE)
.with_filter(targets.clone()); .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() let subscriber = Registry::default()
.with(format_layer) .with(format_layer)
.with(console_subscriber::spawn()) .with(console_layer)
.with(ErrorLayer::default()); .with(ErrorLayer::default());
if let Some(url) = opentelemetry_url { if let Some(url) = opentelemetry_url {