From 275b403f82b57eedf4105deb79a4941c216e4623 Mon Sep 17 00:00:00 2001 From: Jamie Land Date: Sat, 26 Oct 2024 07:34:36 -0400 Subject: [PATCH] Adding opentelementry --- .../java/com/redhat/composer/services/ChatBotService.java | 4 ++-- src/main/resources/application.properties | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/redhat/composer/services/ChatBotService.java b/src/main/java/com/redhat/composer/services/ChatBotService.java index bf763eb..7e725aa 100644 --- a/src/main/java/com/redhat/composer/services/ChatBotService.java +++ b/src/main/java/com/redhat/composer/services/ChatBotService.java @@ -76,7 +76,7 @@ public Multi chat(ChatBotRequest request) { .getChatModel(request.getModelRequest()); // TODO: Make this configurable - Class aiServiceClass = aiServicesFactory.getAiService(AIServicesFactory.HEALTHCARE_SERVICE); + Class aiServiceClass = aiServicesFactory.getAiService(AIServicesFactory.MISTRAL7B_AI_SERVICE); BaseAIService aiService = AiServices.builder(aiServiceClass) .streamingChatLanguageModel(llm) @@ -94,8 +94,8 @@ public Multi chat(ChatBotRequest request) { em.emit("\n\nSources used to generate this content:\n"); contentSources.forEach(content -> { em.emit(content.textSegment().metadata().getString("source") + "\n"); - log.info("Chat complete, traceId: " + traceId); }); + log.info("Chat complete, traceId: " + traceId); em.complete(); }) .start(); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 6374535..11159bf 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -30,7 +30,7 @@ mistral.default.temp=0.8 ############################################################ # Default OpenAI Model ############################################################ -openai.default.url=https://vllm-predictor-composer-ai.apps.cluster-c4gwj.c4gwj.sandbox1157.opentlc.com/v1 +openai.default.url= https://vllm-predictor-composer-ai-app.apps.cluster-c4gwj.c4gwj.sandbox1157.opentlc.com/v1 openai.default.apiKey=abc123 # openai.default.url=https://mistral-7b-instruct-v0-3-maas-apicast-production.apps.prod.rhoai.rh-aiservices-bu.com:443/v1 # openai.default.apiKey= @@ -77,5 +77,9 @@ quarkus.liquibase-mongodb.change-log=db/changeLog.yml quarkus.liquibase-mongodb.enabled=true quarkus.liquibase-mongodb.migrate-at-start=true +# OpenTelemetry configuration +quarkus.opentelemetry.tracer.exporter.otlp.endpoint=http://localhost:4317 +quarkus.opentelemetry.tracer.exporter.otlp.enabled=true + # Override Log Level with Environment Variable QUARKUS_LOG_LEVEL quarkus.log.level=INFO