Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/otel-metrics' into fix-hanging-i…
Browse files Browse the repository at this point in the history
…ngestion
  • Loading branch information
ramonsmits committed Jan 31, 2025
2 parents 58043ae + b986142 commit eb85f65
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
<GlobalPackageReference Include="Microsoft.Build.CopyOnWrite" Version="1.0.334" />
<GlobalPackageReference Include="Particular.Packaging" Version="4.2.0" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ApiUrl": "http://localhost:8888/api",
"Port": 8888,
"PrintMetrics": false,
"OtelMetricsUrl": null,
"Hostname": "localhost",
"VirtualDirectory": "",
"TransportType": "LearningTransport",
Expand Down
1 change: 0 additions & 1 deletion src/ServiceControl.Audit/Auditing/AuditIngestion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ async Task EnsureStopped(CancellationToken cancellationToken = default)
logger.Info("Shutting down. Already stopped, skipping shut down");
return; //Already stopped
}

var stoppable = queueIngestor;
queueIngestor = null;
logger.Info("Shutting down. Infrastructure shut down commencing");
Expand Down
8 changes: 6 additions & 2 deletions src/ServiceControl.Audit/Auditing/AuditIngestor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Infrastructure.Settings;
Expand Down Expand Up @@ -42,7 +41,12 @@ ITransportCustomization transportCustomization

logQueueAddress = transportCustomization.ToTransportQualifiedQueueName(settings.AuditLogQueue);

auditPersister = new AuditPersister(unitOfWorkFactory, enrichers, messageSession, messageDispatcher);
auditPersister = new AuditPersister(
unitOfWorkFactory,
enrichers,
messageSession,
messageDispatcher
);
}

public async Task Ingest(List<MessageContext> contexts)
Expand Down
5 changes: 0 additions & 5 deletions src/ServiceControl.Audit/Auditing/AuditPersister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ public async Task<IReadOnlyList<MessageContext>> Persist(IReadOnlyList<MessageCo

var auditSw = Stopwatch.StartNew();
await unitOfWork.RecordProcessedMessage(processedMessage, context.Body);
auditSw.Stop();

auditBulkInsertDurationMeter.Record(auditSw.ElapsedMilliseconds);

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

var sagaSw = Stopwatch.StartNew();
await unitOfWork.RecordSagaSnapshot(sagaSnapshot);
sagaSw.Stop();

sagaAuditBulkInsertDurationMeter.Record(sagaSw.ElapsedMilliseconds);

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

0 comments on commit eb85f65

Please sign in to comment.