diff --git a/llm/config/config.yaml b/llm/config/config.yaml index eb08d6a..2f08bad 100644 --- a/llm/config/config.yaml +++ b/llm/config/config.yaml @@ -3,5 +3,6 @@ llm.application: LLM_DC instances: - otel.backend.url: http://localhost:4317 otel.service.name: DC1 + otel.service.port: 8000 price.prompt.tokens.per.kilo: 0.0 price.complete.tokens.per.kilo: 0.0 diff --git a/llm/config/logging.properties b/llm/config/logging.properties index 9dcf7bf..85a5aad 100644 --- a/llm/config/logging.properties +++ b/llm/config/logging.properties @@ -7,6 +7,6 @@ java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # default file output is in user's home directory. java.util.logging.FileHandler.level=INFO java.util.logging.FileHandler.pattern = %h/llm-dc%u.log -java.util.logging.FileHandler.limit = 500000 -java.util.logging.FileHandler.count = 10 +java.util.logging.FileHandler.limit = 5000000 +java.util.logging.FileHandler.count = 3 java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter \ No newline at end of file diff --git a/llm/src/main/java/com/instana/dc/llm/LLMDcUtil.java b/llm/src/main/java/com/instana/dc/llm/LLMDcUtil.java index 463db2b..19e538a 100644 --- a/llm/src/main/java/com/instana/dc/llm/LLMDcUtil.java +++ b/llm/src/main/java/com/instana/dc/llm/LLMDcUtil.java @@ -17,6 +17,7 @@ public class LLMDcUtil { public static final String SERVICE_INSTANCE_ID = "service.instance.id"; public final static String PRICE_PROMPT_TOKES_PER_KILO = "price.prompt.tokens.per.kilo"; public final static String PRICE_COMPLETE_TOKES_PER_KILO = "price.complete.tokens.per.kilo"; + public final static String SERVICE_LISTEN_PORT = "otel.service.port"; /* Configurations for Metrics: */ diff --git a/llm/src/main/java/com/instana/dc/llm/impl/llm/LLMDc.java b/llm/src/main/java/com/instana/dc/llm/impl/llm/LLMDc.java index e0f4eab..381bafa 100644 --- a/llm/src/main/java/com/instana/dc/llm/impl/llm/LLMDc.java +++ b/llm/src/main/java/com/instana/dc/llm/impl/llm/LLMDc.java @@ -31,6 +31,7 @@ public class LLMDc extends AbstractLLMDc { private MetricsCollectorService metricsCollector = new MetricsCollectorService(); private Double pricePromptTokens = 0.0; private Double priceCompleteTokens = 0.0; + private int listenPort = 0; /** * The poll rate in the configuration, in seconds. In other words, the number of @@ -135,14 +136,15 @@ public void resetMetrics() { public LLMDc(Map properties, CustomDcConfig cdcConfig) throws Exception { super(properties, cdcConfig); - pricePromptTokens = (Double) properties.getOrDefault(PRICE_PROMPT_TOKES_PER_KILO, 0.03); - priceCompleteTokens = (Double) properties.getOrDefault(PRICE_COMPLETE_TOKES_PER_KILO, 0.03); + pricePromptTokens = (Double) properties.getOrDefault(PRICE_PROMPT_TOKES_PER_KILO, 0.0); + priceCompleteTokens = (Double) properties.getOrDefault(PRICE_COMPLETE_TOKES_PER_KILO, 0.0); + listenPort = (int) properties.getOrDefault(SERVICE_LISTEN_PORT, 8000); } @Override public void initOnce() throws ClassNotFoundException { var server = Server.builder() - .http(8000) + .http(listenPort) .service( GrpcService.builder() .addService(metricsCollector)