OpenTelemetry Enumeration used to define the result of an export operation. Export succeeded. Export failed. Exporter base class. The type of object to be exported. Gets the parent . Exports a batch of telemetry objects. Batch of telemetry objects to export. Result of the export operation. Flushes the exporter, blocks the current thread until flush completed, shutdown signaled or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when flush succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Attempts to shutdown the exporter, blocks the current thread until shutdown completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Only the first call will win, subsequent calls will be no-op. Called by ForceFlush. This function should block the current thread until flush completed, shutdown signaled or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when flush succeeded; otherwise, false. This function is called synchronously on the thread which called ForceFlush. This function should be thread-safe, and should not throw exceptions. Called by Shutdown. This function should block the current thread until shutdown completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. This function is called synchronously on the thread which made the first call to Shutdown. This function should not throw exceptions. Releases the unmanaged resources used by this class and optionally releases the managed resources. to release both managed and unmanaged resources; to release only unmanaged resources. Type of Export Processor to be used. Use SimpleExportProcessor. Refer to the specification for more information. Use BatchExportProcessor. Refer to specification for more information. Implements processor that exports telemetry objects. The type of telemetry object to be exported. Gets the exporter used by the processor. Initializes a new instance of the class. Exporter instance. Called synchronously when a telemetry object is exported. The exported telemetry object. This function is called synchronously on the thread which ended the telemetry object. This function should be thread-safe, and should not block indefinitely or throw exceptions. Base processor base class. The type of object to be processed. Initializes a new instance of the class. Gets the parent . Gets or sets the weight of the processor when added to the provider pipeline. Default value: 0. Note: Weight is used to order processors when building a provider pipeline. Lower weighted processors come before higher weighted processors. Changing the weight after a pipeline has been constructed has no effect. Called synchronously when a telemetry object is started. The started telemetry object. This function is called synchronously on the thread which started the telemetry object. This function should be thread-safe, and should not block indefinitely or throw exceptions. Called synchronously when a telemetry object is ended. The ended telemetry object. This function is called synchronously on the thread which ended the telemetry object. This function should be thread-safe, and should not block indefinitely or throw exceptions. Flushes the processor, blocks the current thread until flush completed, shutdown signaled or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when flush succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Attempts to shutdown the processor, blocks the current thread until shutdown completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Only the first call will win, subsequent calls will be no-op. Called by ForceFlush. This function should block the current thread until flush completed, shutdown signaled or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when flush succeeded; otherwise, false. This function is called synchronously on the thread which called ForceFlush. This function should be thread-safe, and should not throw exceptions. Called by Shutdown. This function should block the current thread until shutdown completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. This function is called synchronously on the thread which made the first call to Shutdown. This function should not throw exceptions. Releases the unmanaged resources used by this class and optionally releases the managed resources. to release both managed and unmanaged resources; to release only unmanaged resources. Stores a batch of completed objects to be exported. The type of object in the . Initializes a new instance of the struct. The items to store in the batch. The number of items in the batch. Initializes a new instance of the struct. The item to store in the batch. Gets the count of items in the batch. Returns an enumerator that iterates through the . . Enumerates the elements of a . Implements processor that batches telemetry objects before calling exporter. The type of telemetry object to be exported. Initializes a new instance of the class. Exporter instance. The maximum queue size. After the size is reached data are dropped. The default value is 2048. The delay interval in milliseconds between two consecutive exports. The default value is 5000. How long the export can run before it is cancelled. The default value is 30000. The maximum batch size of every export. It must be smaller or equal to maxQueueSize. The default value is 512. Gets the number of telemetry objects dropped by the processor. Gets the number of telemetry objects received by the processor. Gets the number of telemetry objects processed by the underlying exporter. Contains batch export processor options. The type of telemetry object to be exported. Gets or sets the maximum queue size. The queue drops the data if the maximum size is reached. The default value is 2048. Gets or sets the delay interval (in milliseconds) between two consecutive exports. The default value is 5000. Gets or sets the timeout (in milliseconds) after which the export is cancelled. The default value is 30000. Gets or sets the maximum batch size of every export. It must be smaller or equal to . The default value is 512. Represents a chain of s. The type of object to be processed. Initializes a new instance of the class. Processors to add to the composite processor chain. Adds a processor to the composite processor chain. . The current instance to support call chaining. Lock-free implementation of single-reader multi-writer circular buffer. The type of the underlying value. Initializes a new instance of the class. The capacity of the circular buffer, must be a positive integer. Gets the capacity of the . Gets the number of items contained in the . Gets the number of items added to the . Gets the number of items removed from the . Adds the specified item to the buffer. The value to add. Returns true if the item was added to the buffer successfully; false if the buffer is full. Attempts to add the specified item to the buffer. The value to add. The maximum allowed spin count, when set to a negative number or zero, will spin indefinitely. Returns true if the item was added to the buffer successfully; false if the buffer is full or the spin count exceeded . Reads an item from the . This function is not reentrant-safe, only one reader is allowed at any given time. Warning: There is no bounds check in this method. Do not call unless you have verified Count > 0. Item read. EventSource implementation for OpenTelemetry SDK implementation. Self diagnostics class captures the EventSource events sent by OpenTelemetry modules and writes them to local file for internal troubleshooting. Long-living object that hold relevant resources. No member of SelfDiagnostics class is explicitly called when an EventSource class, say OpenTelemetryApiEventSource, is invoked to send an event. To trigger CLR to initialize static fields and static constructors of SelfDiagnostics, call EnsureInitialized method before any EventSource event is sent. ConfigBufferSize is the maximum bytes of config file that will be read. SelfDiagnosticsConfigRefresher class checks a location for a configuration file and open a MemoryMappedFile of a configured size at the configured file path. The class provides a stream object with proper write position if the configuration file is present and valid. Otherwise, the stream object would be unavailable, nothing will be logged to any file. memoryMappedFileCache is a handle kept in thread-local storage as a cache to indicate whether the cached viewStream is created from the current m_memoryMappedFile. Try to get the log stream which is seeked to the position where the next line of log should be written. The number of bytes that need to be written. When this method returns, contains the Stream object where `byteCount` of bytes can be written. The number of bytes that is remaining until the end of the stream. Whether the logger should log in the stream. SelfDiagnosticsEventListener class enables the events from OpenTelemetry event sources and write the events to a local file in a circular way. Encode a string into the designated position in a buffer of bytes, which will be written as log. If isParameter is true, wrap "{}" around the string. The buffer should not be filled to full, leaving at least one byte empty space to fill a '\n' later. If the buffer cannot hold all characters, truncate the string and replace extra content with "...". The buffer is not guaranteed to be filled until the last byte due to variable encoding length of UTF-8, in order to prioritize speed over space. The string to be encoded. Whether the string is a parameter. If true, "{}" will be wrapped around the string. The byte array to contain the resulting sequence of bytes. The position at which to start writing the resulting sequence of bytes. The position of the buffer after the last byte of the resulting sequence. Write the datetime formatted string into bytes byte-array starting at byteIndex position. [DateTimeKind.Utc] format: yyyy - MM - dd T HH : mm : ss . fffffff Z (i.e. 2020-12-09T10:20:50.4659412Z). [DateTimeKind.Local] format: yyyy - MM - dd T HH : mm : ss . fffffff +|- HH : mm (i.e. 2020-12-09T10:20:50.4659412-08:00). [DateTimeKind.Unspecified] format: yyyy - MM - dd T HH : mm : ss . fffffff (i.e. 2020-12-09T10:20:50.4659412). The bytes array must be large enough to write 27-33 charaters from the byteIndex starting position. DateTime. Array of bytes to write. Starting index into bytes array. The number of bytes written. This method records the events from event sources to a local file, which is provided as a stream object by SelfDiagnosticsConfigRefresher class. The file size is bound to a upper limit. Once the write position reaches the end, it will be reset to the beginning of the file. Data of the EventSource event. Contains methods for building instances. Initializes a new instance of the class. Contains extension methods for the class. Sets the from which the associated with this provider is built from. Note: Calling will override the currently set . To modify the current call instead. . from which Resource will be built. Returns for chaining. Modify in-place the from which the associated with this provider is built from. . An action which modifies the provided in-place. Returns for chaining. Adds a processor to the provider. . LogRecord processor to add. Returns for chaining. Adds a processor to the provider which will be retrieved using dependency injection. Note: The type specified by will be registered as a singleton service into application services. Processor type. . The supplied for chaining. Adds a processor to the provider which will be retrieved using dependency injection. . The factory that creates the service. The supplied for chaining. Run the given actions to initialize the . . . Stores state used to build a . Contains OpenTelemetry logging options. Gets or sets a value indicating whether or not formatted log message should be included on generated s. Default value: . Note: When set to a formatted log message will not be included if a message template can be found. If a message template is not found, a formatted log message is always included. Gets or sets a value indicating whether or not log scopes should be included on generated s. Default value: . Gets or sets a value indicating whether or not log state should be parsed into on generated s. Default value: . Notes: As of OpenTelemetry v1.5 state parsing is handled automatically if the state logged implements or where T is KeyValuePair<string, object> than will be set regardless of the value of . When is set to will always be . When is set to will always be set to the logged state to support legacy exporters which access directly. Exporters should NOT access directly because is NOT safe and may lead to exceptions or incorrect data especially when using batching. Exporters should use to safely access any data attached to log messages. Gets or sets a value indicating whether or not attributes specified via log state should be included on generated s. Default value: . Gets or sets a value indicating whether or not the for the current should be included on generated s. Default value: . Adds processor to the options. Log processor to add. Returns for chaining. Adds a processor to the provider which will be retrieved using dependency injection. The factory that creates the service. Returns for chaining. Sets the from which the Resource associated with this provider is built from. Overwrites currently set ResourceBuilder. from which Resource will be built. Returns for chaining. An implementation for exporting logs using OpenTelemetry. Initializes a new instance of the class. . Contains extension methods for the class. Add a processor to the . Note: The supplied will be automatically disposed when then the is disposed. instance on which ForceFlush will be called. Log processor to add. The supplied for chaining. Flushes all the processors registered under , blocks the current thread until flush completed, shutdown signaled or timed out. instance on which ForceFlush will be called. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when force flush succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Attempts to shutdown the , blocks the current thread until shutdown completed or timed out. instance on which Shutdown will be called. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Only the first call will win, subsequent calls will be no-op. SDK implementation. SDK implementation. Stores details about a log message. A created manually. A rented from the . A rented from the . Gets or sets the log timestamp. Note: If is set to a value with it will be automatically converted to UTC using . Gets or sets the log . Gets or sets the log . Gets or sets the log . Gets or sets the log trace state. Note: Only set if is enabled. Gets or sets the log category name. Gets or sets the log . Gets or sets the log . Note: is only set when emitting logs through . Gets or sets the log formatted message. Notes: is only set when emitting logs through . Set if is enabled or {OriginalFormat} attribute (message template) is not found. Gets or sets the log body. Note: Set to the {OriginalFormat} attribute (message template) if found otherwise the formatted log message. Gets or sets the raw state attached to the log. Notes: is only set when emitting logs through . Set to when is enabled. are automatically updated if is set directly. Gets or sets the state values attached to the log. Gets or sets the attributes attached to the log. Notes: Set when is enabled and log record state implements or of s (where TKey is string and TValue is object) or is enabled otherwise . is automatically updated if are set directly. Gets or sets the log . Note: is only set when emitting logs through . Gets or sets the original string representation of the severity as it is known at the source. Gets or sets the log . Gets or sets the associated with the . Executes callback for each currently active scope objects in order of creation. All callbacks are guaranteed to be called inline from this method. State. The callback to be executed for every scope object. The state object to be passed into the callback. Gets a reference to the for the log message. . Buffers the attributes attached to the log into a list so that they can be safely processed after the log message lifecycle has ended. Buffers the scopes attached to the log into a list so that they can be safely processed after the log message lifecycle has ended. Stores details about a scope attached to a log message. Gets the raw scope value. Gets an for looping over the inner values of the scope. . LogRecordScope enumerator. Initializes a new instance of the struct. Scope. Batch log processor options. OTEL_BLRP_MAX_QUEUE_SIZE, OTEL_BLRP_MAX_EXPORT_BATCH_SIZE, OTEL_BLRP_EXPORT_TIMEOUT, OTEL_BLRP_SCHEDULE_DELAY environment variables are parsed during object construction. Initializes a new instance of the class. Options for configuring either a or . Initializes a new instance of the class. Gets or sets the export processor type to be used. The default value is . Gets or sets the batch export options. Ignored unless is . Implements a batch log record export processor. Initializes a new instance of the class. Log record exporter. The maximum queue size. After the size is reached data are dropped. The default value is 2048. The delay interval in milliseconds between two consecutive exports. The default value is 5000. How long the export can run before it is cancelled. The default value is 30000. The maximum batch size of every export. It must be smaller or equal to maxQueueSize. The default value is 512. Implements a simple log record export processor. Initializes a new instance of the class. Log record exporter. Enumeration used to define the aggregation temporality for a . Cumulative. Delta. Invalid. Calculate SUM from incoming delta measurements. Calculate SUM from incoming cumulative measurements. Calculate SUM from incoming delta measurements. Calculate SUM from incoming cumulative measurements. Keep LastValue. Keep LastValue. Histogram with sum, count, buckets. Histogram with sum, count, min, max, buckets. Histogram with sum, count. Histogram with sum, count, min, max. Exponential Histogram with sum, count. Exponential Histogram with sum, count, min, max. Contains methods for building instances. Initializes a new instance of the class. Run the configured actions to initialize the . . Contains extension methods for the class. Adds a reader to the provider. . . The supplied for chaining. Adds a reader to the provider. Note: The type specified by will be registered as a singleton service into application services. Reader type. . The supplied for chaining. Adds a reader to the provider. . The factory that creates the service. The supplied for chaining. Add metric view, which can be used to customize the Metrics outputted from the SDK. The views are applied in the order they are added. See View specification here : https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#view. . Name of the instrument, to be used as part of Instrument selection criteria. Name of the view. This will be used as name of resulting metrics stream. The supplied for chaining. Add metric view, which can be used to customize the Metrics outputted from the SDK. The views are applied in the order they are added. See View specification here : https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#view. . Name of the instrument, to be used as part of Instrument selection criteria. Aggregation configuration used to produce metrics stream. The supplied for chaining. Add metric view, which can be used to customize the Metrics outputted from the SDK. The views are applied in the order they are added. Note: An invalid returned from will cause the view to be ignored, no error will be thrown at runtime. See View specification here : https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#view. . Function to configure aggregation based on the instrument. The supplied for chaining. Sets the maximum number of Metric streams supported by the MeterProvider. When no Views are configured, every instrument will result in one metric stream, so this control the numbers of instruments supported. When Views are configured, a single instrument can result in multiple metric streams, so this control the number of streams. If an instrument is created, but disposed later, this will still be contributing to the limit. This may change in the future. . Maximum number of metric streams allowed. The supplied for chaining. Sets the maximum number of MetricPoints allowed per metric stream. This limits the number of unique combinations of key/value pairs used for reporting measurements. If a particular key/value pair combination is used at least once, it will contribute to the limit for the life of the process. This may change in the future. See: https://github.com/open-telemetry/opentelemetry-dotnet/issues/2360. . Maximum number of metric points allowed per metric stream. The supplied for chaining. Sets the from which the Resource associated with this provider is built from. Overwrites currently set ResourceBuilder. You should usually use instead (call if desired). . from which Resource will be built. The supplied for chaining. Modify the from which the Resource associated with this provider is built from in-place. . An action which modifies the provided in-place. The supplied for chaining. Run the given actions to initialize the . . . Sets the default for the provider. Notes: The configured controls how measurements will be offered to s which are responsible for storing s on metrics. The default provider configuration is . Use or to enable s for all metrics managed by the provider. If s are enabled on the provider by the configured then s will be configured on metrics using the defaults described in the specification: . To change the for a metric use the AddView API and . Specification: . . to use. The supplied for chaining. Stores state used to build a . Returns whether the given instrument name is valid according to the specification. See specification: . The instrument name. Boolean indicating if the instrument is valid. Returns whether the given custom view name is valid according to the specification. See specification: . The view name. Boolean indicating if the instrument is valid. A histogram buckets implementation based on circular buffer. Gets the capacity of the . Gets the offset of the start index for the . Gets the size of the . Returns the value of Bucket[index]. The index of the bucket. The "index" value can be positive, zero or negative. This method does not validate if "index" falls into [begin, end], the caller is responsible for the validation. Attempts to increment the value of Bucket[index] by value. The index of the bucket. The increment. Returns 0 if the increment attempt succeeded; Returns a positive integer indicating the minimum scale reduction level if the increment attempt failed. The "index" value can be positive, zero or negative. AlignedHistogramBucketExemplarReservoir implementation. Specification: . Exemplar implementation. Specification: . Gets the timestamp. Gets the TraceId. Gets the SpanId. Gets the long value. Gets the double value. Gets the filtered tags. Note: represents the set of tags which were supplied at measurement but dropped due to filtering configured by a view (). If view tag filtering is not configured will be empty. Defines the supported exemplar filters. Specification: . An exemplar filter which makes no measurements eligible for becoming an . Note: Setting on a meter provider effectively disables exemplars. Specification: . An exemplar filter which makes all measurements eligible for becoming an . Specification: . An exemplar filter which makes measurements recorded in the context of a sampled (span) eligible for becoming an . Specification: . Gets the measurement value. Gets the measurement tags. Note: represents the full set of tags supplied at measurement regardless of any filtering configured by a view (). Gets a value indicating whether or not the should reset its state when performing collection. Note: is set to for s using delta aggregation temporality and for s using cumulative aggregation temporality. Offers a measurement to the reservoir. . Offers a measurement to the reservoir. . Collects all the exemplars accumulated by the Reservoir. . Initializes a new instance of the class. The capacity (number of s) to be contained in the reservoir. Gets the capacity (number of s) contained in the reservoir. Collects all the exemplars accumulated by the Reservoir. . Fired when has finished before returning a . Note: This method is typically used to reset the state of reservoirs and is called regardless of the value of . Updates the stored in the reservoir at the specified index with an . Index of the to update. . Updates the stored in the reservoir at the specified index with an . Index of the to update. . A read-only collection of s. Gets the maximum number of s in the collection. Note: Enumerating the collection may return fewer results depending on which s in the collection received updates. Returns an enumerator that iterates through the s. . Enumerates the elements of a . Gets the at the current position of the enumerator. Advances the enumerator to the next element of the . if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection. SimpleFixedSizeExemplarReservoir implementation. Specification: . Describes the mode of a metric exporter. Push. Pull. An attribute for declaring the supported of a metric exporter. Initializes a new instance of the class. . Gets the supported . Describes a type of which supports . Gets or sets the Collect delegate. Contains extension methods for the class. Flushes all the readers registered under MeterProviderSdk, blocks the current thread until flush completed, shutdown signaled or timed out. MeterProviderSdk instance on which ForceFlush will be called. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when force flush succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Attempts to shutdown the MeterProviderSdk, blocks the current thread until shutdown completed or timed out. MeterProviderSdk instance on which Shutdown will be called. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Only the first call will win, subsequent calls will be no-op. Finds the Metric exporter of the given type from the provider. The type of the Exporter. The MeterProvider from which Exporter should be found. The exporter instance. true if the exporter of specified Type is found; otherwise false. Called by ForceFlush. This function should block the current thread until flush completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when flush succeeded; otherwise, false. This function is called synchronously on the thread which made the first call to ForceFlush. This function should not throw exceptions. Called by Shutdown. This function should block the current thread until shutdown completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. This function is called synchronously on the thread which made the first call to Shutdown. This function should not throw exceptions. Represents a metric stream which can contain multiple metric points. Gets the for the metric stream. Gets the for the metric stream. Gets the name for the metric stream. Gets the description for the metric stream. Gets the unit for the metric stream. Gets the meter name for the metric stream. Gets the meter version for the metric stream. Gets the attributes (tags) for the metric stream. Gets the for the metric stream. Get the metric points for the metric stream. . Represents an exponential bucket histogram with base = 2 ^ (2 ^ (-scale)). An exponential bucket histogram has infinite number of buckets, which are identified by Bucket[index] = ( base ^ index, base ^ (index + 1) ], where index is an integer. Initializes a new instance of the class. The maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket. The default value is 160. Maximum scale factor. The default value is 20. Maps a finite positive IEEE 754 double-precision floating-point number to Bucket[index] = ( base ^ index, base ^ (index + 1) ], where index is an integer. The value to be bucketized. Must be a finite positive number. Returns the index of the bucket. Contains the buckets of an exponential histogram. Gets the exponential histogram offset. Returns an enumerator that iterates through the . . Enumerates the bucket counts of an exponential histogram. Gets the bucket count at the current position of the enumerator. Advances the enumerator to the next element of the . if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection. Contains the data for an exponential histogram. Gets the exponential histogram scale. Gets the exponential histogram zero count. Gets the exponential histogram positive buckets. Gets the exponential histogram negative buckets. Represents a bucket in the histogram metric type. Gets the configured bounds for the bucket or for the catch-all bucket. Gets the count of items in the bucket. A collection of s associated with a histogram metric type. Returns an enumerator that iterates through the . . Enumerates the elements of a . Gets the at the current position of the enumerator. Advances the enumerator to the next element of the . if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection. Represents a metric data point. Gets the tags associated with the metric point. Gets the start time (UTC) associated with the metric point. Gets the end time (UTC) associated with the metric point. Gets the sum long value associated with the metric point. Applies to metric type. Long sum value. Gets the sum double value associated with the metric point. Applies to metric type. Double sum value. Gets the last long value of the gauge associated with the metric point. Applies to metric type. Long gauge value. Gets the last double value of the gauge associated with the metric point. Applies to metric type. Double gauge value. Gets the count value of the histogram associated with the metric point. Applies to metric type. Count value. Gets the sum value of the histogram associated with the metric point. Applies to metric type. Sum value. Gets the buckets of the histogram associated with the metric point. Applies to metric type. . Gets the exponential histogram data associated with the metric point. Applies to metric type. . Gets the Histogram Min and Max values. The histogram minimum value. The histogram maximum value. True if minimum and maximum value exist, false otherwise. Gets the exemplars associated with the metric point. . if exemplars exist; otherwise. This method sets the member object references of MetricPoint to `null`. This is done to have them collected faster by GC. Stores optional components of a metric point. Histogram, Exemplar are current components. ExponentialHistogram is a future component. This is done to keep the MetricPoint (struct) size in control. A struct for accessing the s collected for a . Returns an enumerator that iterates through the . . Enumerates the elements of a . Gets the at the current position of the enumerator. Advances the enumerator to the next element of the . if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection. This status is applied to s with status after a Collect. If an update occurs, status will be moved to . The has been updated since the previous Collect cycle. Collect will move it to . Enumeration used to define the type of a . Sum of Long type. Sum of Double type. Gauge of Long type. Gauge of Double type. Histogram. Exponential Histogram. Non-monotonic Sum of Long type. Non-monotonic Sum of Double type. Contains extension methods for performing common operations against the class. Determines if the supplied is a sum definition. . if the supplied is a sum definition. Determines if the supplied is a gauge definition. . if the supplied is a gauge definition. Determines if the supplied is a histogram definition. . if the supplied is a histogram definition. Determines if the supplied is a double definition. . if the supplied is a double definition. Determines if the supplied is a long definition. . if the supplied is a long definition. MetricReader implementation which exports metrics to the configured MetricExporter upon . Gets the exporter used by the metric reader. Initializes a new instance of the class. Exporter instance to export Metrics to. Gets the supported . CompositeMetricReader that does not deal with adding metrics and recording measurements. CompositeMetricReader that deals with adding metrics and recording measurements. MetricReader base class. MetricReader base class. Gets or sets the metric reader temporality preference. Attempts to collect the metrics, blocks the current thread until metrics collection completed, shutdown signaled or timed out. If there are asynchronous instruments involved, their callback functions will be triggered. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when metrics collection succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. If multiple calls occurred simultaneously, they might get folded and result in less calls to the OnCollect callback for improved performance, as long as the semantic can be preserved. Attempts to shutdown the processor, blocks the current thread until shutdown completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Only the first call will win, subsequent calls will be no-op. Processes a batch of metrics. Batch of metrics to be processed. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when metrics processing succeeded; otherwise, false. Called by Collect. This function should block the current thread until metrics collection completed, shutdown signaled or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when metrics collection succeeded; otherwise, false. This function is called synchronously on the threads which called Collect. This function should not throw exceptions. Called by Shutdown. This function should block the current thread until shutdown completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. This function is called synchronously on the thread which made the first call to Shutdown. This function should not throw exceptions. Releases the unmanaged resources used by this class and optionally releases the managed resources. to release both managed and unmanaged resources; to release only unmanaged resources. Options for configuring either a or . Initializes a new instance of the class. Gets or sets the . Gets or sets the . Defines the behavior of a with respect to . All aggregations are performed using cumulative temporality. All measurements that are monotonic in nature are aggregated using delta temporality. Aggregations of non-monotonic measurements use cumulative temporality. MetricReader implementation which collects metrics based on a user-configurable time interval and passes the metrics to the configured MetricExporter. Initializes a new instance of the class. Exporter instance to export Metrics to. The interval in milliseconds between two consecutive exports. The default value is 60000. How long the export can run before it is cancelled. The default value is 30000. Contains periodic metric reader options. Note: OTEL_METRIC_EXPORT_INTERVAL and OTEL_METRIC_EXPORT_TIMEOUT environment variables are parsed during object construction. Initializes a new instance of the class. Gets or sets the metric export interval in milliseconds. If not set, the default value depends on the type of metric exporter associated with the metric reader. Gets or sets the metric export timeout in milliseconds. If not set, the default value depends on the type of metric exporter associated with the metric reader. Stores configuration for a histogram metric stream with base-2 exponential bucket boundaries. Gets or sets the maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket. The default value is 160. The minimum size is 2. Gets or sets the maximum scale factor used to determine the resolution of bucket boundaries. The higher the scale the higher the resolution. The default value is 20. The minimum size is -11. The maximum size is 20. Stores configuration for a histogram metric stream with explicit bucket boundaries. Gets or sets the optional boundaries of the histogram metric stream. Requirements: The array must be in ascending order with distinct values. An empty array would result in no histogram buckets being calculated. A null value would result in default bucket boundaries being used. Note: A copy is made of the provided array. Stores configuration for a histogram MetricStream. Gets or sets a value indicating whether Min, Max should be collected. Stores configuration for a MetricStream. Gets the drop configuration. Note: All metrics for the given instrument will be dropped (not collected). Gets or sets the optional name of the metric stream. Note: If not provided the instrument name will be used. Gets or sets the optional description of the metric stream. Note: If not provided the instrument description will be used. Gets or sets the optional tag keys to include in the metric stream. Notes: If not provided, all the tags provided by the instrument while reporting measurements will be used for aggregation. If provided, only those tags in this list will be used for aggregation. Providing an empty array will result in a metric stream without any tags. A copy is made of the provided array. Gets or sets a positive integer value defining the maximum number of data points allowed for the metric managed by the view. Spec reference: Cardinality limits. Note: The cardinality limit determines the maximum number of unique dimension combinations for metrics. Metrics with zero dimensions and overflow metrics are treated specially and do not count against this limit. If not set the default MeterProvider cardinality limit of 2000 will apply. Contains methods for extending the interface. Registers an action to configure the s used by tracing, metrics, and logging. . Note: This is safe to be called multiple times and by library authors. Each registered configuration action will be applied sequentially. configuration action. The supplied for chaining calls. Adds metric services into the builder. . Notes: This is safe to be called multiple times and by library authors. Only a single will be created for a given . This method automatically registers an named 'OpenTelemetry' into the . The supplied for chaining calls. Adds metric services into the builder. . configuration callback. The supplied for chaining calls. Adds tracing services into the builder. . Note: This is safe to be called multiple times and by library authors. Only a single will be created for a given . The supplied for chaining calls. Adds tracing services into the builder. . configuration callback. The supplied for chaining calls. Adds logging services into the builder. . Notes: This is safe to be called multiple times and by library authors. Only a single will be created for a given . This method automatically registers an named 'OpenTelemetry' into the . The supplied for chaining calls. Adds logging services into the builder. . configuration callback. The supplied for chaining calls. Adds logging services into the builder. . Optional configuration callback. Optional configuration callback. are used by the named 'OpenTelemetry' automatically registered by this method. The supplied for chaining calls. Contains methods for configuring the OpenTelemetry SDK and accessing logging, metrics, and tracing providers. Gets the . Note: The default will be a no-op instance. Call to enable logging. Gets the . Note: The default will be a no-op instance. Call to enable metrics. Gets the . Note: The default will be a no-op instance. Call to enable tracing. Gets the containing SDK services. Create an instance. configuration delegate. Created . Contains methods for extending the class. Gets the contained in an instance. Note: The default will be a no-op instance. Call to enable logging. . . Contains provider extension methods. Gets the associated with the . . if found otherwise . Gets the associated with the . . if found otherwise . A read-only collection of tag key/value pairs which returns a filtered subset of tags when enumerated. Gets the maximum number of tags in the collection. Note: Enumerating the collection may return fewer results depending on the filter. Returns an enumerator that iterates through the tags. . Enumerates the elements of a . Gets the tag at the current position of the enumerator. Advances the enumerator to the next element of the . if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection. A read-only collection of tag key/value pairs. Gets the number of tags in the collection. Returns an enumerator that iterates through the tags. . Enumerates the elements of a . Gets the tag at the current position of the enumerator. Advances the enumerator to the next element of the . if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection. An interface for Resource detectors. Called to get a resource with attributes from detector. An instance of . represents a resource, which captures identifying information about the entities for which telemetry is reported. Use to construct resource instances. Initializes a new instance of the class. An of attributes that describe the resource. Gets an empty Resource. Gets the collection of key-value pairs describing the resource. Returns a new, merged by merging the old with the other . In case of a collision the other takes precedence. The that will be merged with this. . Contains methods for building instances. Creates a instance with default attributes added. See resource semantic conventions for details. Additionally it adds resource attributes parsed from OTEL_RESOURCE_ATTRIBUTES, OTEL_SERVICE_NAME environment variables to a following the Resource SDK. Created . Creates an empty instance. Created . Clears the s added to the builder. for chaining. Build a merged from all the s added to the builder. . Add a to the builder. . Supplied for call chaining. Add a to the builder which will be resolved using the application . Resource detector factory. Supplied for call chaining. Contains extension methods for building s. Adds service information to a following semantic conventions. . Name of the service. Optional namespace of the service. Optional version of the service. Specify to automatically generate a for if not supplied. Optional unique identifier of the service instance. Returns for chaining. Adds service information to a following semantic conventions. . Returns for chaining. Adds attributes to a . . An of attributes that describe the resource. Returns for chaining. Adds resource attributes parsed from OTEL_RESOURCE_ATTRIBUTES, OTEL_SERVICE_NAME environment variables to a following the Resource SDK. . Returns for chaining. OpenTelemetry helper. Gets a value indicating whether instrumentation is suppressed (disabled). Sets the Default TextMapPropagator. TextMapPropagator to be set as default. Creates a which is used to build a . In a typical application, a single is created at application startup and disposed at application shutdown. It is important to ensure that the provider is not disposed too early. instance, which is used to build a . Creates a which is used to build a . In a typical application, a single is created at application startup and disposed at application shutdown. It is important to ensure that the provider is not disposed too early. instance, which is used to build a . Creates a which is used to build a . In a typical application, a single is created at application startup and disposed at application shutdown. It is important to ensure that the provider is not disposed too early. instance, which is used to build a . Implements processor that exports telemetry data at each OnEnd call. The type of telemetry object to be exported. Initializes a new instance of the class. Exporter instance. Contains methods managing instrumentation of internal operations. Begins a new scope in which instrumentation is suppressed (disabled). Value indicating whether to suppress instrumentation. Object to dispose to end the scope. This is typically used to prevent infinite loops created by collection of internal operations, such as exporting traces over HTTP. public override async Task<ExportResult> ExportAsync( IEnumerable<Activity> batch, CancellationToken cancellationToken) { using (SuppressInstrumentationScope.Begin()) { // Instrumentation is suppressed (i.e., Sdk.SuppressInstrumentation == true) } // Instrumentation is not suppressed (i.e., Sdk.SuppressInstrumentation == false) } Enters suppression mode. If suppression mode is enabled (slot.Depth is a negative integer), do nothing. If suppression mode is not enabled (slot is null), enter reference-counting suppression mode. If suppression mode is enabled (slot.Depth is a positive integer), increment the ref count. The updated suppression slot value. Contains methods for building instances. Initializes a new instance of the class. Adds instrumentation to the provider. d Instrumentation name. Instrumentation version. Function that builds instrumentation. Returns for chaining. Run the configured actions to initialize the . . Contains extension methods for the class. Sets whether the status of should be set to Status.Error when it ended abnormally due to an unhandled exception. . Enabled or not. Default value is true. Returns for chaining. This method is not supported in native AOT or Mono Runtime as of .NET 8. Sets sampler. . Sampler instance. Returns for chaining. Sets the sampler on the provider. Note: The type specified by will be registered as a singleton service into application services. Sampler type. . The supplied for chaining. Sets the sampler on the provider. . The factory that creates the service. The supplied for chaining. Sets the from which the Resource associated with this provider is built from. Overwrites currently set ResourceBuilder. You should usually use instead (call if desired). . from which Resource will be built. Returns for chaining. Modify the from which the Resource associated with this provider is built from in-place. . An action which modifies the provided in-place. Returns for chaining. Adds a processor to the provider. . Activity processor to add. Returns for chaining. Adds a processor to the provider which will be retrieved using dependency injection. Note: The type specified by will be registered as a singleton service into application services. Processor type. . The supplied for chaining. Adds a processor to the provider which will be retrieved using dependency injection. . The factory that creates the service. The supplied for chaining. Run the given actions to initialize the . . . Stores state used to build a . Options for configuring either a or . Initializes a new instance of the class. Gets or sets the export processor type to be used. The default value is . Gets or sets the batch export options. Ignored unless is . Batch span processor options. OTEL_BSP_MAX_QUEUE_SIZE, OTEL_BSP_MAX_EXPORT_BATCH_SIZE, OTEL_BSP_EXPORT_TIMEOUT, OTEL_BSP_SCHEDULE_DELAY environment variables are parsed during object construction. Initializes a new instance of the class. Sampler implementation which always returns SamplingDecision.Drop. Sampler implementation which always returns SamplingDecision.RecordAndSample. Sampler implementation which by default will take a sample if parent Activity is sampled. Otherwise, samples root traces according to the specified root sampler. The default behavior can be customized by providing additional samplers to be invoked for different combinations of local/remote parent and its sampling decision. See . Initializes a new instance of the class. The to be called for root span/activity. Initializes a new instance of the class with ability to delegate sampling decision to one of the inner samplers provided. The to be called for root span/activity. A to delegate sampling decision to in case of remote parent ( == true) with flag == true. Default: . A to delegate sampling decision to in case of remote parent ( == true) with flag == false. Default: . A to delegate sampling decision to in case of local parent ( == false) with flag == true. Default: . A to delegate sampling decision to in case of local parent ( == false) with flag == false. Default: . Controls the number of samples of traces collected and sent to the backend. Initializes a new instance of the class. Gets or sets the sampler description. Checks whether activity needs to be created and tracked. The used by the to decide if the to be created is going to be sampled or not. Sampling decision on whether activity needs to be sampled or not. Enumeration to define sampling decision. The activity will be created but not recorded. Activity.IsAllDataRequested will return false. Activity.Recorded will return false. The activity will be created and recorded, but sampling flag will not be set. Activity.IsAllDataRequested will return true. Activity.Recorded will return false. The activity will be created, recorded, and sampling flag will be set. Activity.IsAllDataRequested will return true. Activity.Recorded will return true. Sampling parameters passed to a for it to make a sampling decision. Initializes a new instance of the struct. Parent activity context. Typically taken from the wire. Trace ID of a activity to be created. The name (DisplayName) of the activity to be created. Note, that the name of the activity is settable. So this name can be changed later and Sampler implementation should assume that. Typical example of a name change is when representing incoming http request has a name of url path and then being updated with route name when routing complete. The kind of the Activity to be created. Initial set of Tags for the Activity being constructed. Links associated with the activity. Gets the parent activity context. Gets the trace ID of parent activity or a new generated one for root span/activity. Gets the name to be given to the span/activity. Gets the kind of span/activity to be created. For Activities created outside of ActivitySource, the Kind will be the default (Internal). Gets the tags to be associated to the span/activity to be created. These are the tags provided at the time of Activity creation. Gets the links to be added to the activity to be created. Sampling result. Initializes a new instance of the struct. indicates whether an activity object is recorded and sampled. Initializes a new instance of the struct. True if sampled, false otherwise. Initializes a new instance of the struct. indicates whether an activity object is recorded and sampled. Attributes associated with the sampling decision. Attributes list passed to this method must be immutable. Mutations of the collection and/or attribute values may lead to unexpected behavior. Initializes a new instance of the struct. indicates whether an activity object is recorded and sampled. traceStateString associated with the created Activity. Initializes a new instance of the struct. indicates whether an activity object is recorded and sampled. attributes associated with the sampling decision. Attributes list passed to this method must be immutable. Mutations of the collection and/or attribute values may lead to unexpected behavior. traceStateString associated with the created Activity. Gets a value indicating whether an activity object is recorded and sampled. Gets a map of attributes associated with the sampling decision. Gets the tracestate. Compare two for equality. First Decision to compare. Second Decision to compare. Compare two for not equality. First Decision to compare. Second Decision to compare. Samples traces according to the specified probability. Initializes a new instance of the class. The desired probability of sampling. This must be between 0.0 and 1.0. Higher the value, higher is the probability of a given Activity to be sampled in. Contains extension methods for the class. Add a processor to the provider. . . The supplied instance for call chaining. Flushes all the processors registered under TracerProviderSdk, blocks the current thread until flush completed, shutdown signaled or timed out. TracerProviderSdk instance on which ForceFlush will be called. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when force flush succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Attempts to shutdown the TracerProviderSdk, blocks the current thread until shutdown completed or timed out. TracerProviderSdk instance on which Shutdown will be called. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. Thrown when the timeoutMilliseconds is smaller than -1. This function guarantees thread-safety. Only the first call will win, subsequent calls will be no-op. Called by Shutdown. This function should block the current thread until shutdown completed or timed out. The number (non-negative) of milliseconds to wait, or Timeout.Infinite to wait indefinitely. Returns true when shutdown succeeded; otherwise, false. This function is called synchronously on the thread which made the first call to Shutdown. This function should not throw exceptions. Implements processor that batches objects before calling exporter. Initializes a new instance of the class. Implements processor that exports objects at each OnEnd call. Initializes a new instance of the class. . Contains extension methods for registering into a instance. Adds an OpenTelemetry logger named 'OpenTelemetry' to the . Notes: This is safe to be called multiple times and by library authors. Only a single will be created for a given . features available to metrics and traces (for example the "ConfigureServices" extension) are NOT available when using . The to use. The supplied for call chaining. Adds an OpenTelemetry logger named 'OpenTelemetry' to the . The to use. Optional configuration action. The supplied for call chaining. Contains extension methods for registering OpenTelemetry metrics with an instance. Adds an OpenTelemetry named 'OpenTelemetry' to the . Note: This is safe to be called multiple times and by library authors. Only a single will be created for a given . . The supplied for chaining calls. Adds an OpenTelemetry named 'OpenTelemetry' to the . . configuration callback. The supplied for chaining calls. An environment variable based . Initializes a new instance. Initializes a new instance with the specified prefix. A prefix used to filter the environment variables. Loads the environment variables. Generates a string representing this provider name and relevant details. The configuration name. Represents environment variables as an . A prefix used to filter environment variables. Builds the for this source. The . A Extension methods for registering with . Adds an that reads configuration values from environment variables. The to add to. The . Adds an that reads configuration values from environment variables with a specified prefix. The to add to. The prefix that environment variable names must start with. The prefix will be removed from the environment variable names. The . Adds an that reads configuration values from environment variables. The to add to. Configures the source. The . Implementation of . The type of options being requested. Initializes a new instance with the specified options configurations. Factory delegate used to create instances. . The configuration actions to run. The initialization actions to run. The validations to run. Returns a configured instance with the given . The name of the instance to create. The created instance with the given . One or more return failed when validating the instance been created. The does not have a public parameterless constructor or is .