pdataconv

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pdataconv is the optional OTel-Go bridge: it converts the collector pdata metrics type (pmetric.Metrics) into the storage library's internal, []byte-based metric.Metrics ingest batch. It exists so OTel users get zero-friction ingestion without the pdata dependency or its allocation profile reaching the storage hot path — pdata is referenced only here, never by the core packages or the storage facade.

The conversion necessarily allocates: pdata stores keys/values as Go strings, so projecting them to the internal []byte model copies each one. Embedders that decode OTLP protobuf themselves should build metric.Metrics directly (aliasing the decode buffer) to stay allocation-free; this bridge is the compatibility path, not the fast path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendMetrics

func AppendMetrics(dst *metric.Metrics, md pmetric.Metrics) (dropped int)

AppendMetrics converts an OTLP metrics batch into dst, reusing dst's retained capacity (call metric.Metrics.Reset or use metric.GetMetrics for a recycled batch). Only gauge and sum number points are representable today; histogram, exponential-histogram, and summary points, plus value-less number points, are skipped and counted in dropped so the caller can fold them into an OTLP partial-success response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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