Skip to content

Commit

Permalink
Emit body size
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasohlund committed Feb 3, 2025
1 parent 88d2e71 commit da4c35b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ServiceControl.Audit/Auditing/AuditIngestion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ async Task Loop()
while (channel.Reader.TryRead(out var context))
{
contexts.Add(context);
auditMessageSize.Record(context.Body.Length / 1024.0);
}

auditBatchSize.Record(contexts.Count);
Expand Down Expand Up @@ -258,6 +259,7 @@ async Task Loop()
readonly Channel<MessageContext> channel;
readonly Histogram<long> auditBatchSize = AuditMetrics.Meter.CreateHistogram<long>($"{AuditMetrics.Prefix}.batch_size_audits");
readonly Histogram<double> auditBatchDuration = AuditMetrics.Meter.CreateHistogram<double>($"{AuditMetrics.Prefix}.batch_duration_audits", unit: "ms");
readonly Histogram<double> auditMessageSize = AuditMetrics.Meter.CreateHistogram<double>($"{AuditMetrics.Prefix}.audit_message_size", unit: "kilobytes");
readonly Counter<long> receivedAudits = AuditMetrics.Meter.CreateCounter<long>($"{AuditMetrics.Prefix}.received_audits");
readonly Watchdog watchdog;
readonly Task ingestionWorker;
Expand Down

0 comments on commit da4c35b

Please sign in to comment.