Skip to content

Commit

Permalink
Refactor metric names to not include Watsonx (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshmiPriyaSujith authored Jan 13, 2025
1 parent d61eefb commit 5b947d4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion llm/src/main/java/com/instana/dc/llm/DataCollector.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private DataCollector() throws Exception {
}

private IDc newDc(Map<String, Object> props, CustomDcConfig cdcConfig) throws Exception {
return new LLMDcRegistry().findLLMDc("WATSONX").getConstructor(Map.class, CustomDcConfig.class)
return new LLMDcRegistry().findLLMDc("LLM").getConstructor(Map.class, CustomDcConfig.class)
.newInstance(props, cdcConfig);
}

Expand Down
2 changes: 1 addition & 1 deletion llm/src/main/java/com/instana/dc/llm/LLMDcRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class LLMDcRegistry {
/* Add all DataCollector implementations here:
**/
private final Map<String, Class<? extends AbstractLLMDc>> map = new HashMap<String, Class<? extends AbstractLLMDc>>() {{
put("WATSONX", LLMDc.class);
put("LLM", LLMDc.class);
// More DCs can be registred here
}};

Expand Down
38 changes: 19 additions & 19 deletions llm/src/main/java/com/instana/dc/llm/LLMDcUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,78 +24,78 @@ public class LLMDcUtil {
public static final String UNIT_1 = "1";

public static final String LLM_USER_NAME = "llm.request.user";
public static final String LLM_USER_DESC = "The user for watson api call";
public static final String LLM_USER_DESC = "The user for LLM api call";
public static final String LLM_USER_UNIT = "{user}";

public static final String LLM_MODEL_ID_NAME = "llm.request.modelId";
public static final String LLM_MODEL_ID_DESC = "The model id of the watsonx calls";
public static final String LLM_MODEL_ID_DESC = "The model id of the LLM calls";
public static final String LLM_MODEL_ID_UNIT = "{modelId}";

public static final String LLM_STATUS_NAME = "llm.status";
public static final String LLM_STATUS_DESC = "The status of the watsonx dc";
public static final String LLM_STATUS_DESC = "The status of the LLM dc";
public static final String LLM_STATUS_UNIT = "{status}";

public static final String LLM_DURATION_NAME = "llm.response.duration";
public static final String LLM_DURATION_DESC = "The average duration of watsonx calls by interval";
public static final String LLM_DURATION_DESC = "The average duration of LLM calls by interval";
public static final String LLM_DURATION_UNIT = "ms";

public static final String LLM_DURATION_MAX_NAME = "llm.response.duration.max";
public static final String LLM_DURATION_MAX_DESC = "The maximum duration of watsonx calls by interval";
public static final String LLM_DURATION_MAX_DESC = "The maximum duration of LLM calls by interval";
public static final String LLM_DURATION_MAX_UNIT = "ms";

public static final String LLM_COST_NAME = "llm.usage.cost";
public static final String LLM_COST_DESC = "The total cost of watsonx calls by interval";
public static final String LLM_COST_DESC = "The total cost of LLM calls by interval";
public static final String LLM_COST_UNIT = "{cost}";

public static final String LLM_INPUT_COST_NAME = "llm.usage.input_cost";
public static final String LLM_INPUT_COST_DESC = "The input cost of watsonx calls by interval";
public static final String LLM_INPUT_COST_DESC = "The input cost of LLM calls by interval";
public static final String LLM_INPUT_COST_UNIT = "{cost}";

public static final String LLM_OUTPUT_COST_NAME = "llm.usage.output_cost";
public static final String LLM_OUTPUT_COST_DESC = "The output cost of watsonx calls by interval";
public static final String LLM_OUTPUT_COST_DESC = "The output cost of LLM calls by interval";
public static final String LLM_OUTPUT_COST_UNIT = "{cost}";

public static final String LLM_TOKEN_NAME = "llm.usage.total_tokens";
public static final String LLM_TOKEN_DESC = "The total tokens of watsonx calls by interval";
public static final String LLM_TOKEN_DESC = "The total tokens of LLM calls by interval";
public static final String LLM_TOKEN_UNIT = "{token}";

public static final String LLM_INPUT_TOKEN_NAME = "llm.usage.input_tokens";
public static final String LLM_INPUT_TOKEN_DESC = "The input tokens of watsonx calls by interval";
public static final String LLM_INPUT_TOKEN_DESC = "The input tokens of LLM calls by interval";
public static final String LLM_INPUT_TOKEN_UNIT = "{token}";

public static final String LLM_OUTPUT_TOKEN_NAME = "llm.usage.output_tokens";
public static final String LLM_OUTPUT_TOKEN_DESC = "The output tokens of watsonx calls by interval";
public static final String LLM_OUTPUT_TOKEN_DESC = "The output tokens of LLM calls by interval";
public static final String LLM_OUTPUT_TOKEN_UNIT = "{token}";

public static final String LLM_REQ_COUNT_NAME = "llm.request.count";
public static final String LLM_REQ_COUNT_DESC = "The total count of watsonx calls by interval";
public static final String LLM_REQ_COUNT_DESC = "The total count of LLM calls by interval";
public static final String LLM_REQ_COUNT_UNIT = "{count}";

public static final String LLM_SERVICE_COST_NAME = "llm.service.usage.cost";
public static final String LLM_SERVICE_COST_DESC = "The total cost of watsonx calls by interval";
public static final String LLM_SERVICE_COST_DESC = "The total cost of LLM calls by interval";
public static final String LLM_SERVICE_COST_UNIT = "{cost}";

public static final String LLM_SERVICE_INPUT_COST_NAME = "llm.service.usage.input_cost";
public static final String LLM_SERVICE_INPUT_COST_DESC = "The input cost of watsonx calls by interval";
public static final String LLM_SERVICE_INPUT_COST_DESC = "The input cost of LLM calls by interval";
public static final String LLM_SERVICE_INPUT_COST_UNIT = "{cost}";

public static final String LLM_SERVICE_OUTPUT_COST_NAME = "llm.service.usage.output_cost";
public static final String LLM_SERVICE_OUTPUT_COST_DESC = "The output cost of watsonx calls by interval";
public static final String LLM_SERVICE_OUTPUT_COST_DESC = "The output cost of LLM calls by interval";
public static final String LLM_SERVICE_OUTPUT_COST_UNIT = "{cost}";

public static final String LLM_SERVICE_TOKEN_NAME = "llm.service.usage.total_tokens";
public static final String LLM_SERVICE_TOKEN_DESC = "The total tokens of watsonx calls by interval";
public static final String LLM_SERVICE_TOKEN_DESC = "The total tokens of LLM calls by interval";
public static final String LLM_SERVICE_TOKEN_UNIT = "{token}";

public static final String LLM_SERVICE_INPUT_TOKEN_NAME = "llm.service.usage.input_tokens";
public static final String LLM_SERVICE_INPUT_TOKEN_DESC = "The input tokens of watsonx calls by interval";
public static final String LLM_SERVICE_INPUT_TOKEN_DESC = "The input tokens of LLM calls by interval";
public static final String LLM_SERVICE_INPUT_TOKEN_UNIT = "{token}";

public static final String LLM_SERVICE_OUTPUT_TOKEN_NAME = "llm.service.usage.output_tokens";
public static final String LLM_SERVICE_OUTPUT_TOKEN_DESC = "The output tokens of watsonx calls by interval";
public static final String LLM_SERVICE_OUTPUT_TOKEN_DESC = "The output tokens of LLM calls by interval";
public static final String LLM_SERVICE_OUTPUT_TOKEN_UNIT = "{token}";

public static final String LLM_SERVICE_REQ_COUNT_NAME = "llm.service.request.count";
public static final String LLM_SERVICE_REQ_COUNT_DESC = "The total count of watsonx calls by interval";
public static final String LLM_SERVICE_REQ_COUNT_DESC = "The total count of LLM calls by interval";
public static final String LLM_SERVICE_REQ_COUNT_UNIT = "{count}";
}
2 changes: 1 addition & 1 deletion llm/src/main/java/com/instana/dc/llm/impl/llm/LLMDc.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class LLMDc extends AbstractLLMDc {

/**
* The poll rate in the configuration, in seconds. In other words, the number of
* seconds between calls to Watsonx.
* seconds between calls to LLM.
*/

private static class ModelAggregation {
Expand Down

0 comments on commit 5b947d4

Please sign in to comment.