@microsoft/agents-hosting 1.5.0-beta.6.ga236d9a19c → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/package.json +10 -9
  2. package/dist/src/activityHandler.js +2 -2
  3. package/dist/src/activityHandler.js.map +1 -1
  4. package/dist/src/agent-client/agentClient.js +49 -40
  5. package/dist/src/agent-client/agentClient.js.map +1 -1
  6. package/dist/src/agent-client/agentResponseHandler.js +2 -2
  7. package/dist/src/agent-client/agentResponseHandler.js.map +1 -1
  8. package/dist/src/app/agentApplication.d.ts +36 -10
  9. package/dist/src/app/agentApplication.js +169 -99
  10. package/dist/src/app/agentApplication.js.map +1 -1
  11. package/dist/src/app/agentApplicationBuilder.d.ts +15 -0
  12. package/dist/src/app/agentApplicationBuilder.js +22 -4
  13. package/dist/src/app/agentApplicationBuilder.js.map +1 -1
  14. package/dist/src/app/agentApplicationOptions.d.ts +38 -0
  15. package/dist/src/app/attachmentDownloader.js +2 -2
  16. package/dist/src/app/attachmentDownloader.js.map +1 -1
  17. package/dist/src/app/auth/authorization.js +12 -9
  18. package/dist/src/app/auth/authorization.js.map +1 -1
  19. package/dist/src/app/auth/authorizationManager.d.ts +18 -5
  20. package/dist/src/app/auth/authorizationManager.js +258 -45
  21. package/dist/src/app/auth/authorizationManager.js.map +1 -1
  22. package/dist/src/app/auth/handlerStorage.js +3 -1
  23. package/dist/src/app/auth/handlerStorage.js.map +1 -1
  24. package/dist/src/app/auth/handlers/agenticAuthorization.d.ts +19 -16
  25. package/dist/src/app/auth/handlers/agenticAuthorization.js +46 -52
  26. package/dist/src/app/auth/handlers/agenticAuthorization.js.map +1 -1
  27. package/dist/src/app/auth/handlers/azureBotAuthorization.d.ts +51 -75
  28. package/dist/src/app/auth/handlers/azureBotAuthorization.js +217 -192
  29. package/dist/src/app/auth/handlers/azureBotAuthorization.js.map +1 -1
  30. package/dist/src/app/auth/types.d.ts +100 -1
  31. package/dist/src/app/auth/utils.d.ts +10 -0
  32. package/dist/src/app/auth/utils.js +21 -0
  33. package/dist/src/app/auth/utils.js.map +1 -0
  34. package/dist/src/app/index.d.ts +1 -0
  35. package/dist/src/app/index.js +1 -0
  36. package/dist/src/app/index.js.map +1 -1
  37. package/dist/src/app/proactive/conversation.d.ts +43 -0
  38. package/dist/src/app/proactive/conversation.js +67 -0
  39. package/dist/src/app/proactive/conversation.js.map +1 -0
  40. package/dist/src/app/proactive/conversationBuilder.d.ts +54 -0
  41. package/dist/src/app/proactive/conversationBuilder.js +110 -0
  42. package/dist/src/app/proactive/conversationBuilder.js.map +1 -0
  43. package/dist/src/app/proactive/conversationReferenceBuilder.d.ts +68 -0
  44. package/dist/src/app/proactive/conversationReferenceBuilder.js +125 -0
  45. package/dist/src/app/proactive/conversationReferenceBuilder.js.map +1 -0
  46. package/dist/src/app/proactive/createConversationOptions.d.ts +30 -0
  47. package/dist/src/app/proactive/createConversationOptions.js +10 -0
  48. package/dist/src/app/proactive/createConversationOptions.js.map +1 -0
  49. package/dist/src/app/proactive/createConversationOptionsBuilder.d.ts +69 -0
  50. package/dist/src/app/proactive/createConversationOptionsBuilder.js +141 -0
  51. package/dist/src/app/proactive/createConversationOptionsBuilder.js.map +1 -0
  52. package/dist/src/app/proactive/index.d.ts +7 -0
  53. package/dist/src/app/proactive/index.js +26 -0
  54. package/dist/src/app/proactive/index.js.map +1 -0
  55. package/dist/src/app/proactive/proactive.d.ts +248 -0
  56. package/dist/src/app/proactive/proactive.js +310 -0
  57. package/dist/src/app/proactive/proactive.js.map +1 -0
  58. package/dist/src/app/proactive/proactiveOptions.d.ts +19 -0
  59. package/dist/src/app/proactive/proactiveOptions.js +5 -0
  60. package/dist/src/app/proactive/proactiveOptions.js.map +1 -0
  61. package/dist/src/app/streaming/streamingResponse.js +2 -2
  62. package/dist/src/app/streaming/streamingResponse.js.map +1 -1
  63. package/dist/src/app/teamsAttachmentDownloader.js +2 -2
  64. package/dist/src/app/teamsAttachmentDownloader.js.map +1 -1
  65. package/dist/src/app/turnState.js +2 -2
  66. package/dist/src/app/turnState.js.map +1 -1
  67. package/dist/src/auth/authConfiguration.d.ts +61 -0
  68. package/dist/src/auth/authConfiguration.js +52 -3
  69. package/dist/src/auth/authConfiguration.js.map +1 -1
  70. package/dist/src/auth/jwt-middleware.js +2 -2
  71. package/dist/src/auth/jwt-middleware.js.map +1 -1
  72. package/dist/src/auth/msalConnectionManager.js +20 -0
  73. package/dist/src/auth/msalConnectionManager.js.map +1 -1
  74. package/dist/src/auth/msalTokenCredential.js +3 -0
  75. package/dist/src/auth/msalTokenCredential.js.map +1 -1
  76. package/dist/src/auth/msalTokenProvider.js +136 -110
  77. package/dist/src/auth/msalTokenProvider.js.map +1 -1
  78. package/dist/src/baseAdapter.js +2 -2
  79. package/dist/src/baseAdapter.js.map +1 -1
  80. package/dist/src/cloudAdapter.js +201 -154
  81. package/dist/src/cloudAdapter.js.map +1 -1
  82. package/dist/src/connector-client/connectorClient.js +176 -127
  83. package/dist/src/connector-client/connectorClient.js.map +1 -1
  84. package/dist/src/errorHelper.js +108 -0
  85. package/dist/src/errorHelper.js.map +1 -1
  86. package/dist/src/middlewareSet.js +2 -2
  87. package/dist/src/middlewareSet.js.map +1 -1
  88. package/dist/src/oauth/userTokenClient.js +78 -48
  89. package/dist/src/oauth/userTokenClient.js.map +1 -1
  90. package/dist/src/observability/index.d.ts +2 -0
  91. package/dist/src/observability/index.js +21 -0
  92. package/dist/src/observability/index.js.map +1 -0
  93. package/dist/src/observability/metrics.d.ts +21 -0
  94. package/dist/src/observability/metrics.js +87 -0
  95. package/dist/src/observability/metrics.js.map +1 -0
  96. package/dist/src/observability/traces.d.ts +234 -0
  97. package/dist/src/observability/traces.js +962 -0
  98. package/dist/src/observability/traces.js.map +1 -0
  99. package/dist/src/state/agentState.js +2 -2
  100. package/dist/src/state/agentState.js.map +1 -1
  101. package/dist/src/storage/fileStorage.js +38 -28
  102. package/dist/src/storage/fileStorage.js.map +1 -1
  103. package/dist/src/storage/memoryStorage.js +41 -30
  104. package/dist/src/storage/memoryStorage.js.map +1 -1
  105. package/dist/src/transcript/fileTranscriptLogger.js +2 -2
  106. package/dist/src/transcript/fileTranscriptLogger.js.map +1 -1
  107. package/dist/src/transcript/transcriptLoggerMiddleware.js +2 -2
  108. package/dist/src/transcript/transcriptLoggerMiddleware.js.map +1 -1
  109. package/dist/src/turnContext.js +48 -42
  110. package/dist/src/turnContext.js.map +1 -1
  111. package/package.json +10 -9
  112. package/src/activityHandler.ts +1 -1
  113. package/src/agent-client/agentClient.ts +53 -42
  114. package/src/agent-client/agentResponseHandler.ts +1 -1
  115. package/src/app/agentApplication.ts +212 -86
  116. package/src/app/agentApplicationBuilder.ts +26 -4
  117. package/src/app/agentApplicationOptions.ts +43 -0
  118. package/src/app/attachmentDownloader.ts +1 -1
  119. package/src/app/auth/authorization.ts +11 -8
  120. package/src/app/auth/authorizationManager.ts +297 -45
  121. package/src/app/auth/handlerStorage.ts +3 -1
  122. package/src/app/auth/handlers/agenticAuthorization.ts +68 -72
  123. package/src/app/auth/handlers/azureBotAuthorization.ts +260 -264
  124. package/src/app/auth/types.ts +102 -1
  125. package/src/app/auth/utils.ts +22 -0
  126. package/src/app/index.ts +1 -0
  127. package/src/app/proactive/conversation.ts +87 -0
  128. package/src/app/proactive/conversationBuilder.ts +139 -0
  129. package/src/app/proactive/conversationReferenceBuilder.ts +161 -0
  130. package/src/app/proactive/createConversationOptions.ts +35 -0
  131. package/src/app/proactive/createConversationOptionsBuilder.ts +181 -0
  132. package/src/app/proactive/index.ts +10 -0
  133. package/src/app/proactive/proactive.ts +524 -0
  134. package/src/app/proactive/proactiveOptions.ts +24 -0
  135. package/src/app/streaming/streamingResponse.ts +1 -1
  136. package/src/app/teamsAttachmentDownloader.ts +1 -1
  137. package/src/app/turnState.ts +1 -1
  138. package/src/auth/authConfiguration.ts +58 -1
  139. package/src/auth/jwt-middleware.ts +1 -1
  140. package/src/auth/msalConnectionManager.ts +22 -0
  141. package/src/auth/msalTokenCredential.ts +4 -0
  142. package/src/auth/msalTokenProvider.ts +138 -107
  143. package/src/baseAdapter.ts +1 -1
  144. package/src/cloudAdapter.ts +239 -184
  145. package/src/connector-client/connectorClient.ts +169 -126
  146. package/src/errorHelper.ts +124 -0
  147. package/src/middlewareSet.ts +1 -1
  148. package/src/oauth/userTokenClient.ts +70 -46
  149. package/src/observability/index.ts +5 -0
  150. package/src/observability/metrics.ts +103 -0
  151. package/src/observability/traces.ts +988 -0
  152. package/src/state/agentState.ts +1 -1
  153. package/src/storage/fileStorage.ts +36 -26
  154. package/src/storage/memoryStorage.ts +40 -29
  155. package/src/transcript/fileTranscriptLogger.ts +1 -1
  156. package/src/transcript/transcriptLoggerMiddleware.ts +1 -1
  157. package/src/turnContext.ts +47 -41
