Skip to content

Conversation

@harsimar
Copy link
Member

Saving the current state of perf counters implementation. Implements five performance counters, tests not implemented yet.

@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Sep 17, 2025
/// <returns>The new value after incrementing.</returns>
public long IncrementRequestCount()
{
return Interlocked.Increment(ref _totalRequestCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request rate should be derived from http.server.request.duration metrics by taking the histogram count and dividing by 60 (the aggregation window) to get requests per second.

/// <returns>The new value after incrementing.</returns>
public long IncrementExceptionCount()
{
return Interlocked.Increment(ref _totalExceptionCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception rate should be derived from process.runtime.dotnet.exceptions.count metrics from the System.Runtime meter by calculating count / 60 to get exceptions per second.

description: "Request rate gauge (req/sec)");

_processCpuGauge = _perfCounterMeter.CreateObservableGauge(
PerfCounterConstants.ProcessCpuInstrumentName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
_meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter(StandardMetricConstants.StandardMetricMeterName)
.AddMeter(PerfCounterConstants.PerfCounterMeterName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be wired with customer's meter provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants