otlpdecode

package
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package otlpdecode converts OTLP protobuf directly into native signal batches. Converters retain scratch and borrow input bytes until their next conversion. An ingest sink must copy the data it retains.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dropped

type Dropped struct {
	// Points is the number of number data points carrying neither as_double nor as_int.
	Points int
	// Exemplars is the number of exemplars with no home: those on histogram,
	// exponential-histogram and summary points (stored by classic decomposition, which leaves an
	// exemplar no unambiguous series to hang off), those on a dropped point, and value-less ones.
	Exemplars int
}

Dropped counts what a metrics conversion could not represent. It mirrors github.com/oteldb/storage/otlp/pdataconv.Dropped field for field, so the direct decoder and the pdata path report the same numbers for the same request.

type LogsConverter

type LogsConverter struct {
	// contains filtered or unexported fields
}

LogsConverter decodes an OTLP ExportLogsServiceRequest into log.Logs. It retains the batch and the scratch it is built from, so a converter reused across requests allocates nothing in steady state. It is not safe for concurrent use; pool one per in-flight request.

func (*LogsConverter) Convert

func (c *LogsConverter) Convert(src []byte) (_ *log.Logs, dropped int, _ error)

Convert decodes a serialized ExportLogsServiceRequest, returning how many records it could not represent (a record carrying no usable time — see [LogsConverter.record]).

The returned batch aliases src: every key, string value, body and id is a sub-slice of it. It stays valid until the next Convert on this converter, and src must not be recycled until the write consuming the batch has returned.

type MetricsConverter

type MetricsConverter struct {
	// contains filtered or unexported fields
}

MetricsConverter decodes an OTLP ExportMetricsServiceRequest into metric.Metrics. It retains the batch and the scratch it is built from, so a converter reused across requests allocates nothing in steady state. It is not safe for concurrent use; pool one per in-flight request.

func (*MetricsConverter) Convert

func (c *MetricsConverter) Convert(src []byte) (_ *metric.Metrics, dropped Dropped, _ error)

Convert decodes a serialized ExportMetricsServiceRequest, returning what it could not represent.

The returned batch aliases src: every attribute key, string value, metric name and unit is a sub-slice of it. It stays valid until the next Convert on this converter, and src must not be recycled until the write consuming the batch has returned.

type ProfilesConverter

type ProfilesConverter struct {
	// contains filtered or unexported fields
}

ProfilesConverter decodes an OTLP ExportProfilesServiceRequest into profile.Profiles. It retains the batch and the scratch it is built from, so a converter reused across requests allocates nothing in steady state. It is not safe for concurrent use; pool one per in-flight request.

func (*ProfilesConverter) Convert

func (c *ProfilesConverter) Convert(src []byte) (*profile.Profiles, error)

Convert decodes a serialized ExportProfilesServiceRequest.

The returned batch aliases src: every string-table entry, id and attribute key is a sub-slice of it. It stays valid until the next Convert on this converter, and src must not be recycled until the write consuming the batch has returned.

type TracesConverter

type TracesConverter struct {
	// contains filtered or unexported fields
}

TracesConverter decodes an OTLP ExportTraceServiceRequest into trace.Traces. It retains the batch and the scratch it is built from, so a converter reused across requests allocates nothing in steady state. It is not safe for concurrent use; pool one per in-flight request.

func (*TracesConverter) Convert

func (c *TracesConverter) Convert(src []byte) (*trace.Traces, error)

Convert decodes a serialized ExportTraceServiceRequest.

The returned batch aliases src: every key, name, id and string value is a sub-slice of it. It stays valid until the next Convert on this converter, and src must not be recycled until the write consuming the batch has returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL