writers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OtelWriter

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

OtelWriter is a custom writer that emits logs to an OTLP exporter using a LogEmitter. It implements the io.Writer interface, allowing it to be used with any function that accepts an io.Writer. The OtelWriter is designed to be used with the OpenTelemetry Go SDK.

func NewOtelWriter

func NewOtelWriter(source string) *OtelWriter

NewOtelWriter creates an OtelWriter using an OTLP exporter and LogEmitter with log.source tag set.

func (*OtelWriter) Write

func (ow *OtelWriter) Write(p []byte) (n int, err error)

Write implements the io.Writer interface for OtelWriter. It emits the raw bytes to the OTLP exporter using the LogEmitter.

Jump to

Keyboard shortcuts

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