output

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MetricTypeGauge represents a gauge metric.
	MetricTypeGauge = embed.MetricTypeGauge
	// MetricTypeSum represents a sum metric.
	MetricTypeSum = embed.MetricTypeSum
	// MetricTypeCounter represents a counter metric.
	MetricTypeCounter = embed.MetricTypeCounter
	// MetricTypeHistogram represents a histogram metric.
	MetricTypeHistogram = embed.MetricTypeHistogram
)
View Source
const (
	// SpanKindInternal represents an internal span.
	SpanKindInternal = embed.SpanKindInternal
	// SpanKindServer represents a server span.
	SpanKindServer = embed.SpanKindServer
	// SpanKindClient represents a client span.
	SpanKindClient = embed.SpanKindClient
	// SpanKindProducer represents a producer span.
	SpanKindProducer = embed.SpanKindProducer
	// SpanKindConsumer represents a consumer span.
	SpanKindConsumer = embed.SpanKindConsumer
)

Variables

View Source
var (

	// BlitzOutputEntriesReceivedCounter tracks the total number of log entries received by the output
	BlitzOutputEntriesReceivedCounter BlitzOutputEntriesReceivedCounterType

	// BlitzOutputActiveWorkersGauge tracks the number of active output worker goroutines
	BlitzOutputActiveWorkersGauge BlitzOutputActiveWorkersGaugeType

	// BlitzOutputEntryRateCounter tracks the rate of log entries processed per second
	BlitzOutputEntryRateCounter BlitzOutputEntryRateCounterType

	// BlitzOutputRequestSizeHistogram tracks the size of output requests in bytes
	BlitzOutputRequestSizeHistogram BlitzOutputRequestSizeHistogramType

	// BlitzOutputRequestLatencyHistogram tracks the latency of output requests
	BlitzOutputRequestLatencyHistogram BlitzOutputRequestLatencyHistogramType

	// BlitzOutputSendErrorsCounter tracks the total number of send errors
	BlitzOutputSendErrorsCounter BlitzOutputSendErrorsCounterType
)
View Source
var ErrUnsupportedTelemetryType = errors.New("unsupported telemetry type")

ErrUnsupportedTelemetryType is returned when an output does not support the requested telemetry type.

Functions

func InitObservableMetrics added in v0.14.0

func InitObservableMetrics(callbacks ObservableCallbacks)

InitObservableMetrics initializes observable metrics with the provided callbacks

func Int64ToUint64 added in v0.4.0

func Int64ToUint64(nanos int64) uint64

Int64ToUint64 safely converts an int64 timestamp to uint64. UnixNano() returns int64 but OTLP protobuf requires uint64. Since timestamps are always non-negative (nanoseconds since Unix epoch), this conversion is safe. However, we validate to satisfy static analysis tools.

func TimeToUnixNanoUint64 added in v0.4.0

func TimeToUnixNanoUint64(t time.Time) uint64

TimeToUnixNanoUint64 converts a time.Time to uint64 nanoseconds. This is a convenience wrapper around Int64ToUint64 for better readability.

func WriterAsLogConsumer added in v0.16.0

func WriterAsLogConsumer(w Writer) embed.LogConsumer

WriterAsLogConsumer wraps a Writer so it can be used in contexts that expect an embed.LogConsumer. The adapter pushes each record in the batch through Writer.Write in order, returning the first error it encounters.

CLI generator wiring uses this adapter to bridge migrated modules (which talk to embed.LogConsumer) with the existing Output instances (which implement Writer).

Types

type BlitzOutputActiveWorkersGaugeType added in v0.14.0

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

BlitzOutputActiveWorkersGaugeType wraps the blitz.output.active_workers metric with type-safe required attributes

func (BlitzOutputActiveWorkersGaugeType) Record added in v0.14.0

func (m BlitzOutputActiveWorkersGaugeType) Record(ctx context.Context, value int64, outputType string, opts ...metric.RecordOption)

Record records a value for blitz.output.active_workers with required attributes

type BlitzOutputEntriesReceivedCounterType added in v0.14.0

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

BlitzOutputEntriesReceivedCounterType wraps the blitz.output.entries_received metric with type-safe required attributes

func (BlitzOutputEntriesReceivedCounterType) Add added in v0.14.0

