Documentation
¶
Index ¶
- Constants
- type AlertDetails
- type AlertNotificationResponse
- type AlertingRuleCondition
- type AlertingRuleMetadata
- type AlertingRuleRequest
- type AlertingRuleSource
- type AlertingRuleSyncResponse
- type ComponentSearchScope
- type HTTPMetricsQueryResponse
- type LogEntry
- type LogMetadata
- type LogsQueryRequest
- type LogsQueryResponse
- type MetricsQueryRequest
- type MetricsTimeSeriesItem
- type ResourceMetricsQueryResponse
- type SearchScope
- type SpanInfo
- type SpansQueryResponse
- type TraceInfo
- type TracesQueryRequest
- type TracesQueryResponse
- type WorkflowSearchScope
Constants ¶
const ( // Logs API (v1) internal server error codes. ErrorCodeV1LogsInternalGeneric = "OBS-V1-L-01" ErrorCodeV1LogsAuthzInternal = "OBS-V1-L-02" ErrorCodeV1LogsServiceNotReady = "OBS-V1-L-03" ErrorCodeV1LogsResolverFailed = "OBS-V1-L-04" ErrorCodeV1LogsRetrievalFailed = "OBS-V1-L-05" // Metrics API (v1) internal server error codes. ErrorCodeV1MetricsInternalGeneric = "OBS-V1-M-01" ErrorCodeV1MetricsAuthzInternal = "OBS-V1-M-02" ErrorCodeV1MetricsServiceNotReady = "OBS-V1-M-03" ErrorCodeV1MetricsResolverFailed = "OBS-V1-M-04" ErrorCodeV1MetricsRetrievalFailed = "OBS-V1-M-05" // Traces API (v1alpha1) internal server error codes. ErrorCodeV1TracesInternalGeneric = "OBS-V1-T-01" ErrorCodeV1TracesAuthzInternal = "OBS-V1-T-02" ErrorCodeV1TracesServiceNotReady = "OBS-V1-T-03" ErrorCodeV1TracesResolverFailed = "OBS-V1-T-04" ErrorCodeV1TracesRetrievalFailed = "OBS-V1-T-05" ErrorCodeV1TracesInvalidRequest = "OBS-V1-T-06" ErrorCodeV1TracesSpanNotFound = "OBS-V1-T-07" )
Error codes for the new API
const ( MetricTypeResource = "resource" MetricTypeHTTP = "http" )
Metric type constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertDetails ¶ added in v0.13.0
type AlertDetails struct {
// Alert information
AlertName string `json:"alertName"`
AlertTimestamp string `json:"alertTimestamp"`
AlertSeverity string `json:"alertSeverity"`
AlertDescription string `json:"alertDescription"`
AlertThreshold string `json:"alertThreshold"`
AlertValue string `json:"alertValue"`
AlertType string `json:"alertType"`
AlertAIRootCauseAnalysisEnabled bool `json:"alertAIRootCauseAnalysisEnabled"`
// Component information
Namespace string `json:"namespace"`
Component string `json:"component"`
Project string `json:"project"`
Environment string `json:"environment"`
ComponentID string `json:"componentId"`
ProjectID string `json:"projectId"`
EnvironmentID string `json:"environmentId"`
// Notification channel name
NotificationChannel string `json:"notificationChannel,omitempty"`
}
AlertDetails represents alert information used for notifications and CEL template rendering
func (*AlertDetails) ToMap ¶ added in v0.13.0
func (a *AlertDetails) ToMap() map[string]interface{}
ToMap converts AlertDetails to a map for CEL template rendering. Uses JSON marshaling to automatically convert struct fields to map keys based on JSON tags.
type AlertNotificationResponse ¶
type AlertNotificationResponse struct {
Status string `json:"status"`
AlertID string `json:"alertId,omitempty"`
EmailRecipients []string `json:"emailRecipients,omitempty"`
}
AlertNotificationResponse represents the outcome of processing an alert notification.
type AlertingRuleCondition ¶
type AlertingRuleCondition struct {
Enabled bool `json:"enabled"`
Window string `json:"window"`
Interval string `json:"interval"`
Operator string `json:"operator"`
Threshold float64 `json:"threshold"`
}
AlertingRuleCondition defines the condition that triggers the alert
type AlertingRuleMetadata ¶
type AlertingRuleMetadata struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
ComponentUID string `json:"component-uid"`
ProjectUID string `json:"project-uid"`
EnvironmentUID string `json:"environment-uid"`
Severity string `json:"severity"`
NotificationChannel string `json:"notificationChannel"`
EnableAiRootCauseAnalysis bool `json:"enableAiRootCauseAnalysis"`
}
AlertingRuleMetadata contains metadata about an alerting rule
type AlertingRuleRequest ¶
type AlertingRuleRequest struct {
Metadata AlertingRuleMetadata `json:"metadata"`
Source AlertingRuleSource `json:"source"`
Condition AlertingRuleCondition `json:"condition"`
}
AlertingRuleRequest represents the request body for PUT /api/alerting/rule/{sourceType}/{ruleName}
type AlertingRuleSource ¶
type AlertingRuleSource struct {
Type string `json:"type"`
Query string `json:"query"` // For log-based alert rules
Metric string `json:"metric"` // For metric-based alert rules (e.g., "cpu_usage", "memory_usage")
}
AlertingRuleSource defines the source of data for the alerting rule
type AlertingRuleSyncResponse ¶
type AlertingRuleSyncResponse struct {
Status string `json:"status"`
LogicalID string `json:"logicalId"`
BackendID string `json:"backendId"`
Action string `json:"action"`
LastSynced string `json:"lastSynced"`
}
AlertingRuleSyncResponse captures the result of an alert rule upsert.
type ComponentSearchScope ¶ added in v0.17.0
type ComponentSearchScope struct {
Namespace string `json:"namespace" validate:"required"`
Project string `json:"project,omitempty"`
Component string `json:"component,omitempty"`
Environment string `json:"environment,omitempty"`
}
ComponentSearchScope defines the search scope for component logs Matches OpenAPI ComponentSearchScope schema
type HTTPMetricsQueryResponse ¶ added in v0.17.0
type HTTPMetricsQueryResponse struct {
RequestCount []MetricsTimeSeriesItem `json:"requestCount,omitempty"`
SuccessfulRequestCount []MetricsTimeSeriesItem `json:"successfulRequestCount,omitempty"`
UnsuccessfulRequestCount []MetricsTimeSeriesItem `json:"unsuccessfulRequestCount,omitempty"`
MeanLatency []MetricsTimeSeriesItem `json:"meanLatency,omitempty"`
LatencyP50 []MetricsTimeSeriesItem `json:"latencyP50,omitempty"`
LatencyP90 []MetricsTimeSeriesItem `json:"latencyP90,omitempty"`
LatencyP99 []MetricsTimeSeriesItem `json:"latencyP99,omitempty"`
}
HTTPMetricsQueryResponse is the response for metric="http" queries
type LogEntry ¶ added in v0.17.0
type LogEntry struct {
Timestamp string `json:"timestamp"`
Log string `json:"log"`
Level string `json:"level,omitempty"`
Metadata *LogMetadata `json:"metadata,omitempty"`
}
LogEntry represents a single log entry in the response Used for both component and workflow logs Matches OpenAPI ComponentLogEntry/WorkflowLogEntry schemas
type LogMetadata ¶ added in v0.17.0
type LogMetadata struct {
// Component-specific fields (empty for workflow logs)
ComponentName string `json:"componentName,omitempty"`
ProjectName string `json:"projectName,omitempty"`
EnvironmentName string `json:"environmentName,omitempty"`
NamespaceName string `json:"namespaceName,omitempty"`
ComponentUID string `json:"componentUid,omitempty"`
ProjectUID string `json:"projectUid,omitempty"`
EnvironmentUID string `json:"environmentUid,omitempty"`
ContainerName string `json:"containerName,omitempty"`
PodName string `json:"podName,omitempty"`
PodNamespace string `json:"podNamespace,omitempty"`
}
LogMetadata contains metadata for a log entry Used for both component and workflow logs Matches OpenAPI ComponentLogEntry.metadata schema (workflow logs use a subset)
type LogsQueryRequest ¶ added in v0.17.0
type LogsQueryRequest struct {
// SearchScope defines where to search for logs (component or workflow)
SearchScope *SearchScope `json:"searchScope" validate:"required"`
// Time range for the query (required)
StartTime string `json:"startTime" validate:"required"`
EndTime string `json:"endTime" validate:"required"`
// Optional filters
SearchPhrase string `json:"searchPhrase,omitempty"`
LogLevels []string `json:"logLevels,omitempty"`
// Pagination and sorting
Limit int `json:"limit,omitempty"`
SortOrder string `json:"sortOrder,omitempty"` // asc or desc, default: desc
}
LogsQueryRequest represents the request body for POST /api/v1/logs/query Matches OpenAPI LogsQueryRequest schema
type LogsQueryResponse ¶ added in v0.17.0
type LogsQueryResponse struct {
Logs []LogEntry `json:"logs"`
Total int `json:"total"`
TookMs int `json:"tookMs"`
}
LogsQueryResponse represents the response for POST /api/v1/logs/query Matches OpenAPI LogsQueryResponse schema
type MetricsQueryRequest ¶ added in v0.17.0
type MetricsQueryRequest struct {
// Metric defines the type of metrics to query
Metric string `json:"metric" validate:"required"` // "resource" | "http"
// Time range for the query (required)
StartTime string `json:"startTime" validate:"required"`
EndTime string `json:"endTime" validate:"required"`
// Step is the query resolution step (e.g. "1m", "5m", "15m", "30m", "1h")
Step *string `json:"step,omitempty"`
// SearchScope restricts the query to a specific component, project, or namespace.
// Uses ComponentSearchScope directly (not the SearchScope union) because metrics
// queries do not support workflow scope. Required — matches the OpenAPI spec.
SearchScope ComponentSearchScope `json:"searchScope"`
}
MetricsQueryRequest represents the request body for POST /api/v1/metrics/query Matches OpenAPI MetricsQueryRequest schema
type MetricsTimeSeriesItem ¶ added in v0.17.0
type MetricsTimeSeriesItem struct {
Timestamp time.Time `json:"timestamp"`
Value float64 `json:"value"`
}
MetricsTimeSeriesItem represents a single point in a metrics time series
type ResourceMetricsQueryResponse ¶ added in v0.17.0
type ResourceMetricsQueryResponse struct {
CPUUsage []MetricsTimeSeriesItem `json:"cpuUsage,omitempty"`
CPURequests []MetricsTimeSeriesItem `json:"cpuRequests,omitempty"`
CPULimits []MetricsTimeSeriesItem `json:"cpuLimits,omitempty"`
MemoryUsage []MetricsTimeSeriesItem `json:"memoryUsage,omitempty"`
MemoryRequests []MetricsTimeSeriesItem `json:"memoryRequests,omitempty"`
MemoryLimits []MetricsTimeSeriesItem `json:"memoryLimits,omitempty"`
}
ResourceMetricsQueryResponse is the response for metric="resource" queries
type SearchScope ¶ added in v0.17.0
type SearchScope struct {
Component *ComponentSearchScope `json:"-"`
Workflow *WorkflowSearchScope `json:"-"`
}
SearchScope is a union type for component or workflow search scope Implements oneOf from OpenAPI spec - can be either ComponentSearchScope or WorkflowSearchScope
func (*SearchScope) MarshalJSON ¶ added in v0.17.0
func (s *SearchScope) MarshalJSON() ([]byte, error)
MarshalJSON implements custom JSON marshaling
func (*SearchScope) UnmarshalJSON ¶ added in v0.17.0
func (s *SearchScope) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom JSON unmarshaling to handle oneOf The JSON can be either a ComponentSearchScope or WorkflowSearchScope directly
type SpanInfo ¶ added in v0.17.0
type SpanInfo struct {
SpanID string `json:"spanId"`
SpanName string `json:"spanName"`
ParentSpanID string `json:"parentSpanId,omitempty"`
StartTime *time.Time `json:"startTime,omitempty"`
EndTime *time.Time `json:"endTime,omitempty"`
DurationNs int64 `json:"durationNs,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
ResourceAttributes map[string]interface{} `json:"resourceAttributes,omitempty"`
}
SpanInfo contains information about a span
type SpansQueryResponse ¶ added in v0.17.0
type SpansQueryResponse struct {
Spans []SpanInfo `json:"spans"`
Total int `json:"total"`
TookMs int `json:"tookMs"`
}
SpansQueryResponse represents the internal response for span queries
type TraceInfo ¶ added in v0.17.0
type TraceInfo struct {
TraceID string `json:"traceId"`
TraceName string `json:"traceName"`
SpanCount int `json:"spanCount"`
RootSpanID string `json:"rootSpanId"`
RootSpanName string `json:"rootSpanName"`
RootSpanKind string `json:"rootSpanKind"`
StartTime *time.Time `json:"startTime,omitempty"`
EndTime *time.Time `json:"endTime,omitempty"`
DurationNs int64 `json:"durationNs,omitempty"`
}
TraceInfo contains summary information about a trace
type TracesQueryRequest ¶ added in v0.17.0
type TracesQueryRequest struct {
StartTime time.Time
EndTime time.Time
Limit int
Sort string
SearchScope ComponentSearchScope
}
TracesQueryRequest represents the internal request for querying traces
type TracesQueryResponse ¶ added in v0.17.0
type TracesQueryResponse struct {
Traces []TraceInfo `json:"traces"`
Total int `json:"total"`
TookMs int `json:"tookMs"`
}
TracesQueryResponse represents the internal response for trace queries
type WorkflowSearchScope ¶ added in v0.17.0
type WorkflowSearchScope struct {
Namespace string `json:"namespace" validate:"required"`
WorkflowRunName string `json:"workflowRunName,omitempty"`
TaskName string `json:"taskName,omitempty"`
}
WorkflowSearchScope defines the search scope for workflow run logs Matches OpenAPI WorkflowSearchScope schema