Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<PackageVersion Include="ReactiveUI.WPF" Version="20.1.63" />
<PackageVersion Include="ServiceControl.Contracts" Version="5.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="9.0.2" />
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="8.0.1" />
<PackageVersion Include="System.DirectoryServices.AccountManagement" Version="8.0.1" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
Expand Down
9 changes: 5 additions & 4 deletions src/ServiceControl.Audit/Auditing/Metrics/IngestionMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public IngestionMetrics(IMeterFactory meterFactory)

batchDuration = meter.CreateHistogram<double>(BatchDurationInstrumentName, unit: "seconds", "Message batch processing duration in seconds");
ingestionDuration = meter.CreateHistogram<double>(MessageDurationInstrumentName, unit: "seconds", description: "Audit message processing duration in seconds");
consecutiveBatchFailureGauge = meter.CreateGauge<long>($"{InstrumentPrefix}.consecutive_batch_failure_total", description: "Consecutive audit ingestion batch failure");
consecutiveBatchFailureGauge = meter.CreateObservableGauge($"{InstrumentPrefix}.consecutive_batch_failure_total", () => consecutiveBatchFailures, description: "Consecutive audit ingestion batch failure");
failureCounter = meter.CreateCounter<long>($"{InstrumentPrefix}.failures_total", description: "Audit ingestion failure count");
}

Expand Down Expand Up @@ -56,14 +56,15 @@ void RecordBatchOutcome(bool success)
{
consecutiveBatchFailures++;
}

consecutiveBatchFailureGauge.Record(consecutiveBatchFailures);
}

long consecutiveBatchFailures;

readonly Histogram<double> batchDuration;
readonly Gauge<long> consecutiveBatchFailureGauge;
#pragma warning disable IDE0052
// this can be changed to Gauge<T> once we can use the latest version of System.Diagnostics.DiagnosticSource
readonly ObservableGauge<long> consecutiveBatchFailureGauge;
#pragma warning restore IDE0052
readonly Histogram<double> ingestionDuration;
readonly Counter<long> failureCounter;

Expand Down
1 change: 0 additions & 1 deletion src/ServiceControl.Audit/ServiceControl.Audit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<PackageReference Include="OpenTelemetry.Exporter.Console" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
</ItemGroup>

<ItemGroup>
Expand Down