Skip to content

Commit 1b18575

Browse files
authored
Merge branch 'master' into john/range
2 parents a13d171 + 037ef3b commit 1b18575

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/Directory.Packages.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
<PackageVersion Include="ReactiveUI.WPF" Version="20.1.63" />
6565
<PackageVersion Include="ServiceControl.Contracts" Version="5.0.0" />
6666
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
67-
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="9.0.2" />
6867
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="8.0.1" />
6968
<PackageVersion Include="System.DirectoryServices.AccountManagement" Version="8.0.1" />
7069
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />

src/ServiceControl.Audit/Auditing/Metrics/IngestionMetrics.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public IngestionMetrics(IMeterFactory meterFactory)
2020

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

@@ -56,14 +56,15 @@ void RecordBatchOutcome(bool success)
5656
{
5757
consecutiveBatchFailures++;
5858
}
59-
60-
consecutiveBatchFailureGauge.Record(consecutiveBatchFailures);
6159
}
6260

6361
long consecutiveBatchFailures;
6462

6563
readonly Histogram<double> batchDuration;
66-
readonly Gauge<long> consecutiveBatchFailureGauge;
64+
#pragma warning disable IDE0052
65+
// this can be changed to Gauge<T> once we can use the latest version of System.Diagnostics.DiagnosticSource
66+
readonly ObservableGauge<long> consecutiveBatchFailureGauge;
67+
#pragma warning restore IDE0052
6768
readonly Histogram<double> ingestionDuration;
6869
readonly Counter<long> failureCounter;
6970

src/ServiceControl.Audit/ServiceControl.Audit.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<PackageReference Include="OpenTelemetry.Exporter.Console" />
3333
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
3434
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
35-
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
3635
</ItemGroup>
3736

3837
<ItemGroup>

0 commit comments

Comments
 (0)