dartastic_opentelemetry library

Classes

AlwaysOffSampler
A sampler that never samples any traces.
AlwaysOnSampler
A sampler that always samples every trace.
Attributes
A collection of attributes that are immutable and type-safe. Create with the OTelFactory methods.
AttributeSamplingCondition
A sampling condition that forces sampling when a span has a specific attribute value.
Baggage
Immutable Baggage that stores entries with unique string keys.
BaggageEntry
A single entry within Baggage. Typically just a value plus optional metadata.
BatchSpanProcessor
A SpanProcessor that batches spans before export.
BatchSpanProcessorConfig
Configuration for the BatchSpanProcessor.
CompositeExporter
A composite exporter that delegates export operations to multiple exporters.
CompositeMetricExporter
A composite metric exporter that delegates to multiple exporters.
CompositeResourceDetector
Composite detector that combines multiple resource detectors.
CompositeSampler
A sampler that combines multiple samplers using a specified operation.
ConsoleExporter
A simple span exporter that prints spans to the console.
ConsoleMetricExporter
ConsoleMetricExporter is a simple exporter that prints metrics to the console.
Context
Represents the immutable context containing active spans, baggage, and other data.
ContextKey<T>
Key for Context values Each instance is unique, even if created with the same name.
Counter<T extends num>
A synchronous instrument that records monotonically increasing values.
CountingSampler
A sampler that samples every Nth request. Optionally can be combined with conditions to override the count-based decision.
EnvironmentService
Service for accessing environment variables in a consistent manner.
EnvVarResourceDetector
Detects resource information from environment variables.
ErrorSamplingCondition
A sampling condition that forces sampling when a span has an error status.
Exemplar
Exemplar is a sample data point that may be used to annotate aggregated metric data points.
Gauge<T extends num>
Gauge is a synchronous instrument that records non-additive values.
GaugeStorage<T extends num>
GaugeStorage is used for storing the last recorded value for each set of attributes.
Histogram<T extends num>
Histogram is a synchronous instrument that records a distribution of values.
HistogramStorage<T extends num>
HistogramStorage is used for storing and accumulating histogram data.
HistogramStorageBase<T extends num>
Storage for histogram metrics that have numeric input but HistogramValue output.
HistogramValue
Represents the value of a histogram metric point.
HostResourceDetector
Detects host-related resource information.
IdGenerator
Generates trace and span IDs according to the W3C Trace Context specification.
InstrumentationScope
Represents the instrumentation scope information.
Measurement<T extends num>
Represents a data point reported via the metrics API.
Meter
SDK implementation of the APIMeter interface.
MeterCreate
Factory for creating Meter instances.
MeterProvider
SDK implementation of the APIMeterProvider interface.
Metric
Metric represents a named collection of data points.
MetricData
MetricData represents a collection of metrics to be exported.
MetricExporter
MetricExporter is responsible for sending metrics to a backend.
MetricPoint<T>
Represents a metric data point, which consists of a value or set of values, a set of attributes, and possibly exemplars.
MetricReader
MetricReader is responsible for collecting metrics from a MeterProvider and passing them to a MetricExporter.
MetricsConfiguration
Configuration for metrics exporters and readers.
MetricStorage
Base storage interface for all metric types. This replaces the old PointStorage with proper input/output type separation.
NamePatternSamplingCondition
A sampling condition that forces sampling when a span's name matches a pattern.
NoopCounter<T extends num>
No-op implementation of Counter instrument.
NoopGauge<T extends num>
No-op implementation of Gauge instrument.
NoopHistogram<T extends num>
No-op implementation of Histogram instrument.
NoopMeter
A no-op implementation of Meter that doesn't record any metrics.
NoopObservableCounter<T extends num>
No-op implementation of ObservableCounter instrument.
NoopObservableGauge<T extends num>
No-op implementation of ObservableGauge instrument.
NoopObservableUpDownCounter<T extends num>
No-op implementation of ObservableUpDownCounter instrument.
NoopUpDownCounter<T extends num>
No-op implementation of UpDownCounter instrument.
NumericStorage<T extends num>
Storage for metrics that have simple numeric input and output (sum, gauge).
ObservableCounter<T extends num>
ObservableCounter is an asynchronous instrument that reports monotonically increasing values when observed.
ObservableGauge<T extends num>
ObservableGauge is an asynchronous instrument which reports non-additive value(s) when the instrument is being observed.
ObservableResult<T extends num>
Implementation of the APIObservableResult interface for asynchronous instruments.
ObservableUpDownCounter<T extends num>
ObservableUpDownCounter is an asynchronous instrument that reports additive values when observed.
OTel
Main entry point for the OpenTelemetry SDK.
OTelEnv
Utility class for handling OpenTelemetry environment variables.
OTelLog
A simple log service that logs messages and signals to the console. It filters messages based on the current log level. Signals are not filtered based on log level Defaults to noop,
OTelSDKFactory
Factory implementation for creating OpenTelemetry SDK objects.
OTelSemantic
Base interface for OpenTelemetry semantic convention enums.
OtlpGrpcExporterConfig
Configuration for the OtlpGrpcSpanExporter.
OtlpGrpcMetricExporter
OtlpGrpcMetricExporter exports metrics to the OpenTelemetry collector via gRPC.
OtlpGrpcMetricExporterConfig
Configuration for the OtlpGrpcMetricExporter.
OtlpGrpcSpanExporter
An OpenTelemetry span exporter that exports spans using OTLP over gRPC.
OtlpHttpExporterConfig
Configuration for the OpenTelemetry span exporter that exports spans using OTLP over HTTP/protobuf
OtlpHttpMetricExporter
An OpenTelemetry metric exporter that exports metrics using OTLP over HTTP/protobuf
OtlpHttpMetricExporterConfig
Configuration for the OpenTelemetry metric exporter that exports metrics using OTLP over HTTP/protobuf
OtlpHttpSpanExporter
An OpenTelemetry span exporter that exports spans using OTLP over HTTP/protobuf
OtlpSpanTransformer
Transforms internal span representation to OTLP format
ParentBasedSampler
A sampler that respects the parent span's sampling decision.
PeriodicExportingMetricReader
PeriodicExportingMetricReader is a MetricReader that periodically collects metrics and exports them.
PlatformResourceDetector
Factory for creating platform-appropriate resource detectors.
PointStorage<T extends num>
PointStorage is the base class for all metric storage implementations.
ProbabilitySampler
A sampler that randomly samples traces based on a probability.
ProcessResourceDetector
Detects process-related resource information.
PrometheusExporter
PrometheusExporter exports metrics in Prometheus format. This can be exposed via an HTTP endpoint or written to a file. This could be used on Dart server but not Flutter clients since Prometheus is a pull model and expects stable http servers and a Flutter client typically can't provide that. Dartastic.io offers Prometheus for OTel by forwarding the OTLP data to use Prometheus. To forward OTLP to your own Prometheus backend you would configure an OTel collector similar to the following: receivers:
RateLimitingSampler
A sampler that limits the number of sampled traces per time window.
Resource
Represents a resource, which captures identifying information about the entities for which signals (stats, traces, and logs) are reported.
ResourceCreate<T>
Factory class for creating Resource instances.
ResourceDetector
Interface for resource detectors that automatically discover resource information.
Sampler
Interface for sampling decision logic.
SamplingCondition
Base class for sampling conditions that can be used with the CountingSampler to override its default behavior based on span properties.
SamplingResult
Result of a sampling decision.
SDKInstrument
BaseInstrument is the base class for all metric instruments.
SDKMeterProviderCreate
Internal constructor access for TracerProvider
SDKSpanCreate
Factory for creating Span instances.
SDKTracerCreate
Factory for creating Tracer instances.
SDKTracerProviderCreate
Factory for creating TracerProvider instances.
SimpleSpanProcessor
A simple SpanProcessor that exports spans synchronously when they end.
Span
SDK implementation of the APISpan interface.
SpanContext
Immutable representation of a SpanContext. A SpanContext contains the state that must propagate to child Spans and across process boundaries. SpanContext follows the W3C Trace Context specification.
SpanEvent
Represents an event that occurred during a span's lifetime.
SpanExporter
A SpanExporter exports finished Spans.
SpanId
A span identifier - an 8-byte array with an ID in a base-16 hex format. Follows W3C Trace Context specification.
Represents a link between spans in potentially different traces.
SpanProcessor
Interface for span processors that handle span lifecycle events.
SumStorage<T extends num>
Storage implementation for sum-based metrics like Counter and UpDownCounter.
Timestamp
Utility class for working with OpenTelemetry timestamps.
TraceFlags
Trace flags for a SpanContext. These flags are used to control tracing behavior. TraceFlags follows the W3C Trace Context specification.
TraceId
A trace identifier - a 16-byte array with an ID in a base-16 hex format. TraceId follows the W3C Trace Context specification.
TraceIdRatioSampler
A sampler that samples traces based on a probability defined by the ratio of traces that should be sampled. The ratio must be in the range 0.0, 1.0.
Tracer
SDK implementation of the APITracer interface.
TracerProvider
SDK implementation of the APITracerProvider interface.
TraceState
Key-value pairs carried along with a span context. TraceState follows the W3C Trace Context specification.
UpDownCounter<T extends num>
UpDownCounter is a synchronous instrument that records additive values.
View
View allows for customizing how metrics are collected and exported.
W3CBaggagePropagator
Implementation of the W3C Baggage specification for context propagation.
WebResourceDetector
Detects browser and web-specific resource information.

