silk.trace.otlp.

OTLP/HTTP JSON encoding for recorder batches.

Import as OtlpJson with import silk.trace.otlp as OtlpJson.

Public declarations: 4.

Resource#

silk
pub struct Resource

Resource identity and cumulative drops at the time of a flush.

Field serviceName#

silk
pub serviceName: string<'static>

The value of the OTel service.name resource attribute.

Field serviceVersion#

silk
pub serviceVersion: string<'static>

The optional service.version value. An empty string omits it.

Field droppedSpans#

silk
pub droppedSpans: u64

Total spans discarded by this recorder or its destination.

Field droppedLogs#

silk
pub droppedLogs: u64

Total log records discarded by this recorder or its destination.

Field droppedMetrics#

silk
pub droppedMetrics: u64

Total metric updates or data points discarded.

Batch#

silk
pub union Batch<'a>

A borrowed batch for a single OTLP signal.

Spans#

silk
Spans

Completed spans, each carrying its instrumentation scope.

Field values#

silk
pub values: &'a [Span]

Logs#

silk
Logs

Completed log records, with optional span context.

Field values#

silk
pub values: &'a [LogRecord]

Metrics#

silk
Metrics

Cumulative metric snapshots. Set includeDrops on the last batch to report nonzero drop counters at time, in Unix nanoseconds.

Field values#

silk
pub values: &'a [MetricPoint]

Field includeDrops#

silk
pub includeDrops: bool

Field time#

silk
pub time: u64

write#

silk
pub effect fn write(identity: &Resource, batch: &Batch<'_>) -> () ! WriterError ? &mut Writer

Writes one complete OTLP export request, including its resource and instrumentation scopes.

encode#

silk
pub effect fn encode(identity: &Resource, batch: &Batch<'_>) -> Bytes ! WriterError | OutOfMemoryError ? &mut Allocator

Returns the complete request bytes for an OTLP/HTTP retry or a length-prefixed write.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page