From fab2ccfb830f1b5cbb7e6350f615cf329fbe297a Mon Sep 17 00:00:00 2001 From: Vincent Emonet Date: Wed, 20 Dec 2023 11:33:00 +0100 Subject: [PATCH] try to fix AttributeError: 'str' object has no attribute 'get_tracer' --- Dockerfile | 5 ++++- src/trapi/main.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6ebadc0..da11120 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN echo 'deb http://ftp.fr.debian.org/debian bullseye main' >> /etc/apt/sources pip install --upgrade pip -# Install Spark for standalone context in /opt +# TODO: remove? Install Spark for standalone context in /opt ENV APACHE_SPARK_VERSION=3.2.0 ENV HADOOP_VERSION=3.2 ENV SPARK_HOME=/opt/spark @@ -31,6 +31,9 @@ RUN echo "log4j.rootCategory=ERROR, console" > $SPARK_HOME/conf/log4j.properties # Define some environment variables for pyspark and gunicorn config ENV PYSPARK_PYTHON=/usr/local/bin/python3 ENV PYSPARK_DRIVER_PYTHON=/usr/local/bin/python3 + + + ENV PORT=8808 ENV GUNICORN_CMD_ARGS="--preload" diff --git a/src/trapi/main.py b/src/trapi/main.py index 810c059..7b1b7d5 100644 --- a/src/trapi/main.py +++ b/src/trapi/main.py @@ -147,7 +147,7 @@ def configure_otel(app): trace.get_tracer_provider().add_span_processor( BatchSpanProcessor(jaeger_exporter) ) - # tracer = trace.get_tracer(__name__) + tracer = trace.get_tracer(__name__) FastAPIInstrumentor.instrument_app(app, tracer_provider=trace, excluded_urls="docs,openapi.json") HTTPXClientInstrumentor().instrument()