otlpingest

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 17 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 otlpingest decodes OTLP/HTTP trace exports into stored spans.

Index

Constants

View Source
const MaxSpansPerRequest = 5000

MaxSpansPerRequest bounds one export, so a single request cannot be an unbounded write.

Variables

View Source
var ErrNoValidSpans = errors.New("otlp: no span had a 16 byte trace id and an 8 byte span id")

ErrNoValidSpans is returned when an export held spans but none had valid ids, so the sender learns its ids are malformed instead of seeing success.

View Source
var ErrTooMany = errors.New("otlp: too many records in one request")

ErrTooMany is returned when a request carries more records than the limit.

View Source
var ErrUnsupportedType = errors.New("otlp: content type must be application/x-protobuf or application/json")

ErrUnsupportedType is returned for a content type that is neither OTLP protobuf nor OTLP JSON.

Functions

func DecodeLogs

func DecodeLogs(contentType string, body []byte, resourceID string, maxRecords, maxLine int) ([]telemetry.LogEntry, error)

DecodeLogs maps an OTLP logs export onto log entries for resourceID. Only the body text is kept: attributes may hold secrets and have no column.

func DecodeMetrics

func DecodeMetrics(contentType string, body []byte, resourceID string, maxPoints int) ([]telemetry.Sample, error)

DecodeMetrics maps gauge, sum and histogram points onto samples named "otlp.<metric>". Attributes are dropped so cardinality stays bounded; two series that differ only by attributes share one name and the later point wins.

func DecodeTraces

func DecodeTraces(contentType string, body []byte, resourceID string) ([]telemetry.Span, error)

DecodeTraces parses one export request and returns its spans stamped with resourceID. The sender's own service.name is kept as an attribute but never decides which app the spans belong to.

Types

This section is empty.

Jump to

Keyboard shortcuts

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