service

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogResponse

type LogResponse struct {
	Logs       []opensearch.LogEntry `json:"logs"`
	TotalCount int                   `json:"totalCount"`
	Took       int                   `json:"tookMs"`
}

LogResponse represents the response structure for log queries

type LoggingService

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

LoggingService provides logging and metrics functionality

func NewLoggingService

func NewLoggingService(osClient OpenSearchClient, metricsService *prometheus.MetricsService, cfg *config.Config, logger *slog.Logger) *LoggingService

NewLoggingService creates a new logging service instance

func (*LoggingService) GetComponentLogs

func (s *LoggingService) GetComponentLogs(ctx context.Context, params opensearch.ComponentQueryParams) (*LogResponse, error)

GetComponentLogs retrieves logs for a specific component using V2 wildcard search

func (*LoggingService) GetComponentResourceMetrics added in v0.4.0

func (s *LoggingService) GetComponentResourceMetrics(ctx context.Context, componentID, environmentID, projectID string, startTime, endTime time.Time) (*prometheus.ResourceMetricsTimeSeries, error)

GetComponentResourceMetrics retrieves resource usage metrics for a component as time series

func (*LoggingService) GetComponentTraces added in v0.4.0

func (*LoggingService) GetGatewayLogs

func (s *LoggingService) GetGatewayLogs(ctx context.Context, params opensearch.GatewayQueryParams) (*LogResponse, error)

GetGatewayLogs retrieves gateway logs using V2 wildcard search

func (*LoggingService) GetOrganizationLogs

func (s *LoggingService) GetOrganizationLogs(ctx context.Context, params opensearch.QueryParams, podLabels map[string]string) (*LogResponse, error)

GetOrganizationLogs retrieves logs for an organization with custom filters

func (*LoggingService) GetProjectLogs

func (s *LoggingService) GetProjectLogs(ctx context.Context, params opensearch.QueryParams, componentIDs []string) (*LogResponse, error)

GetProjectLogs retrieves logs for a specific project using V2 wildcard search

func (*LoggingService) HealthCheck

func (s *LoggingService) HealthCheck(ctx context.Context) error

HealthCheck performs a health check on the service

type OpenSearchClient

type OpenSearchClient interface {
	Search(ctx context.Context, indices []string, query map[string]interface{}) (*opensearch.SearchResponse, error)
	GetIndexMapping(ctx context.Context, index string) (*opensearch.MappingResponse, error)
	HealthCheck(ctx context.Context) error
}

OpenSearchClient interface for testing

Jump to

Keyboard shortcuts

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