Documentation
¶
Index ¶
- type LogResponse
- type LoggingService
- func (s *LoggingService) GetComponentLogs(ctx context.Context, params opensearch.ComponentQueryParams) (*LogResponse, error)
- func (s *LoggingService) GetComponentResourceMetrics(ctx context.Context, componentID, environmentID, projectID string, ...) (*prometheus.ResourceMetricsTimeSeries, error)
- func (s *LoggingService) GetComponentTraces(ctx context.Context, params opensearch.ComponentTracesRequestParams) (*opensearch.TraceResponse, error)
- func (s *LoggingService) GetGatewayLogs(ctx context.Context, params opensearch.GatewayQueryParams) (*LogResponse, error)
- func (s *LoggingService) GetOrganizationLogs(ctx context.Context, params opensearch.QueryParams, ...) (*LogResponse, error)
- func (s *LoggingService) GetProjectLogs(ctx context.Context, params opensearch.QueryParams, componentIDs []string) (*LogResponse, error)
- func (s *LoggingService) HealthCheck(ctx context.Context) error
- type OpenSearchClient
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 (s *LoggingService) GetComponentTraces(ctx context.Context, params opensearch.ComponentTracesRequestParams) (*opensearch.TraceResponse, error)
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