@@ -13,6 +13,11 @@ type DistributorEventDetails = {
13
13
distributorUrl ?: string | null
14
14
}
15
15
16
+ type StorageOperatorEventDetails = {
17
+ storageOperatorId ?: string
18
+ storageOperatorUrl ?: string | null
19
+ }
20
+
16
21
export type DistributorEventMetric = {
17
22
initialResponseTime ?: number
18
23
fullResponseTime ?: number
@@ -44,11 +49,15 @@ type UserLogEvent = {
44
49
[ x : string ] : unknown
45
50
}
46
51
47
- export type DistributorEventEntry = {
52
+ export type DataObjectEventEntry = {
48
53
dataObjectId ?: string | null
49
54
dataObjectType ?: DataObjectType [ '__typename' ] | AssetType
50
55
resolvedUrl ?: string
51
- } & DistributorEventDetails
56
+ }
57
+
58
+ export type StorageOperatorEventEntry = DataObjectEventEntry & StorageOperatorEventDetails
59
+
60
+ export type DistributorEventEntry = DataObjectEventEntry & DistributorEventDetails
52
61
53
62
type CodecInfo = {
54
63
assetType : string | null
@@ -144,6 +153,15 @@ class _UserEventsLogger {
144
153
this . addErrorEvent ( event )
145
154
}
146
155
156
+ logUploadError ( entry : StorageOperatorEventEntry , error : Error ) {
157
+ const event : UserLogEvent = {
158
+ type : 'distributor-response-error' ,
159
+ ...entry ,
160
+ error : error . message ,
161
+ }
162
+ this . addErrorEvent ( event )
163
+ }
164
+
147
165
logDistributorResponseTimeout ( entry : DistributorEventEntry ) {
148
166
const event : UserPerformanceEvent = {
149
167
type : 'distributor-response-timeout' ,
@@ -177,7 +195,7 @@ class _UserEventsLogger {
177
195
this . addErrorEvent ( event )
178
196
}
179
197
180
- logAssetUploadFailedEvent ( entry : DistributorEventEntry , error : Error ) {
198
+ logAssetUploadFailedEvent ( entry : StorageOperatorEventEntry , error : Error ) {
181
199
const event : UserLogEvent = {
182
200
type : 'asset-upload-failed' ,
183
201
...entry ,
0 commit comments