diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 714f9af..171f715 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -21,11 +21,14 @@ services: # OPENPREDICT_APIKEY: ${OPENPREDICT_APIKEY} - # jaeger-otel-agent.sri: - # image: jaegertracing/all-in-one:latest - # # ports: - # # - "16686:16686" - # # - "4318:4318" - # # - "6831:6831/udp" - # environment: - # - LOG_LEVEL=debug \ No newline at end of file + jaeger-otel-agent.sri: + image: jaegertracing/all-in-one:latest + # ports: + # - "16686:16686" + # - "4318:4318" + # - "6831:6831/udp" + environment: + LOG_LEVEL: debug + VIRTUAL_HOST: jaeger.137.120.31.102.nip.io + LETSENCRYPT_HOST: jaeger.137.120.31.102.nip.io + VIRTUAL_PORT: 16686 \ No newline at end of file diff --git a/src/trapi/main.py b/src/trapi/main.py index 3e321ae..899dedd 100644 --- a/src/trapi/main.py +++ b/src/trapi/main.py @@ -59,13 +59,14 @@ } } +itrb_url_prefix = "openpredict" app = TRAPI( predict_endpoints=[ get_predictions, get_similarities, ], info=openapi_info, - itrb_url_prefix="openpredict", + itrb_url_prefix=itrb_url_prefix, dev_server_url="https://openpredict.semanticscience.org", title='OpenPredict API', version='1.0.0', @@ -126,9 +127,9 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.instrumentation.requests import RequestsInstrumentor - # from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor + from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor - service_name = os.environ.get('OTEL_SERVICE_NAME', 'OPENPREDICT') + service_name = os.environ.get('OTEL_SERVICE_NAME', itrb_url_prefix) # 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. @@ -151,4 +152,4 @@ tracer = trace.get_tracer(__name__) FastAPIInstrumentor.instrument_app(app, tracer_provider=trace, excluded_urls="docs,openapi.json") RequestsInstrumentor().instrument() - # HTTPXClientInstrumentor().instrument() + HTTPXClientInstrumentor().instrument()