Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
interface Microsoft.​Extensions.​Diagnostics.​Metrics.​IMetricsListener
Assembly: Microsoft.Extensions.Diagnostics.Abstractions
Listens to metrics emitted from the system.
Properties
string
Name
Gets the name of the listener. This is used to identify the listener in the rules configuration.
Methods
void
Initialize​(IObservableInstrumentsSource source)
Called once by the runtime to provide a <see cref="T:Microsoft.Extensions.Diagnostics.Metrics.IObservableInstrumentsSource" /> used to pull for fresh metrics data.
source
A <see cref="T:Microsoft.Extensions.Diagnostics.Metrics.IObservableInstrumentsSource" /> that can be called to request current metrics.
bool
InstrumentPublished​(System.​Diagnostics.​Metrics.​Instrument instrument,
System.​Object&? userState)
void
MeasurementsCompleted​(System.​Diagnostics.​Metrics.​Instrument instrument,
object userState)
Called when a instrument is disabled by the producer or a rules change.
instrument
The <see cref="T:System.Diagnostics.Metrics.Instrument" /> being disabled.
userState
The original listener state returned by <see cref="M:Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener.InstrumentPublished(System.Diagnostics.Metrics.Instrument,System.Object@)" /> .
GetMeasurementHandlers​()
Called once to get the <see cref="T:Microsoft.Extensions.Diagnostics.Metrics.MeasurementHandlers" /> that will be used to process measurements.
Returns The <see cref="T:Microsoft.Extensions.Diagnostics.Metrics.MeasurementHandlers" /> .