impl Default for BatchConfigfn BatchConfig::new(max_queue_size? : Int, max_export_batch_size? : Int, scheduled_delay_millis? : Int, export_timeout_millis? : Int) -> BatchConfigpub struct Config {
sampler : Sampler
id_generator : IdGenerator
span_limits : SpanLimits
resource : Resource
}fn Config::new(sampler? : Sampler, id_generator? : IdGenerator, span_limits? : SpanLimits, resource? : Resource) -> Configpub struct Sampler {
should_sample_fn : (SamplingParameters) -> SamplingResult
description_fn : () -> String
}fn Sampler::new(should_sample_fn : (SamplingParameters) -> SamplingResult, description_fn : () -> String) -> Samplerpub struct SamplingResult {
decision : SamplingDecision
attributes : Array[KeyValue]
trace_state : TraceState
} derive(Eq, ToJson, Debug)fn SamplingResult::new(decision : SamplingDecision, attributes? : ArrayView[KeyValue], trace_state? : TraceState) -> SamplingResultasync fn SdkTracerProvider::shutdown_with_timeout(self : SdkTracerProvider, timeout_millis : Int) -> Result[Unit, OTelSdkError]fn SdkTracerProvider::spawn_batch_processor_tasks(self : SdkTracerProvider, group : TaskGroup[Unit], allow_failure? : Bool) -> Unitfn SdkTracerProvider::tracer(self : SdkTracerProvider, name : StringView, version? : String?, schema_url? : String?, attributes? : ArrayView[KeyValue]) -> SdkTracerpub struct SdkTracerProviderBuilder {
config : Config
processors : Array[SpanProcessor]
batch_processors : Array[BatchSpanProcessor]
}fn SdkTracerProviderBuilder::with_batch_exporter(self : SdkTracerProviderBuilder, exporter : SpanExporter, config? : BatchConfig) -> SdkTracerProviderBuilderfn SdkTracerProviderBuilder::with_config(self : SdkTracerProviderBuilder, config : Config) -> SdkTracerProviderBuilderfn SdkTracerProviderBuilder::with_id_generator(self : SdkTracerProviderBuilder, id_generator : IdGenerator) -> SdkTracerProviderBuilderfn SdkTracerProviderBuilder::with_resource(self : SdkTracerProviderBuilder, resource : Resource) -> SdkTracerProviderBuilderfn SdkTracerProviderBuilder::with_sampler(self : SdkTracerProviderBuilder, sampler : Sampler) -> SdkTracerProviderBuilderfn SdkTracerProviderBuilder::with_simple_exporter(self : SdkTracerProviderBuilder, exporter : SpanExporter) -> SdkTracerProviderBuilderfn SdkTracerProviderBuilder::with_span_limits(self : SdkTracerProviderBuilder, span_limits : SpanLimits) -> SdkTracerProviderBuilderfn SdkTracerProviderBuilder::with_span_processor(self : SdkTracerProviderBuilder, processor : SpanProcessor) -> SdkTracerProviderBuilderfn Span::add_link(self : Span, span_context : SpanContext, attributes? : ArrayView[KeyValue], dropped_attributes_count? : Int) -> Unitpub struct SpanData {
name : String
span_context : SpanContext
parent_span_context : SpanContext?
kind : SpanKind
start_time_unix_nano : Int64
end_time_unix_nano : Int64?
attributes : Array[KeyValue]
dropped_attributes_count : Int
events : Array[SpanEvent]
dropped_events_count : Int
links : Array[SpanLink]
dropped_links_count : Int
status : Status
resource : Resource
instrumentation_scope : InstrumentationScope
} derive(Eq, ToJson, Debug)pub struct SpanExporter {
export_fn : async (ArrayView[SpanData]) -> Result[Unit, OTelSdkError]
force_flush_fn : async () -> Result[Unit, OTelSdkError]
shutdown_fn : async () -> Result[Unit, OTelSdkError]
name_fn : () -> String
}async fn SpanExporter::export_batch(self : SpanExporter, batch : ArrayView[SpanData]) -> Result[Unit, OTelSdkError]fn SpanExporter::new(export_fn : async (ArrayView[SpanData]) -> Result[Unit, OTelSdkError], force_flush_fn? : async () -> Result[Unit, OTelSdkError], shutdown_fn? : async () -> Result[Unit, OTelSdkError], name_fn? : () -> String) -> SpanExporterasync fn SpanExporter::shutdown_with_timeout(self : SpanExporter, timeout_millis : Int) -> Result[Unit, OTelSdkError]impl Default for SpanLimitsfn SpanLimits::new(max_attributes_per_span? : Int, max_events_per_span? : Int, max_links_per_span? : Int, max_attributes_per_event? : Int, max_attributes_per_link? : Int) -> SpanLimitspub struct SpanProcessor {
on_start_fn : (Context, SpanData) -> Unit
on_end_fn : async (SpanData) -> Unit
force_flush_fn : async () -> Result[Unit, OTelSdkError]
shutdown_fn : async () -> Result[Unit, OTelSdkError]
}fn SpanProcessor::new(on_start_fn? : (Context, SpanData) -> Unit, on_end_fn? : async (SpanData) -> Unit, force_flush_fn? : async () -> Result[Unit, OTelSdkError], shutdown_fn? : async () -> Result[Unit, OTelSdkError]) -> SpanProcessorfn SpanProcessor::on_start(self : SpanProcessor, parent_context : Context, span_data : SpanData) -> Unitasync fn SpanProcessor::shutdown_with_timeout(self : SpanProcessor, timeout_millis : Int) -> Result[Unit, OTelSdkError]Install
Download zipThe MoonBit implementation of OpenTelemetry.
Dependencies