Skip to content

Commit

Permalink
add jaeger to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Dec 22, 2023
1 parent 14f5f69 commit 55b9295
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
19 changes: 11 additions & 8 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
9 changes: 5 additions & 4 deletions src/trapi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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.
Expand All @@ -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()

0 comments on commit 55b9295

Please sign in to comment.