Documentation
¶
Index ¶
- Constants
- Variables
- func InitObservableMetrics(callbacks ObservableCallbacks)
- func Int64ToUint64(nanos int64) uint64
- func TimeToUnixNanoUint64(t time.Time) uint64
- func WriterAsLogConsumer(w Writer) embed.LogConsumer
- type BlitzOutputActiveWorkersGaugeType
- type BlitzOutputEntriesReceivedCounterType
- type BlitzOutputEntryRateCounterType
- type BlitzOutputRequestLatencyHistogramType
- type BlitzOutputRequestSizeHistogramType
- type BlitzOutputSendErrorsCounterType
- type LogRecord
- type LogRecordMetadata
- type MetricRecord
- type MetricType
- type MetricWriter
- type ObservableCallbacks
- type Output
- type SpanKind
- type TraceRecord
- type TraceWriter
- type Writer
Constants ¶
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 )
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 ¶
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 )
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
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
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
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
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
type LogRecord ¶ added in v0.3.0
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 TraceRecord ¶ added in v0.16.0
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.