Documentation
¶
Overview ¶
Package otel provides in-process OTLP telemetry storage and a receiver.
Index ¶
- type LogQuery
- type LogRecordPayload
- type LogSeverity
- type MetricPoint
- type MetricQuery
- type MetricSeriesQuery
- type MetricType
- type MetricUpdatePayload
- type Receiver
- type ServiceStatusChangePayload
- type SpanEvent
- type SpanKind
- type SpanQuery
- type SpanStatus
- type Store
- func (s *Store) GetMetricSeries(q *MetricSeriesQuery) []MetricPoint
- func (s *Store) GetRelated(traceID string) ([]StoredLog, []StoredMetric)
- func (s *Store) GetTrace(traceID string) (TraceDetail, bool)
- func (s *Store) InsertLog(log StoredLog)
- func (s *Store) InsertMetric(m StoredMetric)
- func (s *Store) InsertSpan(span StoredSpan)
- func (s *Store) QueryLogs(q *LogQuery) []StoredLog
- func (s *Store) QueryMetrics(q *MetricQuery) []StoredMetric
- func (s *Store) QueryTraces(q *SpanQuery) []TraceSummary
- func (s *Store) Status() SystemStatus
- func (s *Store) SweepRetention()
- type StoredLog
- type StoredMetric
- type StoredSpan
- type SystemStatus
- type TraceDetail
- type TraceSummary
- type TraceUpdatePayload
- type WSEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogRecordPayload ¶
type LogSeverity ¶
type LogSeverity string
const ( SeverityTrace LogSeverity = "Trace" SeverityDebug LogSeverity = "Debug" SeverityInfo LogSeverity = "Info" SeverityWarn LogSeverity = "Warn" SeverityError LogSeverity = "Error" SeverityFatal LogSeverity = "Fatal" )
func SeverityFromNumber ¶
func SeverityFromNumber(n int32) LogSeverity
func SeverityFromString ¶
func SeverityFromString(s string) LogSeverity
func (LogSeverity) Rank ¶
func (s LogSeverity) Rank() int
Rank orders severities for minimum-level filtering (Trace < … < Fatal).
type MetricPoint ¶
MetricPoint is a time-series datapoint.
type MetricQuery ¶
type MetricSeriesQuery ¶
type MetricType ¶
type MetricType string
const ( MetricGauge MetricType = "Gauge" MetricCounter MetricType = "Counter" MetricHistogram MetricType = "Histogram" )
type MetricUpdatePayload ¶
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver holds an in-process OTLP HTTP + gRPC listener.
func NewReceiver ¶
NewReceiver creates an OTLP receiver that ingests into store and publishes WSEvents to eventsCh.
type SpanStatus ¶
type SpanStatus string
const ( SpanStatusOk SpanStatus = "Ok" SpanStatusError SpanStatus = "Error" SpanStatusUnset SpanStatus = "Unset" )
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory ring-buffer telemetry store with secondary indexes.
func (*Store) GetMetricSeries ¶
func (s *Store) GetMetricSeries(q *MetricSeriesQuery) []MetricPoint
func (*Store) GetRelated ¶
func (s *Store) GetRelated(traceID string) ([]StoredLog, []StoredMetric)
func (*Store) InsertMetric ¶
func (s *Store) InsertMetric(m StoredMetric)
func (*Store) InsertSpan ¶
func (s *Store) InsertSpan(span StoredSpan)
func (*Store) QueryMetrics ¶
func (s *Store) QueryMetrics(q *MetricQuery) []StoredMetric
func (*Store) QueryTraces ¶
func (s *Store) QueryTraces(q *SpanQuery) []TraceSummary
func (*Store) Status ¶
func (s *Store) Status() SystemStatus
func (*Store) SweepRetention ¶
func (s *Store) SweepRetention()
SweepRetention removes records older than the retention window.
type StoredLog ¶
type StoredLog struct {
RecordID uint64 `json:"record_id"`
Timestamp time.Time `json:"timestamp"`
ServiceName string `json:"service_name"`
Severity LogSeverity `json:"severity"`
Body string `json:"body"`
TraceID *string `json:"trace_id"`
SpanID *string `json:"span_id"`
Attributes [][2]string `json:"attributes"`
}
type StoredMetric ¶
type StoredMetric struct {
RecordID uint64 `json:"record_id"`
Timestamp time.Time `json:"timestamp"`
ServiceName string `json:"service_name"`
MetricName string `json:"metric_name"`
MetricType MetricType `json:"metric_type"`
Value float64 `json:"value"`
Attributes [][2]string `json:"attributes"`
Unit *string `json:"unit"`
}
type StoredSpan ¶
type StoredSpan struct {
RecordID uint64 `json:"record_id"`
TraceID string `json:"trace_id"`
SpanID string `json:"span_id"`
ParentSpanID *string `json:"parent_span_id"`
ServiceName string `json:"service_name"`
OperationName string `json:"operation_name"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
DurationMs uint64 `json:"duration_ms"`
Status SpanStatus `json:"status"`
StatusMessage *string `json:"status_message"`
Attributes [][2]string `json:"attributes"`
Kind SpanKind `json:"kind"`
Events []SpanEvent `json:"events"`
}
type SystemStatus ¶
type SystemStatus struct {
TraceCount int `json:"trace_count"`
SpanCount int `json:"span_count"`
LogCount int `json:"log_count"`
MetricCount int `json:"metric_count"`
Services []string `json:"services"`
}
SystemStatus summarises the store counts.
type TraceDetail ¶
type TraceDetail struct {
TraceID string `json:"trace_id"`
Spans []StoredSpan `json:"spans"`
}
TraceDetail is the full expanded trace.
type TraceSummary ¶
type TraceSummary struct {
TraceID string `json:"trace_id"`
Services []string `json:"services"`
RootOperation string `json:"root_operation"`
DurationMs uint64 `json:"duration_ms"`
SpanCount int `json:"span_count"`
HasError bool `json:"has_error"`
StartTime time.Time `json:"start_time"`
HTTPStatus *int `json:"http_status,omitempty"`
}
TraceSummary is the list-view for a single trace.
type TraceUpdatePayload ¶
type WSEvent ¶
type WSEvent struct {
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
}
func MakeLogRecordEvent ¶
func MakeLogRecordEvent(p LogRecordPayload) WSEvent
func MakeMetricUpdateEvent ¶
func MakeMetricUpdateEvent(p MetricUpdatePayload) WSEvent
func MakeServiceStatusEvent ¶
func MakeServiceStatusEvent(p ServiceStatusChangePayload) WSEvent
func MakeTraceUpdateEvent ¶
func MakeTraceUpdateEvent(p TraceUpdatePayload) WSEvent
Click to show internal directories.
Click to hide internal directories.