Skip to content

Commit

Permalink
Dockerization of telemetry (imperfect but working locally running des…
Browse files Browse the repository at this point in the history
…ign)
  • Loading branch information
RichardBruskiewich committed Sep 19, 2023
1 parent c2891ea commit ef5b814
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ To minimize redundancy in validation messages, messages are uniquely indexed in

The web service may be monitored for OpenTelemetry by setting an environment variable **TELEMETRY_ENDPOINT** to a suitable trace collecting endpoint in an application like [Jaeger](https://www.jaegertracing.io/) (see also the [Translator SRI Jaeger-Demo](https://github.com/TranslatorSRI/Jaeger-demo)).

**Note:** the current system Docker (Compose) design only supports OpenTemplate tracing using the internal Jaeger container and may require further refinements to enable use of an external telemetry collector.

### Running the Web Service within Docker

The Reasoner Validator web service may be run inside a docker container, using Docker Compose.
Expand Down
1 change: 1 addition & 0 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from reasoner_validator.validator import TRAPIResponseValidator

telemetry_endpoint: Optional[str] = getenv("TELEMETRY_ENDPOINT")
print(f"Telemetry endpoint: {str(telemetry_endpoint)}", file=stderr)

SERVICE_NAME = "reasoner-validator"

Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,15 @@ services:
api:
build:
context: .
environment:
- TELEMETRY_ENDPOINT=http://jaeger:4318/v1/traces
ports:
- "80:80"
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686"
- "4318:4318"
- "6831:6831"
environment:
- LOG_LEVEL=debug

0 comments on commit ef5b814

Please sign in to comment.