opentelemetry

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceContextHeader = "x-trace-data"
	TracePathFormat    = "/api/v1/otlp/%s/traces"
)

Variables

This section is empty.

Functions

func InitTrace added in v1.5.0

func InitTrace(endPoint string, httpsEnabled bool, storePath string, tracingRatio float64, serviceName string) (*tracesdk.TracerProvider, error)

func InjectContextToRecord added in v1.5.0

func InjectContextToRecord(r arrow.Record, ctx context.Context) arrow.Record

func PutOtelContext

func PutOtelContext(octx *OtelContext)

Types

type InfluxRowsWriter

type InfluxRowsWriter interface {
	RetryWritePointRows(database, retentionPolicy string, points []influx.Row) error
}

type LogsWriter

type LogsWriter interface {
	WriteLogs(ctx context.Context, md plog.Logs) error
}

type MetricsWriter

type MetricsWriter interface {
	WriteMetrics(ctx context.Context, md pmetric.Metrics) error
}

type OtelContext added in v1.5.0

type OtelContext struct {
	ReqBuf bytesutil.ByteBuffer

	// write to rows
	PtraceWriter    TracesWriter
	PmetricWriter   MetricsWriter
	PlogWriter      LogsWriter
	Writer          InfluxRowsWriter
	Database        string
	RetentionPolicy string
	// contains filtered or unexported fields
}

func GetOtelContext

func GetOtelContext(r io.Reader) (*OtelContext, error)

func NewOtelContext added in v1.5.0

func NewOtelContext() *OtelContext

func (*OtelContext) EnqueuePoint added in v1.5.0

func (octx *OtelContext) EnqueuePoint(ctx context.Context, measurement string, tags map[string]string, fields map[string]interface{}, ts time.Time, vType common.InfluxMetricValueType) error

EnqueuePoint impl otel2influx.InfluxWriterBatch

func (*OtelContext) Error added in v1.5.0

func (octx *OtelContext) Error() error

Error returns the read or parser error, http code: 400

func (*OtelContext) Init added in v1.5.0

func (octx *OtelContext) Init(r io.Reader) error

func (*OtelContext) Instance added in v1.5.0

func (octx *OtelContext) Instance() *OtelContext

func (*OtelContext) MemSize added in v1.5.0

func (octx *OtelContext) MemSize() int

func (*OtelContext) NewBatch added in v1.5.0

func (octx *OtelContext) NewBatch() otel2influx.InfluxWriterBatch

NewBatch impl otel2influx.InfluxWriterBatch

func (*OtelContext) Read added in v1.5.0

func (octx *OtelContext) Read() bool

func (*OtelContext) WriteBatch added in v1.5.0

func (octx *OtelContext) WriteBatch(ctx context.Context) error

WriteBatch impl otel2influx.InfluxWriterBatch

func (*OtelContext) WriteLogs added in v1.5.0

func (octx *OtelContext) WriteLogs(ctx context.Context) error

func (*OtelContext) WriteMetrics added in v1.5.0

func (octx *OtelContext) WriteMetrics(ctx context.Context) error

func (*OtelContext) WriteTraces added in v1.5.0

func (octx *OtelContext) WriteTraces(ctx context.Context) error

type OtlpMetricWriter added in v1.5.0

type OtlpMetricWriter struct {
	Logger common.Logger
	Writer otel2influx.InfluxWriter
}

func (*OtlpMetricWriter) WriteMetrics added in v1.5.0

func (c *OtlpMetricWriter) WriteMetrics(ctx context.Context, md pmetric.Metrics) error

type TracesWriter

type TracesWriter interface {
	WriteTraces(ctx context.Context, md ptrace.Traces) error
}

Jump to

Keyboard shortcuts

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