Documentation
¶
Index ¶
- func ConvertProtoProcessPayload(pb *proto.ProcessPayload) model.ProcessPayload
- func ConvertToModelPayload(pbPayload *proto.MetricPayload) model.MetricPayload
- func MergeDimensionsWithMeta(base map[string]string, meta *model.Meta) map[string]string
- func SafeHandlePayload(handler func())
- type LogsHandler
- type MetricsHandler
- type ResourceDiscovery
- func (rd *ResourceDiscovery) ProcessLogPayload(payload *model.LogPayload) *model.LogPayload
- func (rd *ResourceDiscovery) ProcessMetricPayload(payload *model.MetricPayload) *model.MetricPayload
- func (rd *ResourceDiscovery) ProcessProcessPayload(payload *model.ProcessPayload) *model.ProcessPayload
- func (rd *ResourceDiscovery) ProcessTracePayload(payload *model.TracePayload) *model.TracePayload
- type StreamHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertProtoProcessPayload ¶
func ConvertProtoProcessPayload(pb *proto.ProcessPayload) model.ProcessPayload
ConvertProtoProcessPayload converts a protobuf ProcessPayload to a model.ProcessPayload.
func ConvertToModelPayload ¶
func ConvertToModelPayload(pbPayload *proto.MetricPayload) model.MetricPayload
ConvertToModelPayload converts a protobuf MetricPayload to a model.MetricPayload.
func MergeDimensionsWithMeta ¶
TODO - do this better.
func SafeHandlePayload ¶
func SafeHandlePayload(handler func())
SafeHandlePayload wraps a handler function to recover from any panics that occur during its execution.
Types ¶
type LogsHandler ¶
type LogsHandler struct {
Sys *sys.SystemContext
collogpb.UnimplementedLogsServiceServer
}
func NewLogsHandler ¶
func NewLogsHandler(sys *sys.SystemContext) *LogsHandler
func (*LogsHandler) EvaluateSeverityLevel ¶
func (h *LogsHandler) EvaluateSeverityLevel(logPayload *model.LogPayload)
EvaluateSeverityLevel evaluates the severity level of logs based on thresholds defined in the system. Based on that severity, different actions can be taken such as generating events that can trigger alerts. (COMPLETELY PRESERVED - no changes needed)
func (*LogsHandler) Export ¶
func (h *LogsHandler) Export(ctx context.Context, req *collogpb.ExportLogsServiceRequest) (*collogpb.ExportLogsServiceResponse, error)
Export implements the OTLP LogsService Export method (unary, not streaming)
type MetricsHandler ¶
type MetricsHandler struct {
Sys *sys.SystemContext
colmetricpb.UnimplementedMetricsServiceServer
}
MetricsHandler implements the OTLP MetricsService for processing metric telemetry data. This handler receives OTLP metrics via unary gRPC calls, converts them to GoSight's internal model format, and processes them through the complete telemetry pipeline. It handles tag enrichment, rule evaluation, agent tracking, broadcasting to WebSocket clients, buffering/storage, metric indexing, and caching.
func NewMetricsHandler ¶
func NewMetricsHandler(sys *sys.SystemContext) *MetricsHandler
NewMetricsHandler creates a new OTLP metrics handler with the provided system context. The handler initializes with access to the complete GoSight system including stores, buffers, caches, WebSocket hubs, rule evaluators, and metric indexing systems. It logs the initialization with details about the configured metric store type.
func (*MetricsHandler) Export ¶
func (h *MetricsHandler) Export(ctx context.Context, req *colmetricpb.ExportMetricsServiceRequest) (*colmetricpb.ExportMetricsServiceResponse, error)
Export implements the OTLP MetricsService Export method for receiving metric telemetry. This method handles incoming OTLP ExportMetricsServiceRequest messages, converts them to GoSight's internal MetricPayload format, and processes them through the complete telemetry pipeline. The processing includes:
- Tag enrichment from endpoint-specific tag cache - Rule evaluation for alerting and event generation - Agent and container information tracking - Real-time broadcasting to WebSocket clients - Buffered storage with fallback to direct store writes - Metric indexing for search and discovery - In-memory caching for performance optimization
The method returns an OTLP-compliant success response or an error status if the request is invalid or processing fails. All processing is wrapped in SafeHandlePayload to ensure robust error handling and prevent service disruption.
type ResourceDiscovery ¶
type ResourceDiscovery struct {
// contains filtered or unexported fields
}
func NewResourceDiscovery ¶
func NewResourceDiscovery(cache resourcecache.ResourceCache) *ResourceDiscovery
func (*ResourceDiscovery) ProcessLogPayload ¶
func (rd *ResourceDiscovery) ProcessLogPayload(payload *model.LogPayload) *model.LogPayload
func (*ResourceDiscovery) ProcessMetricPayload ¶
func (rd *ResourceDiscovery) ProcessMetricPayload(payload *model.MetricPayload) *model.MetricPayload
func (*ResourceDiscovery) ProcessProcessPayload ¶
func (rd *ResourceDiscovery) ProcessProcessPayload(payload *model.ProcessPayload) *model.ProcessPayload
func (*ResourceDiscovery) ProcessTracePayload ¶
func (rd *ResourceDiscovery) ProcessTracePayload(payload *model.TracePayload) *model.TracePayload
type StreamHandler ¶
type StreamHandler struct {
Sys *sys.SystemContext
pb.UnimplementedStreamServiceServer
}
StreamHandler implements pb.MetricsServiceServer StreamHandler implements MetricsServiceServer
func NewStreamHandler ¶
func NewStreamHandler(sys *sys.SystemContext) *StreamHandler
func (*StreamHandler) EnqueueCommandToAgent ¶
func (*StreamHandler) Stream ¶
func (h *StreamHandler) Stream(stream pb.StreamService_StreamServer) error
Stream implements the gRPC StreamService_StreamServer method