func (m BlitzOutputEntriesReceivedCounterType) Add(ctx context.Context, value int64, outputType string, telemetryType string, opts ...metric.AddOption)

Add records a value for blitz.output.entries_received with required attributes

type BlitzOutputEntryRateCounterType added in v0.14.0

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

BlitzOutputEntryRateCounterType wraps the blitz.output.entry_rate metric with type-safe required attributes

func (BlitzOutputEntryRateCounterType) Add added in v0.14.0

func (m BlitzOutputEntryRateCounterType) Add(ctx context.Context, value float64, outputType string, telemetryType string, opts ...metric.AddOption)

Add records a value for blitz.output.entry_rate with required attributes

type BlitzOutputRequestLatencyHistogramType added in v0.14.0

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

BlitzOutputRequestLatencyHistogramType wraps the blitz.output.request_latency metric with type-safe required attributes

func (BlitzOutputRequestLatencyHistogramType) Record added in v0.14.0

func (m BlitzOutputRequestLatencyHistogramType) Record(ctx context.Context, value float64, outputType string, telemetryType string, opts ...metric.RecordOption)

Record records a value for blitz.output.request_latency with required attributes

type BlitzOutputRequestSizeHistogramType added in v0.14.0

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

BlitzOutputRequestSizeHistogramType wraps the blitz.output.request_size metric with type-safe required attributes

func (BlitzOutputRequestSizeHistogramType) Record added in v0.14.0

func (m BlitzOutputRequestSizeHistogramType) Record(ctx context.Context, value int64, outputType string, telemetryType string, opts ...metric.RecordOption)

Record records a value for blitz.output.request_size with required attributes

type BlitzOutputSendErrorsCounterType added in v0.14.0

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

BlitzOutputSendErrorsCounterType wraps the blitz.output.send_errors metric with type-safe required attributes

func (BlitzOutputSendErrorsCounterType) Add added in v0.14.0

func (m BlitzOutputSendErrorsCounterType) Add(ctx context.Context, value int64, outputType string, telemetryType string, opts ...metric.AddOption)

Add records a value for blitz.output.send_errors with required attributes

type LogRecord added in v0.3.0

type LogRecord = embed.LogRecord

LogRecord aliases embed.LogRecord; defined here for backward compatibility with existing output and generator callers. The canonical definition lives in the embed package.

type LogRecordMetadata added in v0.3.0

type LogRecordMetadata = embed.LogRecordMetadata

LogRecordMetadata aliases embed.LogRecordMetadata.

type MetricRecord added in v0.16.0

type MetricRecord = embed.MetricPoint

MetricRecord aliases embed.MetricPoint. The embed canonical name is MetricPoint; this alias preserves the older MetricRecord name for existing call sites while later PRs migrate to the new name.

type MetricType added in v0.16.0

type MetricType = embed.MetricType

MetricType aliases embed.MetricType.

type MetricWriter added in v0.16.0

type MetricWriter interface {
	// WriteMetric writes a metric record to the output.
	WriteMetric(ctx context.Context, data MetricRecord) error
}

MetricWriter can consume metric records.

type ObservableCallbacks added in v0.14.0

type ObservableCallbacks interface {
	ObserveBlitzOutputQueueSize(ctx context.Context, observer metric.Int64Observer) error
}

ObservableCallbacks defines the callback interface for observable metrics

type Output

type Output interface {
	Writer

	// Stop stops the output.
	Stop(ctx context.Context) error

	// SupportedTelemetry returns the telemetry types this output can consume.
	SupportedTelemetry() []telemetry.Type
}

Output is the interface for outputting data.

type SpanKind added in v0.16.0

type SpanKind = embed.SpanKind

SpanKind aliases embed.SpanKind.

type TraceRecord added in v0.16.0

type TraceRecord = embed.Span

TraceRecord aliases embed.Span. The embed canonical name is Span; this alias preserves the older TraceRecord name for existing call sites.

type TraceWriter added in v0.16.0

type TraceWriter interface {
	// WriteTrace writes a trace record to the output.
	WriteTrace(ctx context.Context, data TraceRecord) error
}

TraceWriter can consume trace records.

type Writer added in v0.3.0

type Writer interface {
	// Write writes the data to the output.
	Write(ctx context.Context, data LogRecord) error
}

Writer can consume log records.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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