Skip to content

Commit 21a49b7

Browse files
committed
add source to loading metrics
1 parent 0b696f9 commit 21a49b7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ class DiskCache(
102102
}
103103

104104
override fun loadClientRegistration(cacheKey: ClientRegistrationCacheKey, source: String): ClientRegistration? {
105-
LOG.info { "loadClientRegistration for $cacheKey" }
105+
LOG.info { "loadClientRegistration:$source for $cacheKey" }
106106
val inputStream = clientRegistrationCache(cacheKey).tryInputStreamIfExists()
107107
if (inputStream == null) {
108108
val stage = LoadCredentialStage.ACCESS_FILE
109109
LOG.info { "Failed to load Client Registration: cache file does not exist" }
110110
AuthTelemetry.modifyConnection(
111111
action = "Load cache file",
112-
source = "loadClientRegistration",
112+
source = "loadClientRegistration:$source",
113113
result = Result.Failed,
114114
reason = "Failed to load Client Registration",
115115
reasonDesc = "Load Step:$stage failed. Cache file does not exist"

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/SsoAccessTokenProvider.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class SsoAccessTokenProvider(
194194

195195
@Deprecated("Device authorization grant flow is deprecated")
196196
private fun registerDAGClient(): ClientRegistration {
197-
loadDagClientRegistration(SourceOf)?.let {
197+
loadDagClientRegistration(SourceOfLoadRegistration.REGISTER_CLIENT.toString())?.let {
198198
return it
199199
}
200200

@@ -235,7 +235,7 @@ class SsoAccessTokenProvider(
235235
}
236236

237237
private fun registerPkceClient(): PKCEClientRegistration {
238-
loadPkceClientRegistration()?.let {
238+
loadPkceClientRegistration(SourceOfLoadRegistration.REGISTER_CLIENT.toString())?.let {
239239
return it
240240
}
241241

@@ -431,8 +431,8 @@ class SsoAccessTokenProvider(
431431
stageName = RefreshCredentialStage.LOAD_REGISTRATION
432432
val registration = try {
433433
when (currentToken) {
434-
is DeviceAuthorizationGrantToken -> loadDagClientRegistration()
435-
is PKCEAuthorizationGrantToken -> loadPkceClientRegistration()
434+
is DeviceAuthorizationGrantToken -> loadDagClientRegistration(SourceOfLoadRegistration.REFRESH_TOKEN.toString())
435+
is PKCEAuthorizationGrantToken -> loadPkceClientRegistration(SourceOfLoadRegistration.REFRESH_TOKEN.toString())
436436
}
437437
} catch (e: Exception) {
438438
val message = e.message ?: "$stageName: ${e::class.java.name}"

0 commit comments

Comments
 (0)