Dependencies
pub(open) trait JsonHttpClient {
async http_post_json(Self, url : String, body : String, headers : Map[String, String]) -> Result[HttpResponse, HttpError]
}pub(open) trait ProtobufHttpClient {
async http_post_protobuf(Self, url : String, body : Bytes, headers : Map[String, String]) -> Result[HttpResponse, HttpError]
}pub(open) trait SpanExporter {
async export_spans(Self, Array[Span]) -> Unit
async shutdown(Self) -> Unit
enable_batch_export(self : Self, options? : BatchExporterOptions) -> BatchExporter = _
}pub(all) enum AttributeValue {
String(String)
Int(Int)
Bool(Bool)
Double(Double)
}impl Default for Attributespub struct BatchExporter {
// private fields
}pub struct BatchExporterOptions {
max_queue_size : Int
schedule_delay_millis : Int
export_timeout_millis : Int
max_export_batch_size : Int
set_timeout : async (Int, async () -> Unit noraise) -> Unit
logger_factory : () -> InternalLogger
}impl Default for BatchExporterOptionsfn BatchExporterOptions::enable_debug_log(self : BatchExporterOptions, print : (&Show) -> Unit) -> BatchExporterOptionsfn BatchExporterOptions::with_export_timeout_millis(self : BatchExporterOptions, millis : Int) -> BatchExporterOptionsfn BatchExporterOptions::with_max_export_batch_size(self : BatchExporterOptions, size : Int) -> BatchExporterOptionsfn BatchExporterOptions::with_max_queue_size(self : BatchExporterOptions, size : Int) -> BatchExporterOptionsfn BatchExporterOptions::with_schedule_delay_millis(self : BatchExporterOptions, millis : Int) -> BatchExporterOptionsfn BatchExporterOptions::with_set_timeout(self : BatchExporterOptions, set_timeout : async (Int, async () -> Unit noraise) -> Unit) -> BatchExporterOptionspub struct BatchSpanProcessor {
// private fields
}impl SpanProcessor for BatchSpanProcessorfn BatchSpanProcessor::new(exporter : &SpanExporter, options? : BatchSpanProcessorOptions) -> BatchSpanProcessorpub struct BatchSpanProcessorOptions {
max_queue_size : Int
schedule_delay_millis : Int
export_timeout_millis : Int
max_export_batch_size : Int
set_timeout : async (Int, async () -> Unit noraise) -> Unit
logger_factory : () -> InternalLogger
}impl Default for BatchSpanProcessorOptionsfn BatchSpanProcessorOptions::enable_debug_log(self : BatchSpanProcessorOptions, print : (&Show) -> Unit) -> BatchSpanProcessorOptionsfn BatchSpanProcessorOptions::with_export_timeout_millis(self : BatchSpanProcessorOptions, millis : Int) -> BatchSpanProcessorOptionsfn BatchSpanProcessorOptions::with_max_export_batch_size(self : BatchSpanProcessorOptions, size : Int) -> BatchSpanProcessorOptionsfn BatchSpanProcessorOptions::with_max_queue_size(self : BatchSpanProcessorOptions, size : Int) -> BatchSpanProcessorOptionsfn BatchSpanProcessorOptions::with_schedule_delay_millis(self : BatchSpanProcessorOptions, millis : Int) -> BatchSpanProcessorOptionsfn BatchSpanProcessorOptions::with_set_timeout(self : BatchSpanProcessorOptions, set_timeout : async (Int, async () -> Unit noraise) -> Unit) -> BatchSpanProcessorOptionstype Contexttype ContextValuepub(all) enum ExportAdapter {
HttpJson(HttpJsonSendAdaptor)
HttpProtobuf(HttpProtobufSendAdaptor)
Stdout(StdoutSendAdaptor)
}pub(all) enum HttpError {
NetworkError(String)
RequestError(String)
HttpStatusError(Int, String)
InvalidResponse(String)
TimeoutError(String)
SecurityError(String)
}pub(all) struct HttpJsonSendAdaptor {
client_provider : &JsonHttpClientProvider
endpoint : String
headers : Map[String, String]
}fn HttpJsonSendAdaptor::new(client_provider : &JsonHttpClientProvider, endpoint? : String, headers? : Map[String, String]) -> HttpJsonSendAdaptorpub(all) struct HttpProtobufSendAdaptor {
client_provider : &ProtobufHttpClientProvider
endpoint : String
headers : Map[String, String]
}fn HttpProtobufSendAdaptor::new(client_provider : &ProtobufHttpClientProvider, endpoint? : String, headers? : Map[String, String]) -> HttpProtobufSendAdaptorpub(all) struct HttpRequest {
url : String
http_method : String
headers : Map[String, String]
body : String
}pub(all) struct HttpResponse {
status_code : Int
body : String
error_code : Int?
}impl ToJson for HttpResponseimpl FromJson for HttpResponseimpl SpanExporter for OTLPExporterasync fn OTLPExporter::export_spans_by_json_http_client(self : OTLPExporter, json_body : String, http_client : &JsonHttpClient, http_adaptor : HttpJsonSendAdaptor, spans : Array[Span]) -> Unitasync fn OTLPExporter::export_spans_by_protobuf_http_client(self : OTLPExporter, protobuf_body : Bytes, http_client : &ProtobufHttpClient, http_adaptor : HttpProtobufSendAdaptor, spans : Array[Span]) -> Unitpub struct OTLPExporterOptions {
logger_factory : () -> InternalLogger
export_adapter : ExportAdapter
}fn OTLPExporterOptions::enable_debug_log(self : OTLPExporterOptions, print~ : (&Show) -> Unit) -> OTLPExporterOptionsfn OTLPExporterOptions::http_json(client_provider : &JsonHttpClientProvider, endpoint? : String, headers? : Map[String, String]) -> OTLPExporterOptionsfn OTLPExporterOptions::http_protobuf(client_provider : &ProtobufHttpClientProvider, endpoint? : String, headers? : Map[String, String]) -> OTLPExporterOptionspub struct OtlpResourceSpan {
resource : Resource
scope_spans : Array[OtlpScopeSpan]
schemaUrl : String?
}impl ToJson for OtlpResourceSpanimpl ToJson for OtlpResourceSpansfn OtlpResourceSpans::from_map(map : Map[Resource, Map[TracerIdentifier, Array[Span]]]) -> OtlpResourceSpanspub struct OtlpScope {
name : String
version : String
}impl ToJson for OtlpScopeSpanpub struct PrettyPrintExporter {
print_fn : (String) -> Unit
}impl SpanExporter for PrettyPrintExporterpub struct Span {
traceId : TraceID
spanId : SpanID
trace_state : TraceState
parent_span_id : SpanID?
trace_flags : TraceFlags
name : String
kind : SpanKind
start_time_unix_nano : Int64
end_time_unix_nano : Int64?
attributes : Attributes
dropped_attributes_count : Int
events : Array[SpanEvent]
links : Array[SpanLink]
dropped_events_count : Int
status : SpanStatus
resource : Resource
tracer_identifier : TracerIdentifier
on_end : (Span) -> Unit?
}impl SpanContextExtractable for Spanfn Span::new(context : SpanContext, name : String, kind : SpanKind, start_time : Int64, resource : Resource, tracer_identifier : TracerIdentifier, parent_span_id : SpanID?, on_end? : (Span) -> Unit) -> Spanpub struct SpanBuilder {
// private fields
}fn SpanBuilder::new(name : String, resource : Resource, tracer_identifier : TracerIdentifier, tracer_options : TracerOptions) -> SpanBuilderpub struct SpanContext {
trace_id : TraceID
span_id : SpanID
trace_flags : TraceFlags
is_remote : Bool
}impl ToJson for SpanContextimpl SpanContextExtractable for SpanContextfn SpanContext::new(trace_id : TraceID, span_id : SpanID, trace_flags : TraceFlags, is_remote : Bool) -> SpanContextpub struct SpanID {
value : String
}pub(all) enum SpanKind {
Unspecified
Internal
Server
Client
Producer
Consumer
}pub struct SpanLink {
trace_id : TraceID
span_id : SpanID
trace_state : TraceState
trace_flags : TraceFlags
attributes : Attributes
}fn SpanLink::from_span_context(context : SpanContext, trace_state : TraceState, attributes : Attributes) -> SpanLinkpub(all) enum SpanStatus {
Unset
Ok
Error
}impl Eq for SpanStatusimpl Show for SpanStatusimpl ToJson for SpanStatuspub(all) struct StdoutSendAdaptor {
print : (String) -> Unit
}pub struct TraceFlags {
// private fields
}pub struct TraceID {
value : String
}pub struct TraceState {
// private fields
}impl Eq for TraceStateimpl Show for TraceStatefn Tracer::span_event(self : Tracer, name : String, attributes? : Attributes, event_time? : Int64?) -> SpanEventfn Tracer::start_span(self : Tracer, name : String, kind? : SpanKind, parent? : &SpanContextExtractable, attributes? : Attributes) -> Spanfn Tracer::with_options(name : String, version : String, resource : Resource, options : TracerOptions) -> Tracerpub struct TracerIdentifier {
name : String
version : String
}impl Eq for TracerIdentifierimpl Hash for TracerIdentifierfn TracerOptions::with_current_time_fn(self : TracerOptions, time_fn : () -> Int64) -> TracerOptionsfn TracerOptions::with_span_id_generator(self : TracerOptions, generator : () -> SpanID) -> TracerOptionsfn TracerOptions::with_span_on_end(self : TracerOptions, on_end_fn : (Span) -> Unit) -> TracerOptionsfn TracerOptions::with_span_on_start(self : TracerOptions, on_start_fn : (Span) -> Unit) -> TracerOptionsfn TracerOptions::with_trace_id_generator(self : TracerOptions, generator : () -> TraceID) -> TracerOptionspub struct TracerProvider {
tracer_factory : (TracerOptions) -> Tracer
span_processors : Array[&SpanProcessor]
options : TracerOptions
}fn TracerProvider::new(name : String, version : String, resource : Resource, options? : TracerOptions, processors? : Array[&SpanProcessor]) -> TracerProviderfn TracerProvider::with_span_processors(self : TracerProvider, processors : Array[&SpanProcessor]) -> TracerProviderInstall
Download zipDependencies