Tag all Valkey/Redis connections with service-specific ClientName

Set ClientName on every Redis/Valkey connection across Scanner, Signals,
Concelier, Notify, Scheduler, Timeline, and Router for easier connection
attribution in monitoring.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-04-06 08:51:27 +03:00
parent ccdfd41e4f
commit 4d82c346e3
26 changed files with 47 additions and 16 deletions

View File

@@ -13,6 +13,7 @@ internal sealed class RedisConnectionFactory : IRedisConnectionFactory
public async ValueTask<IConnectionMultiplexer> ConnectAsync(ConfigurationOptions options, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(options);
options.ClientName ??= "stellaops-scanner-events";
var connectTask = ConnectionMultiplexer.ConnectAsync(options);
var connection = await connectTask.WaitAsync(cancellationToken).ConfigureAwait(false);
return connection;

View File

@@ -5,6 +5,7 @@ Source of truth: `docs/implplan/SPRINT_20260112_003_BE_csproj_audit_pending_appl
| Task ID | Status | Notes |
| --- | --- | --- |
| SPRINT_20260405_011-XPORT-VALKEY | DONE | `docs/implplan/SPRINT_20260405_011___Libraries_transport_pooling_and_attribution_hardening.md`: named the scanner webservice event Valkey client construction path. |
| QA-SCANNER-VERIFY-008 | DONE | `SPRINT_20260212_002_Scanner_unchecked_feature_verification_batch1.md`: verified entry-trace response contract carries `graph.binaryIntelligence` for scanner binary intelligence feature (run-002, 2026-02-12). |
| TODO-WEB-001 | TODO | Load tenant-specific policy configuration in `src/Scanner/StellaOps.Scanner.WebService/Services/VexGateQueryService.cs`. |
| TODO-WEB-002 | TODO | Implement CAS retrieval for slices in `src/Scanner/StellaOps.Scanner.WebService/Services/SliceQueryService.cs`. |

View File

@@ -209,6 +209,7 @@ public sealed class ValkeyCallGraphCacheService : ICallGraphCacheService, IAsync
}
var config = ConfigurationOptions.Parse(_options.ConnectionString);
config.ClientName ??= "stellaops-scanner-callgraph-cache";
_connection = await _connectionFactory(config).ConfigureAwait(false);
return _connection;
}
@@ -240,4 +241,3 @@ public sealed class ValkeyCallGraphCacheService : ICallGraphCacheService, IAsync
return output.ToArray();
}
}

View File

@@ -4,5 +4,6 @@ Source of truth: `docs/implplan/SPRINT_20260130_002_Tools_csproj_remediation_sol
| Task ID | Status | Notes |
| --- | --- | --- |
| SPRINT_20260405_011-XPORT-VALKEY | DONE | `docs/implplan/SPRINT_20260405_011___Libraries_transport_pooling_and_attribution_hardening.md`: named scanner call-graph cache Valkey client construction. |
| REMED-05 | TODO | Remediation checklist: docs/implplan/audits/csproj-standards/remediation/checklists/src/Scanner/__Libraries/StellaOps.Scanner.CallGraph/StellaOps.Scanner.CallGraph.md. |
| REMED-06 | DONE | SOLID review notes captured for SPRINT_20260130_002. |

View File

@@ -502,6 +502,7 @@ internal sealed class RedisScanQueue : IScanQueue, IAsyncDisposable
config.AbortOnConnectFail = false;
config.ConnectTimeout = (int)_options.InitializationTimeout.TotalMilliseconds;
config.ConnectRetry = 3;
config.ClientName ??= "stellaops-scanner-queue";
if (_options.Database is not null)
{
config.DefaultDatabase = _options.Database;

View File

@@ -4,5 +4,6 @@ Source of truth: `docs/implplan/SPRINT_20260130_002_Tools_csproj_remediation_sol
| Task ID | Status | Notes |
| --- | --- | --- |
| SPRINT_20260405_011-XPORT-VALKEY | DONE | `docs/implplan/SPRINT_20260405_011___Libraries_transport_pooling_and_attribution_hardening.md`: named scanner queue Valkey client construction. |
| REMED-05 | TODO | Remediation checklist: docs/implplan/audits/csproj-standards/remediation/checklists/src/Scanner/__Libraries/StellaOps.Scanner.Queue/StellaOps.Scanner.Queue.md. |
| REMED-06 | DONE | SOLID review notes captured for SPRINT_20260130_002. |