diff --git a/docker-compose.yml b/docker-compose.yml index 2d2574d..5e11209 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: # Show print() in logs: PYTHONUNBUFFERED: '1' LOG_LEVEL: 'INFO' - NO_JAEGER: true + NO_JAEGER: "true" entrypoint: uvicorn trapi.main:app --host 0.0.0.0 --port 8808 --debug --reload @@ -25,7 +25,7 @@ services: environment: PYTHONUNBUFFERED: '1' LOG_LEVEL: 'INFO' - NO_JAEGER: true + NO_JAEGER: "true" entrypoint: pytest --cov=src tests/integration # entrypoint: pytest tests/integration/test_train_model.py -s # entrypoint: pytest tests/integration/test_openpredict_api.py::test_post_trapi -s diff --git a/src/trapi/main.py b/src/trapi/main.py index dda9368..810c059 100644 --- a/src/trapi/main.py +++ b/src/trapi/main.py @@ -127,12 +127,12 @@ def configure_otel(app): from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor + service_name = os.environ.get('OTEL_SERVICE_NAME', 'OPENPREDICT') # httpx connections need to be open a little longer by the otel decorators # but some libs display warnings of resource being unclosed. # these supresses such warnings. logging.captureWarnings(capture=True) warnings.filterwarnings("ignore",category=ResourceWarning) - service_name = os.environ.get('OTEL_SERVICE_NAME', 'OPENPREDICT') trace.set_tracer_provider( TracerProvider( resource=Resource.create({telemetery_service_name_key: service_name})