@@ -3,13 +3,15 @@
3
3
 
4
4
  import axios, { AxiosInstance } from 'axios'
5
5
  import { Activity, ConversationReference } from '@microsoft/agents-activity'
6
- import { debug } from '@microsoft/agents-activity/logger'
6
+ import { debug } from '@microsoft/agents-telemetry'
7
7
  import { normalizeTokenExchangeState } from '../activityWireCompat'
8
8
  import { AadResourceUrls, SignInResource, TokenExchangeRequest, TokenOrSinginResourceResponse, TokenResponse, TokenStatus } from './userTokenClient.types'
9
9
  import { getProductInfo } from '../getProductInfo'
10
10
  import { AuthProvider } from '../auth'
11
11
  import { HeaderPropagation, HeaderPropagationCollection } from '../headerPropagation'
12
12
  import { getTokenServiceEndpoint } from './customUserTokenAPI'
13
+ import { trace } from '@microsoft/agents-telemetry'
14
+ import { UserTokenClientTraceDefinitions } from '../observability'
13
15
 
14
16
  const logger = debug('agents:user-token-client')
15
17
 
@@ -144,13 +146,17 @@ export class UserTokenClient {
144
146
  * @returns A promise that resolves to the user token.
145
147
  */
146
148
  async getUserToken (connectionName: string, channelIdComposite: string, userId: string, code?: string) : Promise<TokenResponse> {
147
- const [channelId] = Activity.parseChannelId(channelIdComposite)
148
- const params = { connectionName, channelId, userId, code }
149
- const response = await this.client.get('/api/usertoken/GetToken', { params })
150
- if (response?.data) {
151
- return response.data as TokenResponse
152
- }
153
- return { token: undefined }
149
+ return trace(UserTokenClientTraceDefinitions.getUserToken, async ({ record }) => {
150
+ const [channelId] = Activity.parseChannelId(channelIdComposite)
151
+ const params = { connectionName, channelId, userId, code }
152
+ const response = await this.client.get('/api/usertoken/GetToken', { params })
153
+ record({ connectionName, channelId, userId, httpStatusCode: response.status?.toString() })
154
+
155
+ if (response?.data) {
156
+ return response.data as TokenResponse
157
+ }
158
+ return { token: undefined }
159
+ })
154
160
  }
155
161
 
156
162
  /**
@@ -161,12 +167,15 @@ export class UserTokenClient {
161
167
  * @returns A promise that resolves when the sign-out operation is complete.
162
168
  */
163
169
  async signOut (userId: string, connectionName: string, channelIdComposite: string) : Promise<void> {
164
- const [channelId] = Activity.parseChannelId(channelIdComposite)
165
- const params = { userId, connectionName, channelId }
166
- const response = await this.client.delete('/api/usertoken/SignOut', { params })
167
- if (response.status !== 200) {
168
- throw new Error('Failed to sign out')
169
- }
170
+ return trace(UserTokenClientTraceDefinitions.signOut, async ({ record }) => {
171
+ const [channelId] = Activity.parseChannelId(channelIdComposite)
172
+ const params = { userId, connectionName, channelId }
173
+ const response = await this.client.delete('/api/usertoken/SignOut', { params })
174
+ record({ userId, connectionName, channelId, httpStatusCode: response.status?.toString() })
175
+ if (response.status !== 200) {
176
+ throw new Error('Failed to sign out')
177
+ }
178
+ })
170
179
  }
171
180
 
172
181
  /**
@@ -178,17 +187,20 @@ export class UserTokenClient {
178
187
  * @returns A promise that resolves to the signing resource.
179
188
  */
180
189
  async getSignInResource (msAppId: string, connectionName: string, conversation: ConversationReference, relatesTo?: ConversationReference) : Promise<SignInResource> {
181
- const tokenExchangeState = {
182
- connectionName,
183
- conversation,
184
- relatesTo,
185
- msAppId
186
- }
187
- const tokenExchangeStateNormalized = normalizeTokenExchangeState(tokenExchangeState)
188
- const state = Buffer.from(JSON.stringify(tokenExchangeStateNormalized)).toString('base64')
189
- const params = { state }
190
- const response = await this.client.get('/api/botsignin/GetSignInResource', { params })
191
- return response.data as SignInResource
190
+ return trace(UserTokenClientTraceDefinitions.getSignInResource, async ({ record }) => {
191
+ const tokenExchangeState = {
192
+ connectionName,
193
+ conversation,
194
+ relatesTo,
195
+ msAppId
196
+ }
197
+ const tokenExchangeStateNormalized = normalizeTokenExchangeState(tokenExchangeState)
198
+ const state = Buffer.from(JSON.stringify(tokenExchangeStateNormalized)).toString('base64')
199
+ const params = { state }
200
+ const response = await this.client.get('/api/botsignin/GetSignInResource', { params })
201
+ record({ connectionName, httpStatusCode: response.status?.toString() })
202
+ return response.data as SignInResource
203
+ })
192
204
  }
193
205
 
194
206
  /**
@@ -200,14 +212,17 @@ export class UserTokenClient {
200
212
  * @returns A promise that resolves to the exchanged token.
201
213
  */
202
214
  async exchangeTokenAsync (userId: string, connectionName: string, channelIdComposite: string, tokenExchangeRequest: TokenExchangeRequest) : Promise<TokenResponse> {
203
- const [channelId] = Activity.parseChannelId(channelIdComposite)
204
- const params = { userId, connectionName, channelId }
205
- const response = await this.client.post('/api/usertoken/exchange', tokenExchangeRequest, { params })
206
- if (response?.data) {
207
- return response.data as TokenResponse
208
- } else {
209
- return { token: undefined }
210
- }
215
+ return trace(UserTokenClientTraceDefinitions.exchangeToken, async ({ record }) => {
216
+ const [channelId] = Activity.parseChannelId(channelIdComposite)
217
+ const params = { userId, connectionName, channelId }
218
+ const response = await this.client.post('/api/usertoken/exchange', tokenExchangeRequest, { params })
219
+ record({ userId, connectionName, channelId, httpStatusCode: response.status?.toString() })
220
+ if (response?.data) {
221
+ return response.data as TokenResponse
222
+ } else {
223
+ return { token: undefined }
224
+ }
225
+ })
211
226
  }
212
227
 
213
228
  /**
@@ -223,11 +238,14 @@ export class UserTokenClient {
223
238
  * @returns A promise that resolves to the token or sign-in resource response.
224
239
  */
225
240
  async getTokenOrSignInResource (userId: string, connectionName: string, channelIdComposite: string, conversation: ConversationReference, relatesTo: ConversationReference, code: string, finalRedirect: string = '', fwdUrl: string = '') : Promise<TokenOrSinginResourceResponse> {
226
- const [channelId] = Activity.parseChannelId(channelIdComposite)
227
- const state = Buffer.from(JSON.stringify({ conversation, relatesTo, connectionName, msAppId: this.msAppId })).toString('base64')
228
- const params = { userId, connectionName, channelId, state, code, finalRedirect, fwdUrl }
229
- const response = await this.client.get('/api/usertoken/GetTokenOrSignInResource', { params })
230
- return response.data as TokenOrSinginResourceResponse
241
+ return trace(UserTokenClientTraceDefinitions.getTokenOrSignInResource, async ({ record }) => {
242
+ const [channelId] = Activity.parseChannelId(channelIdComposite)
243
+ const state = Buffer.from(JSON.stringify({ conversation, relatesTo, connectionName, msAppId: this.msAppId })).toString('base64')
244
+ const params = { userId, connectionName, channelId, state, code, finalRedirect, fwdUrl }
245
+ const response = await this.client.get('/api/usertoken/GetTokenOrSignInResource', { params })
246
+ record({ userId, connectionName, channelId, httpStatusCode: response.status?.toString() })
247
+ return response.data as TokenOrSinginResourceResponse
248
+ })
231
249
  }
232
250
 
233
251
  /**
@@ -238,10 +256,13 @@ export class UserTokenClient {
238
256
  * @returns A promise that resolves to the token status.
239
257
  */
240
258
  async getTokenStatus (userId: string, channelIdComposite: string, include: string = null!): Promise<TokenStatus[]> {
241
- const [channelId] = Activity.parseChannelId(channelIdComposite)
242
- const params = { userId, channelId, include }
243
- const response = await this.client.get('/api/usertoken/GetTokenStatus', { params })
244
- return response.data as TokenStatus[]
259
+ return trace(UserTokenClientTraceDefinitions.getTokenStatus, async ({ record }) => {
260
+ const [channelId] = Activity.parseChannelId(channelIdComposite)
261
+ const params = { userId, channelId, include }
262
+ const response = await this.client.get('/api/usertoken/GetTokenStatus', { params })
263
+ record({ userId, channelId, httpStatusCode: response.status?.toString() })
264
+ return response.data as TokenStatus[]
265
+ })
245
266
  }
246
267
 
247
268
  /**
@@ -253,10 +274,13 @@ export class UserTokenClient {
253
274
  * @returns A promise that resolves to the AAD tokens.
254
275
  */
255
276
  async getAadTokens (userId: string, connectionName: string, channelIdComposite: string, resourceUrls: AadResourceUrls) : Promise<Record<string, TokenResponse>> {
256
- const [channelId] = Activity.parseChannelId(channelIdComposite)
257
- const params = { userId, connectionName, channelId }
258
- const response = await this.client.post('/api/usertoken/GetAadTokens', resourceUrls, { params })
259
- return response.data as Record<string, TokenResponse>
277
+ return trace(UserTokenClientTraceDefinitions.getAadTokens, async ({ record }) => {
278
+ const [channelId] = Activity.parseChannelId(channelIdComposite)
279
+ const params = { userId, connectionName, channelId }
280
+ const response = await this.client.post('/api/usertoken/GetAadTokens', resourceUrls, { params })
281
+ record({ userId, connectionName, channelId, httpStatusCode: response.status?.toString() })
282
+ return response.data as Record<string, TokenResponse>
283
+ })
260
284
  }
261
285
 
262
286
  public updateAuthToken (token: string): void {
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ export * from './metrics'
5
+ export * from './traces'
@@ -0,0 +1,103 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { metric, MetricNames } from '@microsoft/agents-telemetry'
5
+
6
+ export const HostingMetrics = {
7
+ // Counters
8
+ activitiesReceivedCounter: metric.counter(MetricNames.ACTIVITIES_RECEIVED, {
9
+ unit: 'activities',
10
+ description: 'Total number of activities received by the adapter'
11
+ }),
12
+
13
+ activitiesSentCounter: metric.counter(MetricNames.ACTIVITIES_SENT, {
14
+ unit: 'activities',
15
+ description: 'Total number of outbound activities sent by the adapter'
16
+ }),
17
+
18
+ activitiesUpdatedCounter: metric.counter(MetricNames.ACTIVITIES_UPDATED, {
19
+ unit: 'activities',
20
+ description: 'Total number of activities updated by the adapter'
21
+ }),
22
+
23
+ activitiesDeletedCounter: metric.counter(MetricNames.ACTIVITIES_DELETED, {
24
+ unit: 'activities',
25
+ description: 'Total number of activities deleted by the adapter'
26
+ }),
27
+
28
+ connectorRequestsCounter: metric.counter(MetricNames.CONNECTOR_REQUESTS, {
29
+ unit: 'request',
30
+ description: 'Total number of outbound connector HTTP requests'
31
+ }),
32
+
33
+ agentClientRequestsCounter: metric.counter(MetricNames.AGENT_CLIENT_REQUESTS, {
34
+ unit: 'request',
35
+ description: 'Total number of inter-agent calls'
36
+ }),
37
+
38
+ turnsTotalCounter: metric.counter(MetricNames.TURNS_COUNT, {
39
+ unit: 'turn',
40
+ description: 'Total turns processed'
41
+ }),
42
+
43
+ turnsErrorsCounter: metric.counter(MetricNames.TURNS_ERRORS, {
44
+ unit: 'turn',
45
+ description: 'Total turns that resulted in an error'
46
+ }),
47
+
48
+ authTokenRequestsCounter: metric.counter(MetricNames.AUTH_TOKEN_REQUEST_COUNT, {
49
+ unit: 'request',
50
+ description: 'Total number of token acquisition attempts'
51
+ }),
52
+
53
+ userTokenClientRequestsCounter: metric.counter(MetricNames.USER_TOKEN_CLIENT_REQUESTS, {
54
+ unit: 'request',
55
+ description: 'Total number of user token client HTTP requests'
56
+ }),
57
+
58
+ proactiveOperationCounter: metric.counter(MetricNames.PROACTIVE_OPERATION_COUNT, {
59
+ unit: 'operation',
60
+ description: 'Total number of proactive operations (sendActivity, continueConversation, createConversation)'
61
+ }),
62
+
63
+ // Duration Histograms
64
+ adapterProcessDuration: metric.histogram(MetricNames.ADAPTER_PROCESS_DURATION, {
65
+ unit: 'ms',
66
+ description: 'Duration of the adapter process method in milliseconds'
67
+ }),
68
+
69
+ connectorRequestDuration: metric.histogram(MetricNames.CONNECTOR_REQUEST_DURATION, {
70
+ unit: 'ms',
71
+ description: 'Duration of outbound connector HTTP requests in milliseconds'
72
+ }),
73
+
74
+ agentClientRequestDuration: metric.histogram(MetricNames.AGENT_CLIENT_REQUEST_DURATION, {
75
+ unit: 'ms',
76
+ description: 'Duration of inter-agent call latency in milliseconds'
77
+ }),
78
+
79
+ turnDuration: metric.histogram(MetricNames.TURN_DURATION, {
80
+ unit: 'ms',
81
+ description: 'Duration of end-to-end turn processing in milliseconds'
82
+ }),
83
+
84
+ storageOperationDuration: metric.histogram(MetricNames.STORAGE_OPERATION_DURATION, {
85
+ unit: 'ms',
86
+ description: 'Duration of storage operations in milliseconds'
87
+ }),
88
+
89
+ authTokenDuration: metric.histogram(MetricNames.AUTH_TOKEN_DURATION, {
90
+ unit: 'ms',
91
+ description: 'Duration of token acquisition latency in milliseconds'
92
+ }),
93
+
94
+ userTokenClientRequestDuration: metric.histogram(MetricNames.USER_TOKEN_CLIENT_REQUEST_DURATION, {
95
+ unit: 'ms',
96
+ description: 'Duration of user token client HTTP requests in milliseconds'
97
+ }),
98
+
99
+ proactiveOperationDuration: metric.histogram(MetricNames.PROACTIVE_OPERATION_DURATION, {
100
+ unit: 'ms',
101
+ description: 'Duration of proactive operations in milliseconds'
102
+ })
103
+ }