Skip to content

Commit eb85f65

Browse files
committed
Merge remote-tracking branch 'origin/otel-metrics' into fix-hanging-ingestion
2 parents 58043ae + b986142 commit eb85f65

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@
9191
<GlobalPackageReference Include="Microsoft.Build.CopyOnWrite" Version="1.0.334" />
9292
<GlobalPackageReference Include="Particular.Packaging" Version="4.2.0" />
9393
</ItemGroup>
94-
</Project>
94+
</Project>

src/ServiceControl.Audit.UnitTests/ApprovalFiles/APIApprovals.PlatformSampleSettings.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"ApiUrl": "http://localhost:8888/api",
1313
"Port": 8888,
1414
"PrintMetrics": false,
15+
"OtelMetricsUrl": null,
1516
"Hostname": "localhost",
1617
"VirtualDirectory": "",
1718
"TransportType": "LearningTransport",

src/ServiceControl.Audit/Auditing/AuditIngestion.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ async Task EnsureStopped(CancellationToken cancellationToken = default)
162162
logger.Info("Shutting down. Already stopped, skipping shut down");
163163
return; //Already stopped
164164
}
165-
166165
var stoppable = queueIngestor;
167166
queueIngestor = null;
168167
logger.Info("Shutting down. Infrastructure shut down commencing");

src/ServiceControl.Audit/Auditing/AuditIngestor.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
using System;
44
using System.Collections.Generic;
5-
using System.Diagnostics;
65
using System.Linq;
76
using System.Threading.Tasks;
87
using Infrastructure.Settings;
@@ -42,7 +41,12 @@ ITransportCustomization transportCustomization
4241

4342
logQueueAddress = transportCustomization.ToTransportQualifiedQueueName(settings.AuditLogQueue);
4443

45-
auditPersister = new AuditPersister(unitOfWorkFactory, enrichers, messageSession, messageDispatcher);
44+
auditPersister = new AuditPersister(
45+
unitOfWorkFactory,
46+
enrichers,
47+
messageSession,
48+
messageDispatcher
49+
);
4650
}
4751

4852
public async Task Ingest(List<MessageContext> contexts)

src/ServiceControl.Audit/Auditing/AuditPersister.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ public async Task<IReadOnlyList<MessageContext>> Persist(IReadOnlyList<MessageCo
7373

7474
var auditSw = Stopwatch.StartNew();
7575
await unitOfWork.RecordProcessedMessage(processedMessage, context.Body);
76-
auditSw.Stop();
77-
7876
auditBulkInsertDurationMeter.Record(auditSw.ElapsedMilliseconds);
7977

8078
ingestedAuditMeter.Add(1);
@@ -85,8 +83,6 @@ public async Task<IReadOnlyList<MessageContext>> Persist(IReadOnlyList<MessageCo
8583

8684
var sagaSw = Stopwatch.StartNew();
8785
await unitOfWork.RecordSagaSnapshot(sagaSnapshot);
88-
sagaSw.Stop();
89-
9086
sagaAuditBulkInsertDurationMeter.Record(sagaSw.ElapsedMilliseconds);
9187

9288
ingestedSagaAuditMeter.Add(1);
@@ -120,7 +116,6 @@ public async Task<IReadOnlyList<MessageContext>> Persist(IReadOnlyList<MessageCo
120116
// this can throw even though dispose is never supposed to throw
121117
var commitSw = Stopwatch.StartNew();
122118
await unitOfWork.DisposeAsync();
123-
commitSw.Stop();
124119
bulkInsertCommitDurationMeter.Record(commitSw.ElapsedMilliseconds);
125120
}
126121
catch (Exception e)

0 commit comments

Comments
 (0)