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.
System.Diagnostics.DiagnosticSource
System Library
| Author | Microsoft |
| Version | 10.0.1 |
| Tags |
Public Types
System.​Diagnostics
class Activity
Represents an operation with context to be used for logging.
struct ActivityChangedEventArgs
Provides data for the <see cref="E:System.Diagnostics.Activity.CurrentChanged" /> event.
struct ActivityContext
A representation that conforms to the W3C TraceContext specification. It contains two identifiers: a TraceId and a SpanId, along with a set of common TraceFlags and system-specific TraceState values.
struct ActivityCreationOptions<​T>
Encapsulates all the information that is sent to the activity listener, to make decisions about the creation of the activity instance, as well as its state.
The possible generic type parameters are <see cref="T:System.Diagnostics.ActivityContext" /> or <see cref="T:System.String" /> .
struct ActivityEvent
Represents an event containing a name and a timestamp, as well as an optional list of tags.
enum ActivityIdFormat
Specifies the format of the <see cref="P:System.Diagnostics.Activity.Id" /> property.
enum ActivityKind
Describes the relationship between the activity, its parents and its children in a trace.
struct ActivityLink
Activities may be linked to zero or more activity context instances that are causally related.
Activity links can point to activity contexts inside a single trace or across different traces.
Activity links can be used to represent batched operations where an activity was initiated by multiple initiating activities, each representing a single incoming item being processed in the batch.
class ActivityListener
Allows listening to the start and stop activity events and gives the opportunity to decide creating an activity for sampling scenarios.
Enumeration values used by <see cref="T:System.Diagnostics.ActivityListener" /> to indicate the amount of data to collect for the related <see cref="T:System.Diagnostics.Activity" /> . Requesting more data causes a greater performance overhead.
class ActivitySource
Provides APIs to create and start <see cref="T:System.Diagnostics.Activity" /> objects and to register <see cref="T:System.Diagnostics.ActivityListener" /> objects to listen to the <see cref="T:System.Diagnostics.Activity" /> events.
class ActivitySourceOptions
Options for creating an <see cref="T:System.Diagnostics.ActivitySource" /> .
struct ActivitySpanId
Represents a <see cref="P:System.Diagnostics.Activity.SpanId" /> formatted based on a W3C standard.
enum ActivityStatusCode
Define the status code of the Activity which indicate the status of the instrumented operation.
class ActivityTagsCollection
ActivityTagsCollection is a collection class used to store tracing tags.
This collection will be used with classes like <see cref="T:System.Diagnostics.ActivityEvent" /> and <see cref="T:System.Diagnostics.ActivityLink" /> .
This collection behaves as follows:
- The collection items will be ordered according to how they are added.
- Don't allow duplication of items with the same key.
- When using the indexer to store an item in the collection:
- If the item has a key that previously existed in the collection and the value is <see langword="null" /> , the collection item matching the key will be removed from the collection.
- If the item has a key that previously existed in the collection and the value is not <see langword="null" /> , the new item value will replace the old value stored in the collection.
- Otherwise, the item will be added to the collection.
- Add method will add a new item to the collection if an item doesn't already exist with the same key. Otherwise, it will throw an exception.
enum ActivityTraceFlags
Specifies flags defined by the W3C standard that are associated with an activity.
struct ActivityTraceId
Represents a <see cref="P:System.Diagnostics.Activity.TraceId" /> whose format is based on a W3C standard.
class DiagnosticListener
Provides an implementation of the abstract <see cref="T:System.Diagnostics.DiagnosticSource" /> class that represents a named place to which a source sends its information (events).
class DiagnosticSource
An abstract class that allows code to be instrumented for production-time logging of rich data payloads for consumption within the process that was instrumented.
An implementation of <see cref="T:System.Diagnostics.DistributedContextPropagator" /> determines if and how distributed context information is encoded and decoded as it traverses the network.
The encoding can be transported over any network protocol that supports string key-value pairs. For example, when using HTTP, each key-value pair is an HTTP header.
<see cref="T:System.Diagnostics.DistributedContextPropagator" /> injects values into and extracts values from carriers as string key-value pairs.
class ExceptionRecorder
Defines the callback to be used in <see cref="T:System.Diagnostics.ActivityListener" /> to receive notifications when exceptions are added to the <see cref="T:System.Diagnostics.Activity" /> .
class SampleActivity<​T>
A delegate that defines the signature of the <see cref="T:System.Diagnostics.ActivityListener" /> callbacks used in the sampling process.
struct TagList
Represents a list of tags that can be accessed by index. Provides methods to search, sort, and manipulate lists.
System.​Diagnostics.​Metrics
class Counter<​T>
Represents an instrument that supports adding non-negative values. For example, you might call <c>counter.Add(1)</c> each time a request is processed to track the total number of requests. Most metric viewers display counters using a rate (requests/sec), by default, but can also display a cumulative total.
class Gauge<​T>
The Gauge is an instrument used to record non-additive values whenever changes occur. For example, record the room background noise level value when changes occur.
class Histogram<​T>
Represents a metrics instrument that can be used to report arbitrary values that are likely to be statistically meaningful, for example, the request duration. Call <see cref="M:System.Diagnostics.Metrics.Meter.CreateHistogram``1(System.String,System.String,System.String)" /> to create a Histogram object.
interface IMeterFactory
A factory for creating <see cref="T:System.Diagnostics.Metrics.Meter" /> instances.
class Instrument
Base class of all metrics instrument classes
class Instrument<​T>
The base class for all non-observable instruments.
class InstrumentAdvice<​T>
Contains configuration settings advised to be used by metrics consumers when recording measurements for a given <see cref="T:System.Diagnostics.Metrics.Instrument`1" /> .
struct Measurement<​T>
Stores one observed metrics value and its associated tags. This type is used by an Observable instrument's Observe() method when reporting current measurements.
class MeasurementCallback<​T>
A delegate to represent the Meterlistener callbacks that are used when recording measurements.
class Meter
Meter is the class responsible for creating and tracking the Instruments.
class MeterFactoryExtensions
Extension methods for <see cref="T:System.Diagnostics.Metrics.Meter" /> and <see cref="T:System.Diagnostics.Metrics.IMeterFactory" /> .
class MeterListener
The MeterListener is class used to listen to the metrics instrument measurements recording.
class MeterOptions
The options for creating a <see cref="T:System.Diagnostics.Metrics.Meter" /> .
class ObservableCounter<​T>
Represents a metrics-observable instrument that reports monotonically increasing values when the instrument is being observed, for example, CPU time (for different processes, threads, user mode, or kernel mode). Call <see cref="Overload:System.Diagnostics.Metrics.Meter.CreateObservableCounter" /> to create the observable counter object.
class ObservableGauge<​T>
Represents an observable instrument that reports non-additive values when the instrument is being observed, for example, the current room temperature. Call <see cref="Overload:System.Diagnostics.Metrics.Meter.CreateObservableGauge" /> to create the observable counter object.
class ObservableInstrument<​T>
ObservableInstrument{T} is the base class from which all metrics observable instruments will inherit.
class ObservableUpDownCounter<​T>
A metrics-observable instrument that reports increasing or decreasing values when the instrument is being observed.
Use this instrument to monitor the process heap size or the approximate number of items in a lock-free circular buffer, for example.
To create an ObservableUpDownCounter object, use the <see cref="Overload:System.Diagnostics.Metrics.Meter.CreateObservableUpDownCounter" /> methods.
class UpDownCounter<​T>
An instrument that supports reporting positive or negative metric values.
UpDownCounter may be used in scenarios like reporting the change in active requests or queue size.