-
Notifications
You must be signed in to change notification settings - Fork 414
RI-6848: add info_command_is_disabled to analytics when INFO is disabled via ACL #4390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2a7ae5a
713a776
d4f4f14
b2d53dc
b7bdf81
d1d371b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import { DatabaseClientFactory } from 'src/modules/database/providers/database.c | |
| import { RedisClient, RedisClientConnectionType } from 'src/modules/redis/client'; | ||
| import { FeatureService } from 'src/modules/feature/feature.service'; | ||
| import { KnownFeatures } from 'src/modules/feature/constants'; | ||
| import { RedisDatabaseInfoResponse } from './dto/redis-info.dto'; | ||
|
|
||
| @Injectable() | ||
| export class DatabaseConnectionService { | ||
|
|
@@ -75,20 +76,23 @@ export class DatabaseConnectionService { | |
| ); | ||
| } | ||
|
|
||
| this.collectClientInfo(clientMetadata, client, generalInfo?.version); | ||
| this.collectClientInfo(clientMetadata, client, generalInfo); | ||
|
|
||
| this.logger.debug(`Succeed to connect to database ${clientMetadata.databaseId}`, clientMetadata); | ||
| } | ||
|
|
||
| private async collectClientInfo(clientMetadata: ClientMetadata, client: RedisClient, version?: string) { | ||
| private async collectClientInfo(clientMetadata: ClientMetadata, client: RedisClient, generalInfo: RedisDatabaseInfoResponse) { | ||
| try { | ||
| const version = generalInfo?.server?.redis_version; | ||
| const infoCommandIsDisabled = generalInfo?.server?.info_command_is_disabled; | ||
| const intVersion = parseInt(version, 10) || 0; | ||
| const clients = await this.databaseInfoProvider.getClientListInfo(client) || []; | ||
|
|
||
| this.analytics.sendDatabaseConnectedClientListEvent( | ||
| clientMetadata.sessionMetadata, | ||
| clientMetadata.databaseId, | ||
| { | ||
| databaseId: clientMetadata.databaseId, | ||
| ...(infoCommandIsDisabled ? { info_command_is_disabled: true } : {}), | ||
|
||
| clients: clients.map((c) => ({ | ||
| version: version || 'n/a', | ||
| resp: intVersion < 7 ? undefined : c?.['resp'] || 'n/a', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.