Skip to content

Commit d6cc543

Browse files
Merge branch 'main' of https://github.com/RedisInsight/RedisInsight into feature/RI-4616-rdi-support
2 parents 3fbe4f3 + 35fbfc6 commit d6cc543

File tree

28 files changed

+588
-246
lines changed

28 files changed

+588
-246
lines changed

redisinsight/api/config/default.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export default {
100100
retryTimes: parseInt(process.env.RI_CLIENTS_RETRY_TIMES, 10) || 3,
101101
retryDelay: parseInt(process.env.RI_CLIENTS_RETRY_DELAY, 10) || 500,
102102
maxRetriesPerRequest: parseInt(process.env.RI_CLIENTS_MAX_RETRIES_PER_REQUEST, 10) || 1,
103+
slotsRefreshTimeout: parseInt(process.env.RI_CLIENTS_SLOTS_REQUEST_TIMEOUT, 10) || 5000,
103104
},
104105
redis_scan: {
105106
countDefault: parseInt(process.env.RI_SCAN_COUNT_DEFAULT, 10) || 200,

redisinsight/api/config/features-config.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": 2.5201,
2+
"version": 2.52,
33
"features": {
44
"rdi": {
55
"flag": true,
@@ -16,6 +16,28 @@
1616
"flag": true,
1717
"perc": [[0,100]]
1818
},
19+
"documentationChat": {
20+
"flag": true,
21+
"perc": [[0,5]],
22+
"filters": [
23+
{
24+
"name": "config.server.buildType",
25+
"value": "ELECTRON",
26+
"cond": "eq"
27+
}
28+
]
29+
},
30+
"databaseChat": {
31+
"flag": true,
32+
"perc": [[0,5]],
33+
"filters": [
34+
{
35+
"name": "config.server.buildType",
36+
"value": "ELECTRON",
37+
"cond": "eq"
38+
}
39+
]
40+
},
1941
"cloudSso": {
2042
"flag": true,
2143
"perc": [[0,100]],

redisinsight/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"@nestjs/typeorm": "^9.0.1",
5757
"@nestjs/websockets": "^10.3.7",
5858
"@okta/okta-auth-js": "^7.3.0",
59+
"@segment/analytics-node": "^2.1.2",
5960
"adm-zip": "^0.5.9",
60-
"analytics-node": "^4.0.1",
6161
"axios": "^1.6.0",
6262
"body-parser": "^1.19.0",
6363
"busboy": "^1.6.0",

redisinsight/api/src/constants/telemetry-events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export enum TelemetryEvents {
8989
FeatureFlagRecalculated = 'FEATURE_FLAG_RECALCULATED',
9090

9191
// Insights
92-
InsightsRecommendationGenerated = 'INSIGHTS_RECOMMENDATION_GENERATED',
92+
InsightsTipGenerated = 'INSIGHTS_TIP_GENERATED',
9393

9494
// RDI
9595
RdiInstanceDeleted = 'RDI_INSTANCE_DELETED',

redisinsight/api/src/modules/analytics/analytics.service.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ import {
1717
let mockAnalyticsTrack;
1818
let mockAnalyticsPage;
1919
jest.mock(
20-
'analytics-node',
21-
() => jest.fn()
22-
.mockImplementation(() => ({
20+
'@segment/analytics-node',
21+
() => ({
22+
Analytics: jest.fn().mockImplementation(() => ({
2323
track: mockAnalyticsTrack,
2424
page: mockAnalyticsPage,
2525
})),
26+
}),
2627
);
2728

2829
const mockAnonymousId = 'a77b23c1-7816-4ea4-b61f-d37795a0f805';

redisinsight/api/src/modules/analytics/analytics.service.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Injectable } from '@nestjs/common';
22
import { OnEvent } from '@nestjs/event-emitter';
33
import { get } from 'lodash';
4-
import * as Analytics from 'analytics-node';
4+
import { Analytics } from '@segment/analytics-node';
55
import { AppAnalyticsEvents } from 'src/constants';
66
import config from 'src/utils/config';
7+
import axios from 'axios';
78
import { SettingsService } from 'src/modules/settings/settings.service';
89

910
export const NON_TRACKING_ANONYMOUS_ID = '00000000-0000-0000-0000-000000000001';
@@ -65,8 +66,14 @@ export class AnalyticsService {
6566
this.controlGroup = controlGroup;
6667
this.appVersion = appVersion;
6768
this.controlNumber = controlNumber;
68-
this.analytics = new Analytics(ANALYTICS_CONFIG.writeKey, {
69+
this.analytics = new Analytics({
70+
writeKey: ANALYTICS_CONFIG.writeKey,
6971
flushInterval: ANALYTICS_CONFIG.flushInterval,
72+
httpClient: (url, requestInit) => axios.request({
73+
...requestInit,
74+
url,
75+
data: requestInit.body,
76+
}),
7077
});
7178
}
7279

redisinsight/api/src/modules/database-recommendation/database-recommendation.analytics.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('DatabaseRecommendationAnalytics', () => {
3636
);
3737

3838
expect(sendEventSpy).toHaveBeenCalledWith(
39-
TelemetryEvents.InsightsRecommendationGenerated,
39+
TelemetryEvents.InsightsTipGenerated,
4040
{
4141
recommendationName: mockDatabaseRecommendation.name,
4242
databaseId: mockDatabase.id,

redisinsight/api/src/modules/database-recommendation/database-recommendation.analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class DatabaseRecommendationAnalytics extends TelemetryBaseService {
1414
sendCreatedRecommendationEvent(recommendation: DatabaseRecommendation, database: Database): void {
1515
try {
1616
this.sendEvent(
17-
TelemetryEvents.InsightsRecommendationGenerated,
17+
TelemetryEvents.InsightsTipGenerated,
1818
{
1919
recommendationName: recommendation.name,
2020
databaseId: database.id,

redisinsight/api/src/modules/database/entities/database.entity.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import { CloudDatabaseDetailsEntity } from 'src/modules/cloud/database/entities/
1212
export enum HostingProvider {
1313
RE_CLUSTER = 'RE_CLUSTER',
1414
RE_CLOUD = 'RE_CLOUD',
15-
REDIS_MANAGED = 'REDIS_MANAGED',
15+
REDIS_STACK = 'REDIS_STACK',
16+
REDIS_ENTERPRISE = 'REDIS_ENTERPRISE',
1617
AZURE_CACHE = 'AZURE_CACHE',
1718
AZURE_CACHE_REDIS_ENTERPRISE = 'AZURE_CACHE_REDIS_ENTERPRISE',
18-
COMMUNITY_EDITION = 'COMMUNITY_EDITION',
19+
REDIS_COMMUNITY_EDITION = 'REDIS_COMMUNITY_EDITION',
1920
AWS_ELASTICACHE = 'AWS_ELASTICACHE',
2021
AWS_MEMORYDB = 'AWS_MEMORYDB',
2122
VALKEY = 'VALKEY',
@@ -26,6 +27,7 @@ export enum HostingProvider {
2627
KVROCKS = 'KVROCKS',
2728
REDICT = 'REDICT',
2829
UPSTASH = 'UPSTASH',
30+
UNKNOWN_LOCALHOST = 'UNKNOWN_LOCALHOST',
2931
UNKNOWN = 'UNKNOWN',
3032
}
3133

redisinsight/api/src/modules/profiler/models/profiler.client.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ export class ProfilerClient {
4343
time, args, source, database,
4444
} = payload;
4545

46+
// If there's [ in the time, strip it out.
47+
//
48+
// There is a case of a timestamp coming with '[' on Alibaba
49+
// Redis's monitor.
50+
const newTime = time.split('[')[0];
51+
4652
this.items.push({
47-
time, args, source, database,
53+
time: newTime, args, source, database,
4854
});
4955

5056
this.debounce();

0 commit comments

Comments
 (0)