Skip to content

Commit 315ea06

Browse files
authored
Merge pull request #1383 from RedisInsight/be/feature/RI-3736_Normalize_telemetry_fields
#RI-3736, #RI-3738
2 parents fb2219d + 9e02853 commit 315ea06

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed

redisinsight/api/config/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export default {
155155
|| 'https://raw.githubusercontent.com/RediSearch/RediSearch/master/commands.json',
156156
},
157157
{
158-
name: 'redijson',
158+
name: 'redisjson',
159159
url: process.env.COMMANDS_REDIJSON_URL
160160
|| 'https://raw.githubusercontent.com/RedisJSON/RedisJSON/master/commands.json',
161161
},

redisinsight/api/src/modules/cli/services/cli-analytics/cli-analytics.service.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ describe('CliAnalyticsService', () => {
203203
TelemetryEvents.CliCommandExecuted,
204204
{
205205
databaseId,
206-
command: mockAdditionalData.command,
206+
command: mockAdditionalData.command.toUpperCase(),
207207
commandType: CommandType.Core,
208208
moduleName: 'n/a',
209209
capability: 'string',
@@ -231,7 +231,7 @@ describe('CliAnalyticsService', () => {
231231
{
232232
databaseId,
233233
error: ReplyError.name,
234-
command: mockAdditionalData.command,
234+
command: mockAdditionalData.command.toUpperCase(),
235235
commandType: CommandType.Core,
236236
moduleName: 'n/a',
237237
capability: 'string',
@@ -246,7 +246,7 @@ describe('CliAnalyticsService', () => {
246246
{
247247
databaseId,
248248
error: ReplyError.name,
249-
command: 'sadd',
249+
command: 'sadd'.toUpperCase(),
250250
},
251251
);
252252
});
@@ -259,7 +259,7 @@ describe('CliAnalyticsService', () => {
259259
{
260260
databaseId,
261261
error: CommandParsingError.name,
262-
command: mockAdditionalData.command,
262+
command: mockAdditionalData.command.toUpperCase(),
263263
commandType: CommandType.Core,
264264
moduleName: 'n/a',
265265
capability: 'string',
@@ -312,7 +312,7 @@ describe('CliAnalyticsService', () => {
312312
TelemetryEvents.CliClusterNodeCommandExecuted,
313313
{
314314
databaseId,
315-
command: mockAdditionalData.command,
315+
command: mockAdditionalData.command.toUpperCase(),
316316
commandType: CommandType.Core,
317317
moduleName: 'n/a',
318318
capability: 'string',
@@ -335,7 +335,7 @@ describe('CliAnalyticsService', () => {
335335
{
336336
databaseId,
337337
error: redisReplyError.name,
338-
command: 'sadd',
338+
command: 'sadd'.toUpperCase(),
339339
},
340340
);
341341
});

redisinsight/api/src/modules/cli/services/cli-analytics/cli-analytics.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class CliAnalyticsService extends CommandTelemetryBaseService {
106106
{
107107
databaseId,
108108
error: error?.name,
109-
command: error?.command?.name,
109+
command: error?.command?.name?.toUpperCase(),
110110
...(await this.getCommandAdditionalInfo(additionalData['command'])),
111111
...additionalData,
112112
},
@@ -139,7 +139,7 @@ export class CliAnalyticsService extends CommandTelemetryBaseService {
139139
{
140140
databaseId,
141141
error: error.name,
142-
command: error?.command?.name,
142+
command: error?.command?.name?.toUpperCase(),
143143
...(await this.getCommandAdditionalInfo(additionalData['command'])),
144144
...additionalData,
145145
},

redisinsight/api/src/modules/cli/services/cli-business/cli-business.service.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe('CliBusinessService', () => {
257257
expect(analyticsService.sendCommandExecutedEvent).toHaveBeenCalledWith(
258258
mockClientOptions.instanceId,
259259
{
260-
command: 'memory',
260+
command: 'memory'.toUpperCase(),
261261
outputFormat: CliOutputFormatterTypes.Raw,
262262
},
263263
);
@@ -283,7 +283,7 @@ describe('CliBusinessService', () => {
283283
expect(analyticsService.sendCommandExecutedEvent).toHaveBeenCalledWith(
284284
mockClientOptions.instanceId,
285285
{
286-
command: 'memory',
286+
command: 'memory'.toUpperCase(),
287287
outputFormat: CliOutputFormatterTypes.Raw,
288288
},
289289
);
@@ -416,7 +416,7 @@ describe('CliBusinessService', () => {
416416
expect(analyticsService.sendCommandExecutedEvent).toHaveBeenCalledWith(
417417
mockClientOptions.instanceId,
418418
{
419-
command: 'info',
419+
command: 'info'.toUpperCase(),
420420
outputFormat: CliOutputFormatterTypes.Raw,
421421
},
422422
);
@@ -491,7 +491,7 @@ describe('CliBusinessService', () => {
491491
...mockNode,
492492
},
493493
{
494-
command: 'memory',
494+
command: 'memory'.toUpperCase(),
495495
outputFormat: CliOutputFormatterTypes.Raw,
496496
},
497497
);
@@ -535,7 +535,7 @@ describe('CliBusinessService', () => {
535535
...mockNode,
536536
},
537537
{
538-
command: 'info',
538+
command: 'info'.toUpperCase(),
539539
outputFormat: CliOutputFormatterTypes.Raw,
540540
},
541541
);
@@ -699,7 +699,7 @@ describe('CliBusinessService', () => {
699699
status: CommandExecutionStatus.Success,
700700
},
701701
{
702-
command: 'memory',
702+
command: 'memory'.toUpperCase(),
703703
outputFormat: CliOutputFormatterTypes.Raw,
704704
},
705705
);
@@ -740,7 +740,7 @@ describe('CliBusinessService', () => {
740740
status: CommandExecutionStatus.Success,
741741
},
742742
{
743-
command: 'info',
743+
command: 'info'.toUpperCase(),
744744
outputFormat: CliOutputFormatterTypes.Raw,
745745
},
746746
);
@@ -786,7 +786,7 @@ describe('CliBusinessService', () => {
786786
status: CommandExecutionStatus.Success,
787787
},
788788
{
789-
command: 'set',
789+
command: 'set'.toUpperCase(),
790790
outputFormat: CliOutputFormatterTypes.Raw,
791791
},
792792
);
@@ -831,7 +831,7 @@ describe('CliBusinessService', () => {
831831
status: CommandExecutionStatus.Success,
832832
},
833833
{
834-
command: 'set',
834+
command: 'set'.toUpperCase(),
835835
outputFormat: CliOutputFormatterTypes.Text,
836836
},
837837
);
@@ -868,7 +868,7 @@ describe('CliBusinessService', () => {
868868
status: CommandExecutionStatus.Fail,
869869
},
870870
{
871-
command: 'set',
871+
command: 'set'.toUpperCase(),
872872
outputFormat: CliOutputFormatterTypes.Raw,
873873
},
874874
);

redisinsight/api/src/modules/cli/services/cli-business/cli-business.service.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class CliBusinessService {
160160
this.cliAnalyticsService.sendCommandExecutedEvent(
161161
clientOptions.instanceId,
162162
{
163-
command,
163+
command: command.toUpperCase(),
164164
outputFormat,
165165
},
166166
);
@@ -177,14 +177,14 @@ export class CliBusinessService {
177177
|| error?.name === 'ReplyError'
178178
) {
179179
this.cliAnalyticsService.sendCommandErrorEvent(clientOptions.instanceId, error, {
180-
command,
180+
command: command.toUpperCase(),
181181
outputFormat,
182182
});
183183

184184
return { response: error.message, status: CommandExecutionStatus.Fail };
185185
}
186186
this.cliAnalyticsService.sendConnectionErrorEvent(clientOptions.instanceId, error, {
187-
command,
187+
command: command.toUpperCase(),
188188
outputFormat,
189189
});
190190

@@ -250,7 +250,7 @@ export class CliBusinessService {
250250
this.cliAnalyticsService.sendClusterCommandExecutedEvent(
251251
clientOptions.instanceId,
252252
nodeExecReply,
253-
{ command, outputFormat },
253+
{ command: command.toUpperCase(), outputFormat },
254254
);
255255
const {
256256
response, status, host, port,
@@ -266,7 +266,7 @@ export class CliBusinessService {
266266

267267
if (error instanceof CommandParsingError || error instanceof CommandNotSupportedError) {
268268
this.cliAnalyticsService.sendCommandErrorEvent(clientOptions.instanceId, error, {
269-
command,
269+
command: command.toUpperCase(),
270270
outputFormat,
271271
});
272272
return [
@@ -333,7 +333,7 @@ export class CliBusinessService {
333333
this.cliAnalyticsService.sendClusterCommandExecutedEvent(
334334
clientOptions.instanceId,
335335
result,
336-
{ command, outputFormat },
336+
{ command: command.toUpperCase(), outputFormat },
337337
);
338338
const {
339339
host, port, error, slot, ...rest
@@ -344,14 +344,14 @@ export class CliBusinessService {
344344

345345
if (error instanceof CommandParsingError || error instanceof CommandNotSupportedError) {
346346
this.cliAnalyticsService.sendCommandErrorEvent(clientOptions.instanceId, error, {
347-
command,
347+
command: command.toUpperCase(),
348348
outputFormat,
349349
});
350350
return { response: error.message, status: CommandExecutionStatus.Fail };
351351
}
352352

353353
this.cliAnalyticsService.sendConnectionErrorEvent(clientOptions.instanceId, error, {
354-
command,
354+
command: command.toUpperCase(),
355355
outputFormat,
356356
});
357357

redisinsight/api/src/modules/workbench/providers/workbench-commands.executor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class WorkbenchCommandsExecutor {
102102
this.analyticsService.sendCommandExecutedEvents(
103103
clientOptions.instanceId,
104104
result,
105-
{ command, rawMode: mode === RunQueryMode.Raw },
105+
{ command: command.toUpperCase(), rawMode: mode === RunQueryMode.Raw },
106106
);
107107

108108
return result;
@@ -113,7 +113,7 @@ export class WorkbenchCommandsExecutor {
113113
this.analyticsService.sendCommandExecutedEvent(
114114
clientOptions.instanceId,
115115
{ ...errorResult, error },
116-
{ command, rawMode: dto.mode === RunQueryMode.Raw },
116+
{ command: command.toUpperCase(), rawMode: dto.mode === RunQueryMode.Raw },
117117
);
118118

119119
if (

redisinsight/api/src/modules/workbench/services/workbench-analytics/workbench-analytics.service.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('WorkbenchAnalyticsService', () => {
9898
TelemetryEvents.WorkbenchCommandExecuted,
9999
{
100100
databaseId: instanceId,
101-
command: 'set',
101+
command: 'set'.toUpperCase(),
102102
commandType: CommandType.Core,
103103
moduleName: 'n/a',
104104
capability: 'string',
@@ -118,7 +118,7 @@ describe('WorkbenchAnalyticsService', () => {
118118
TelemetryEvents.WorkbenchCommandExecuted,
119119
{
120120
databaseId: instanceId,
121-
command: 'set',
121+
command: 'set'.toUpperCase(),
122122
commandType: CommandType.Core,
123123
moduleName: 'n/a',
124124
capability: 'string',
@@ -138,7 +138,7 @@ describe('WorkbenchAnalyticsService', () => {
138138
TelemetryEvents.WorkbenchCommandExecuted,
139139
{
140140
databaseId: instanceId,
141-
command: 'set',
141+
command: 'set'.toUpperCase(),
142142
},
143143
);
144144
});
@@ -153,7 +153,7 @@ describe('WorkbenchAnalyticsService', () => {
153153
TelemetryEvents.WorkbenchCommandExecuted,
154154
{
155155
databaseId: instanceId,
156-
command: 'bF.rEsErvE',
156+
command: 'bF.rEsErvE'.toUpperCase(),
157157
commandType: CommandType.Module,
158158
moduleName: 'redisbloom',
159159
capability: 'bf',
@@ -171,7 +171,7 @@ describe('WorkbenchAnalyticsService', () => {
171171
TelemetryEvents.WorkbenchCommandExecuted,
172172
{
173173
databaseId: instanceId,
174-
command: 'CUSTOM.COMMAnd',
174+
command: 'CUSTOM.COMMAnd'.toUpperCase(),
175175
commandType: CommandType.Module,
176176
moduleName: 'custommodule',
177177
capability: 'n/a',
@@ -189,7 +189,7 @@ describe('WorkbenchAnalyticsService', () => {
189189
TelemetryEvents.WorkbenchCommandExecuted,
190190
{
191191
databaseId: instanceId,
192-
command: 'some.command',
192+
command: 'some.command'.toUpperCase(),
193193
commandType: CommandType.Module,
194194
moduleName: 'custom',
195195
capability: 'n/a',
@@ -221,7 +221,7 @@ describe('WorkbenchAnalyticsService', () => {
221221
{
222222
databaseId: instanceId,
223223
error: ReplyError.name,
224-
command: 'set',
224+
command: 'set'.toUpperCase(),
225225
commandType: CommandType.Core,
226226
moduleName: 'n/a',
227227
capability: 'string',
@@ -240,7 +240,7 @@ describe('WorkbenchAnalyticsService', () => {
240240
{
241241
databaseId: instanceId,
242242
error: ReplyError.name,
243-
command: 'sadd',
243+
command: 'sadd'.toUpperCase(),
244244
},
245245
);
246246
});

redisinsight/api/src/modules/workbench/services/workbench-analytics/workbench-analytics.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class WorkbenchAnalyticsService extends CommandTelemetryBaseService {
8989
{
9090
databaseId,
9191
error: error.name,
92-
command: error?.command?.name,
92+
command: error?.command?.name?.toUpperCase(),
9393
...additionalData,
9494
},
9595
);

0 commit comments

Comments
 (0)