Skip to content

Commit 9e7cabd

Browse files
committed
Added new metrics to API monitorinng endpoint
1 parent c97940f commit 9e7cabd

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

.idea/gradle.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openai/src/main/java/com/mardillu/openai/model/requests/LogApiRequest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ data class LogApiRequest(
77
val duration: Long,
88
val response_code: Int,
99
val method: String,
10+
val accountName: String = "NA",
11+
val userId: Long = 0L,
12+
val exception: String = "",
1013
)

openai/src/main/java/com/mardillu/openai/network/LoggingClient.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,21 @@ class LoggingClient {
5353
duration: Long,
5454
responseCode: Int,
5555
method: String,
56+
accountName: String = "NA",
57+
userId: Long = 0L,
58+
exception: String = "",
5659
completionHandler: (Any?, Throwable?) -> Unit
5760
) {
5861
val requestBody = LogApiRequest(
59-
route, request_time, response_time, duration, responseCode, method,
62+
route,
63+
request_time,
64+
response_time,
65+
duration,
66+
responseCode,
67+
method,
68+
accountName,
69+
userId,
70+
exception,
6071
)
6172
val call = apiService.logRequestTime(requestBody)
6273

0 commit comments

Comments
 (0)