Enums

AggregationTemporality
Defines the aggregation temporality of a metric.
AggregationType
Aggregation defines how measurements for a metric are aggregated.
AppInfoSemantics
RUM Semantics related to application information
AppLifecycleSemantics
RUM Semantics related to application lifecycle events
ClientResource
Specification
CloudResource
Specification
ComputeInstanceResource
Specification
ComputeUnitResource
Specification
DatabaseResource
DeploymentResource
Specification
DeviceResource
Specification
DeviceSemantics
RUM Semantics related to device information
EnvironmentResource
Specification
ErrorResource
Specification
ErrorSemantics
RUM Semantics related to errors and crashes
ExceptionResource
ExportResult
Defines the result of a metric export operation.
FeatureFlagResource
OpenTelemetry Semantic Conventions - Feature Flag Attributes Specification
FileResource
OpenTelemetry Semantic Conventions - File Attributes Specification
GenAIResource
OpenTelemetry Semantic Conventions - GenAI Attributes Specification
GeneralResourceResource
GraphQLResource
HostResource
OpenTelemetry Semantic Conventions - Host Attributes Specification
HttpResource
InteractionSemantics
Semantics related to user interactions
KubernetesResource
Specification
LifecycleState
Application lifecycle states
MessagingResource
MetricPointKind
Defines the kind of metric point.
MetricType
Defines the type of metric.
Navigation actions in a UI context
RUM Semantics related to navigation and routing
NetworkResource
NetworkSemantics
RUM Semantics related to network
OperatingSystemResource
Specification
PerformanceSemantics
RUM Semantics related to performance measurements
ProcessResource
Specification
RPCResource
SamplingDecision
The possible decisions a sampler can make.
SamplingDecisionSource
Sources of sampling decisions.
ServiceResource
Specification
SessionViewSemantics
RUM Semantics related to session and view information
SourceCodeResource
Specification
SpanKind
Type of span. Can be used to specify additional relationships between spans in addition to a parent/child relationship.
SpanStatusCode
The set of canonical status codes.
TelemetryDistroResource
Specification
TelemetrySDKResource
Specification
UserSemantics
RUM Semantics related to user information
VersionResource
Specification

Extensions

AttributesExtension on Map<String, Object>
Extension to create Attributes from a simple Map
OTelSemanticExtension on OTelSemantic
Extension on OTelSemantic to provide utility methods.

Functions

otelSDKFactoryFactoryFunction({required String apiEndpoint, required String apiServiceName, required String apiServiceVersion}) → OTelFactory
Factory function that creates an OTelSDKFactory with the specified configuration.