model

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name      string `json:"name"`
	FrontName string `json:"frontName"`
	Count     int    `json:"count"`
}

type Agent

type Agent struct {
	Hostname    string `json:"hostname"`
	ID          string `json:"id"`
	Type        string `json:"type"`
	EphemeralID string `json:"ephemeral_id"`
	Version     string `json:"version"`
}

type Annotations

type Annotations struct {
	AuthorizationK8SIoDecision string `json:"authorization.k8s.io/decision"`
	Cluster                    string `json:"cluster"`
	AuthorizationK8SIoReason   string `json:"authorization.k8s.io/reason"`
}

type Audit

type Audit struct {
	AuditId           string         `json:"auditid" gorm:"audit_id"` // 主键
	SqlStageTimestamp time.Time      `gorm:"stage_timestamp"`         // stage_timestamp
	Cluster           string         `gorm:"cluster"`                 // cluster
	Namespace         string         `gorm:"namespace"`               // namespace
	Resource          string         `gorm:"resource"`                // resource
	Content           string         `gorm:"content"`                 // content
	AuditLog          k8saudit.Event `gorm:"-"`
}

func (*Audit) EsTableName

func (s *Audit) EsTableName() string

func (*Audit) TableName

func (*Audit) TableName() string

func (*Audit) TypeName

func (s *Audit) TypeName() string

type Data

type Data struct {
	TraceID   string      `json:"traceID"`
	Spans     []Spans     `json:"spans"`
	Processes Processes   `json:"processes"`
	Warnings  interface{} `json:"warnings"`
}

type DataModelInterface

type DataModelInterface interface {
	// 返回表名
	TableName() string
	// type: _doc, ...
	TypeName() string
}

type DeliveryInfo

type DeliveryInfo struct {
	Total       int       `json:"total"`
	ErrorCount  int       `json:"errorCount"`
	NormalCount int       `json:"normalCount"`
	Actions     []*Action `json:"actions"`
}

type Event

type Event struct {
	Agent          Agent       `json:"agent"`
	Log            Log         `json:"log"`
	Annotations    Annotations `json:"annotations"`
	ResponseObject interface{} `json:"responseObject"`
}

type File

type File struct {
	Path string `json:"path"`
}

type JSONData

type JSONData struct {
	Data   []Data      `json:"data"`
	Total  int         `json:"total"`
	Limit  int         `json:"limit"`
	Offset int         `json:"offset"`
	Errors interface{} `json:"errors"`
}

type LifePhase

type LifePhase struct {
	// stage 代表 Pod 的 trace 链路中的一个大类
	// OperationName 和 Reason 可以用来决定 stage
	DocID         string      `json:"omitempty" gorm:"column:doc_id"`
	PlfID         string      `json:"plf_id"`
	TraceStage    string      `json:"traceStage"`
	DataSourceId  string      `json:"dataSourceId" gorm:"column:data_source_id"`
	ClusterName   string      `json:"clusterName" gorm:"column:cluster_name"`
	Namespace     string      `json:"namespace" gorm:"column:namespace"`
	PodName       string      `json:"podName" gorm:"column:pod_name"`
	PodUID        string      `json:"podUID" gorm:"column:pod_uid"`
	OperationName string      `json:"operationName" gorm:"column:operation_name"`
	HasErr        bool        `json:"hasErr" gorm:"column:has_err"`
	SqlHasErr     string      `gorm:"column:has_err"`
	StartTime     time.Time   `json:"startTime" gorm:"column:start_time"`
	EndTime       time.Time   `gorm:"column:end_time"`
	ExtraInfo     interface{} `json:"extraInfo,omitempty" gorm:"-"`
	Reason        interface{} `json:"reason,omitempty" gorm:"-"`
	Message       interface{} `json:"message,omitempty" gorm:"-"`
	Info          string      `gorm:"column:extra_info"`
}

func (*LifePhase) EsTableName

func (s *LifePhase) EsTableName() string

当前 es 和 ob 版本的表名还不一致, 过度阶段增加一个EsTableName()返回 Es的表名 后续表名统一后, 删除 EsTableName() 仅使用 TableName()

func (*LifePhase) TableName

func (s *LifePhase) TableName() string

func (*LifePhase) TypeName

func (s *LifePhase) TypeName() string

type Lifecycle

type Lifecycle struct {
	FinishedTime     string `json:"finishedTime,omitempty"`
	RunningAt        string `json:"runningAt,omitempty"`
	SucceedAt        string `json:"succeedAt,omitempty"`
	FailedAt         string `json:"failedAt,omitempty"`
	ReadyAt          string `json:"readyAt,omitempty"`
	LastActiveAt     string `json:"lastActiveAt,omitempty"`
	CreatedAt        string `json:"createdAt,omitempty"`
	ScheduledAt      string `json:"scheduledAt,omitempty"`
	DeleteEndAt      string `json:"deleteEndAt,omitempty"`
	DeletedAt        string `json:"deletedAt,omitempty"`
	UpgradeAt        string `json:"upgradeAt,omitempty"`
	UpgradeFinshedAt string `json:"upgradeFinshedAt,omitempty"`
}

type Log

type Log struct {
	File   File `json:"file"`
	Offset int  `json:"offset"`
}

type LunettesMeta added in v0.1.8

type LunettesMeta struct {
	ClusterName    string      `json:"clusterName"`
	LastReadTime   interface{} `json:"LastReadTime"`
	LivePodLatency interface{} `json:"LivePodLatency"`
}

func (*LunettesMeta) EsTableName added in v0.1.8

func (s *LunettesMeta) EsTableName() string

func (*LunettesMeta) TableName added in v0.1.8

func (*LunettesMeta) TableName() string

func (*LunettesMeta) TypeName added in v0.1.8

func (s *LunettesMeta) TypeName() string

type NodeInfo

type NodeInfo struct {
	IP                string
	NodeSn            string
	Cluster           string
	Zone              string
	AppEnv            string
	NodeName          string
	CreationTimestamp time.Time
	NodeStatus        string
	ScheduleStatus    string
	RemedyStatus      string
	Resource          string
	TotalCount        int
	ReadyAt           time.Time
	OtherInfo         interface{}
}

type NodeLifePhase

type NodeLifePhase struct {
	DocID         string `gorm:"column:doc_id"`
	PlfID         string
	TraceStage    string      `json:"traceStage"`
	DataSourceId  string      `json:"dataSourceId" gorm:"column:data_source_id"`
	ClusterName   string      `json:"clusterName" gorm:"column:cluster_name"`
	NodeName      string      `json:"nodeName" gorm:"column:node_name"`
	UID           string      `json:"uid" gorm:"column:node_uid"`
	OperationName string      `json:"operationName" gorm:"column:operation_name"`
	HasErr        bool        `json:"hasErr" gorm:"column:has_err"`
	StartTime     time.Time   `json:"startTime" gorm:"column:start_time"`
	EndTime       time.Time   `gorm:"column:end_time"`
	ExtraInfo     interface{} `json:"extraInfo,omitempty" gorm:"-"`
	Reason        interface{} `json:"reason,omitempty" gorm:"-"`
	Message       interface{} `json:"message,omitempty" gorm:"-"`
	SqlExtraInfo  string      `gorm:"column:extra_info"`
}

func (*NodeLifePhase) EsTableName

func (s *NodeLifePhase) EsTableName() string

func (*NodeLifePhase) TableName

func (s *NodeLifePhase) TableName() string

func (*NodeLifePhase) TypeName

func (s *NodeLifePhase) TypeName() string

type NodeParams

type NodeParams struct {
	NodeUid  string
	NodeIp   string
	NodeName string
}

type NodeYaml

type NodeYaml struct {
	AuditID        string       `gorm:"column:audit_id"`
	SqlNode        string       `gorm:"column:node"`
	NodeName       string       `gorm:"column:node_name"`
	NodeIp         string       `gorm:"column:node_ip"`
	UID            string       `gorm:"column:uid"`
	ClusterName    string       `gorm:"column:cluster_name"`
	Node           *corev1.Node `gorm:"-"`
	StageTimeStamp time.Time    `gorm:"column:stage_timestamp"`
}

func (*NodeYaml) EsTableName

func (s *NodeYaml) EsTableName() string

当前 es 和 ob 版本的表名还不一致, 过度阶段增加一个EsTableName()返回 Es的表名 后续表名统一后, 删除 EsTableName() 仅使用 TableName()

func (*NodeYaml) TableName

func (s *NodeYaml) TableName() string

func (*NodeYaml) TypeName

func (s *NodeYaml) TypeName() string

type OptionFunc added in v0.1.8

type OptionFunc func(*Options)

func WithDescending added in v0.1.8

func WithDescending(descending bool) OptionFunc

func WithFrom added in v0.1.8

func WithFrom(from time.Time) OptionFunc

func WithLimit added in v0.1.8

func WithLimit(limint int) OptionFunc

func WithOrderBy added in v0.1.8

func WithOrderBy(orderBy string) OptionFunc

func WithTo added in v0.1.8

func WithTo(to time.Time) OptionFunc

type Options added in v0.1.8

type Options struct {
	OrderBy   string
	Ascending bool
	Limit     int
	From      time.Time
	To        time.Time
}

type P1

type P1 struct {
	ServiceName string        `json:"serviceName"`
	Tags        []interface{} `json:"tags"`
}

type P2

type P2 struct {
	ServiceName string        `json:"serviceName"`
	Tags        []interface{} `json:"tags"`
}

type P3

type P3 struct {
	ServiceName string        `json:"serviceName"`
	Tags        []interface{} `json:"tags"`
}

type P4

type P4 struct {
	ServiceName string        `json:"serviceName"`
	Tags        []interface{} `json:"tags"`
}

type P5

type P5 struct {
	ServiceName string        `json:"serviceName"`
	Tags        []interface{} `json:"tags"`
}

type P6

type P6 struct {
	ServiceName string        `json:"serviceName"`
	Tags        []interface{} `json:"tags"`
}

type P7

type P7 struct {
	ServiceName string        `json:"serviceName"`
	Tags        []interface{} `json:"tags"`
}

type PodCreateOrDeleteOrUpgrade

type PodCreateOrDeleteOrUpgrade struct {
	Result  string    `json:"result"`
	SLO     string    `json:"slo"`
	TraceID string    `json:"traceID"`
	Life    Lifecycle `json:"Lifecycle,omitempty"`
}

type PodInfo

type PodInfo struct {
	DocID            string    `json:"docid,omitempty" gorm:"column:doc_id"`
	ClusterName      string    `json:"ClusterName,omitempty" gorm:"column:cluster_name"`
	Namespace        string    `json:"Namespace,omitempty" gorm:"column:namespace"`
	PodName          string    `json:"PodName,omitempty" gorm:"column:pod_name"`
	PodUID           string    `json:"PodUID,omitempty" gorm:"column:pod_uid"`
	PodIP            string    `json:"PodIP,omitempty" gorm:"column:pod_ip"`
	NodeName         string    `json:"NodeName,omitempty" gorm:"-"`
	AppName          string    `json:"AppName,omitempty" gorm:"-"`
	NodeIP           string    `json:"NodeIP,omitempty" gorm:"-"`
	Zone             string    `json:"Zone,omitempty" gorm:"column:zone"`
	PodPhase         string    `json:"PodPhase,omitempty" gorm:"-"`
	LastTimeStamp    string    `json:"LastActiveAt,omitempty" gorm:"-"`
	CreateTime       string    `json:"CreatedAt,omitempty" gorm:"-"`
	State            string    `json:"State,omitempty" gorm:"-"`
	Resource         string    `json:"Resource,omitempty" gorm:"-"`
	SLO              string    `json:"SLO,omitempty" gorm:"-"`
	Quota            string    `json:"Quota,omitempty" gorm:"-"`
	IpPool           string    `json:"IPPool,omitempty" gorm:"-"`
	DeliveryStatus   string    `gorm:"column:deliver_status" json:"deliverStatus,omitempty"`
	StartTime        time.Time `gorm:"column:start_time"`
	CurrentTime      time.Time `gorm:"column:slo_current_time"`
	DeliveryProgress string    `gorm:"column:delivery_progress" json:"deliveryprogress,omitempty"`
	StageTimestamp   time.Time `gorm:"column:stage_timestamp"`
	AuditID          string    `gorm:"column:audit_id" json:"auditid,omitempty"`
	// 为了 SLO 前端
	BizSource   string `json:"BizSource,omitempty" gorm:"column:biz_source"`
	BizId       string `json:"BizId,omitempty" gorm:"column:biz_id"`
	WorkOrderId string `json:"WorkOrderId,omitempty" gorm:"column:work_order_id"`
	BizSize     string `json:"BizSize,omitempty" gorm:"-"`
}

func (*PodInfo) EsTableName

func (s *PodInfo) EsTableName() string

func (*PodInfo) TableName

func (s *PodInfo) TableName() string

func (*PodInfo) TypeName

func (s *PodInfo) TypeName() string

type PodParams

type PodParams struct {
	Name     string
	Uid      string
	Hostname string
	Podip    string
	From     time.Time
	To       time.Time
}

type PodYaml

type PodYaml struct {
	AuditID           string    `json:"auditID,omitempty" gorm:"column:audit_id"`
	ClusterName       string    `json:"clusterName,omitempty" gorm:"column:cluster_name"`
	Namespace         string    `json:"namespace,omitempty" gorm:"column:namespace"`
	SLO               string    `json:"slo,omitempty" gorm:"-"`
	Status            string    `json:"Status,omitempty" gorm:"-"`
	HostIP            string    `json:"hostIP,omitempty" gorm:"column:host_ip"`
	PodIP             string    `json:"podIP,omitempty" gorm:"column:pod_ip"`
	Hostname          string    `json:"hostname,omitempty" gorm:"column:hostname"`
	IsDeleted         string    `json:"isDeleted,omitempty" gorm:"column:is_deleted"`
	Pod               *v1.Pod   `json:"pod,omitempty" gorm:"-"`
	SqlPod            string    `json:"sqlpod,omitempty" gorm:"column:pod"`
	PodName           string    `json:"podName,omitempty" gorm:"column:pod_name"`
	PodUid            string    `json:"podUid,omitempty" gorm:"column:pod_uid"`
	CreationTimestamp time.Time `json:"creationTimestamp,omitempty" gorm:"column:stage_timestamp"`
	StageTimestamp    time.Time `json:"stageTimestamp,omitempty" gorm:"-"`
	SLOResult         string    `json:"sloResult,omitempty" gorm:"-"`
	SLOType           string    `json:"sloType,omitempty" gorm:"-"`
	IsBeginDelete     string    `json:"isBeginDelete,omitempty" gorm:"-"`
	Fqdn              string    `json:"fqdn,omitempty" gorm:"column:fqdn"`
	DebugUrl          string    `json:"DebugUrl,omitempty" gorm:"-"`
	SqlImages         string    `json:"sqlimages,omitempty" gorm:"column:images"`
}

对外数据模型

func (*PodYaml) EsTableName

func (s *PodYaml) EsTableName() string

当前 es 和 ob 版本的表名还不一致, 过度阶段增加一个EsTableName()返回 Es的表名 后续表名统一后, 删除 EsTableName() 仅使用 TableName()

func (*PodYaml) TableName

func (s *PodYaml) TableName() string

func (*PodYaml) TypeName

func (s *PodYaml) TypeName() string

type Processes

type Processes struct {
	P1 P1 `json:"p1"`
	P2 P2 `json:"p2"`
	P3 P3 `json:"p3"`
	P4 P4 `json:"p4"`
	P5 P5 `json:"p5"`
	P6 P6 `json:"p6"`
	P7 P7 `json:"p7"`
}

type References

type References struct {
	RefType string `json:"refType"`
	TraceID string `json:"traceID"`
	SpanID  string `json:"spanID"`
}

type Resource

type Resource struct {
	Cluster   string `json:"cluster"`
	Kind      string `json:"kind"`
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
}

type Response

type Response struct {
	Code    int         `json:"code" `
	Status  string      `json:"status"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

对外数据模型

type SloOptions

type SloOptions struct {
	Result         string
	Cluster        string
	BizName        string
	Count          string
	Type           string    // create 或者 delete, 默认是 create
	DeliveryStatus string    // FAIL/KILL/ALL/SUCCESS
	SloTime        string    // 20s/30m0s/10m0s
	Env            string    // prod, test
	From           time.Time // range query
	To             time.Time // range query
}

type SloTraceData

type SloTraceData struct {
	DocID                         string             `gorm:"column:doc_id" json:"omitempty"`
	Cluster                       string             `gorm:"column:cluster"`
	InitImage                     string             `gorm:"column:init_image"`
	Namespace                     string             `gorm:"column:namespace"`
	PodName                       string             `gorm:"column:pod_name"`
	PodUID                        string             `gorm:"column:pod_uid"`
	Type                          string             `gorm:"column:type"`
	NodeIP                        string             `gorm:"column:node_ip"`
	NodeName                      string             `gorm:"column:node_name"`
	DebugUrl                      string             `gorm:"column:debug_url"`
	AppName                       string             `gorm:"column:app_name"`
	OwnerRefStr                   string             `gorm:"column:owner_ref_str"`
	BizName                       string             `gorm:"column:biz_name"`
	BizId                         string             `gorm:"column:biz_id"`
	DeliveryWorkload              string             `gorm:"column:delivery_workload"`
	WorkOrderId                   string             `gorm:"column:work_order_id"`
	SchedulingStrategy            string             `gorm:"column:scheduling_strategy"`
	StartUpResultFromCreate       string             `gorm:"column:start_up_result_from_create"`
	StartUpResultFromSchedule     string             `gorm:"column:start_up_result_from_schedule"`
	Situation                     string             `gorm:"column:situation"`
	ResourceType                  string             `gorm:"column:resource_type"`
	IsJob                         bool               `gorm:"column:is_job"`
	IsRafs                        bool               `gorm:"column:is_rafs"`
	Cores                         int64              `gorm:"column:cores"`
	WrittenToZsearch              bool               `gorm:"column:written_to_zsearch"`
	Finished                      bool               `gorm:"column:finished"`
	StopInterEvents               bool               `gorm:"column:stop_inter_events"`
	Created                       time.Time          `gorm:"column:created"`
	CreatedTime                   time.Time          `gorm:"column:created_time"`
	FinishTime                    time.Time          `gorm:"column:finish_time"`
	ActualFinishTimeAfterSchedule time.Time          `gorm:"column:actual_finish_time_after_schedule"`
	ActualFinishTimeAfterCreate   time.Time          `gorm:"column:actual_finish_time_after_create"`
	Scheduled                     time.Time          `gorm:"column:scheduled"`
	PodInitializedTime            time.Time          `gorm:"column:pod_initialized_time"`
	ContainersReady               time.Time          `gorm:"column:container_ready"`
	RunningAt                     time.Time          `gorm:"column:running_at"`
	SucceedAt                     time.Time          `gorm:"column:succeed_at"`
	FailedAt                      time.Time          `gorm:"column:failed_at"`
	ReadyAt                       time.Time          `gorm:"column:ready_at"`
	DeletedTime                   time.Time          `gorm:"column:deleted_time"`
	InitStartTime                 time.Time          `gorm:"column:init_start_time"`
	ImageNameToPullTime           map[string]float64 `gorm:"-"`
	PossibleReason                *string            `gorm:"-"`
	PossibleReasonStr             string             `gorm:"column:possible_reason"`
	SLOViolationReason            string             `gorm:"column:slo_violation_reason"`
	PodSLO                        int64              `gorm:"column:pod_slo"`
	DeliverySLO                   int64              `gorm:"column:delivery_slo"`
	DeliverySLOAdjusted           bool               `gorm:"column:delivery_slo_adjusted"`
	DeliveryDuration              time.Duration      `gorm:"column:delivery_duration"`
	DeliveryStatus                string             `gorm:"column:delivery_status"`
	DeliveryStatusOrig            string             `gorm:"column:delivery_status_orig"`
	SloHint                       string             `gorm:"column:slo_hint"`
	TrigerAuditLog                string             `gorm:"column:triger_audit_log"`
	DeleteResult                  string             `gorm:"column:delete_result"`
	KubeletKillingHost            string             `gorm:"column:kubelet_killing_host"`
	DeleteEndTime                 time.Time          `gorm:"column:delete_end_time"`
	RMZappInfoTime                time.Time          `gorm:"column:rm_zappinfo_time"`
	RMFQDNTime                    time.Time          `gorm:"column:rm_fqdn_time"`
	RMCMDBTime                    time.Time          `gorm:"column:rm_cmdb_time"`
	RMCNIAllocatedTime            time.Time          `gorm:"column:rm_cni_allocated_time"`
	RMAliCloudCNITime             time.Time          `gorm:"column:rm_ali_cloud_cni_time"`
	KubeletKillingTime            time.Time          `gorm:"column:kubelet_killing_time"`
	RemainingFinalizer            []string           `gorm:"column:remaining_finalizers;serializer:json"`
	DeleteTimeoutTime             time.Time          `gorm:"column:delete_timeout_time"`
	UpgradeResult                 string             `gorm:"column:upgrade_result"`
	UpgradeContainerName          string             `gorm:"column:upgrade_container_name"`
	UpdateStatus                  string             `gorm:"column:update_status"`
	UpgradeEndTime                time.Time          `gorm:"column:upgrade_end_time"`
	UpgradeTimeoutTime            time.Time          `gorm:"column:upgrade_timeout_time"`
	PVCName                       string             `gorm:"column:pvc_name"`
	PVCUID                        string             `gorm:"column:pvc_uid"`
	CreateResult                  string             `gorm:"column:create_result"`
	TimeoutTime                   time.Time          `gorm:"column:timeout_time"`
	PullTimeoutImageName          string             `gorm:"-"`
	SLOResult                     []string           `json:"sloResult,omitempty" gorm:"-"`
	SLOType                       string             `json:"sloType,omitempty" gorm:"-"`
}

func (*SloTraceData) EsTableName

func (s *SloTraceData) EsTableName() string

func (*SloTraceData) TableName

func (s *SloTraceData) TableName() string

func (*SloTraceData) TypeName

func (s *SloTraceData) TypeName() string

type Slodata

type Slodata struct {
	DocID                         string             `gorm:"column:doc_id" json:"omitempty"`
	Cluster                       string             `gorm:"column:cluster" json:"cluster,omitempty"`
	InitImage                     string             `gorm:"column:init_image" json:"initimage,omitempty"`
	Namespace                     string             `gorm:"column:namespace" json:"namespace,omitempty"`
	PodName                       string             `gorm:"column:pod_name" json:"podName,omitempty"`
	PodUID                        string             `gorm:"column:pod_uid" json:"podUid,omitempty"`
	Type                          string             `gorm:"column:type" json:"type,omitempty"`
	NodeIP                        string             `gorm:"column:node_ip" json:"nodeIp,omitempty"`
	NodeName                      string             `gorm:"column:node_name" json:"nodeName,omitempty"`
	DebugUrl                      string             `gorm:"column:debug_url" json:"debugUrl,omitempty"`
	AppName                       string             `gorm:"column:app_name" json:"appname,omitempty"`
	OwnerRefStr                   string             `gorm:"column:owner_ref_str" json:"ownerRef,omitempty"`
	BizName                       string             `gorm:"column:biz_name" json:"bizName,omitempty"`
	BizId                         string             `gorm:"column:biz_id" json:"bizId,omitempty"`
	DeliveryWorkload              string             `gorm:"column:delivery_workload" json:"deliveryWorkload,omitempty"`
	WorkOrderId                   string             `gorm:"column:work_order_id" json:"workorderid,omitempty"`
	SchedulingStrategy            string             `gorm:"column:scheduling_strategy" json:"scheduleStrategy,omitempty"`
	StartUpResultFromCreate       string             `gorm:"column:start_up_result_from_create" json:"startupresultfromcreate,omitempty"`
	StartUpResultFromSchedule     string             `gorm:"column:start_up_result_from_schedule" json:"startupresultfromschedule,omitempty"`
	Situation                     string             `gorm:"column:situation" json:"situation,omitempty"`
	ResourceType                  string             `gorm:"column:resource_type" json:"resourceType,omitempty"`
	IsJob                         bool               `gorm:"column:is_job" json:"isjob,omitempty"`
	IsRafs                        bool               `gorm:"column:is_rafs" json:"israfs,omitempty"`
	Cores                         int64              `gorm:"column:cores" json:"cores,omitempty"`
	WrittenToZsearch              bool               `gorm:"column:written_to_zsearch" json:"writtentozsearch,omitempty"`
	Finished                      bool               `gorm:"column:finished" json:"finished,omitempty"`
	StopInterEvents               bool               `gorm:"column:stop_inter_events" json:"stopinterevents,omitempty"`
	Created                       time.Time          `gorm:"column:created" json:"CreatedTime,omitempty"`
	CreatedTime                   time.Time          `gorm:"column:created_time" json:"createdtime,omitempty"`
	FinishTime                    time.Time          `gorm:"column:finish_time" json:"finishTime,omitempty"`
	ActualFinishTimeAfterSchedule time.Time          `gorm:"column:actual_finish_time_after_schedule" json:"actualfinishtimeafterschedule,omitempty"`
	ActualFinishTimeAfterCreate   time.Time          `gorm:"column:actual_finish_time_after_create" json:"actualfinishtimeaftercreate,omitempty"`
	Scheduled                     time.Time          `gorm:"column:scheduled" json:"scheduled,omitempty"`
	PodInitializedTime            time.Time          `gorm:"column:pod_initialized_time" json:"podinitializedtime,omitempty"`
	ContainersReady               time.Time          `gorm:"column:container_ready" json:"ContainersReadyTime,omitempty"`
	RunningAt                     time.Time          `gorm:"column:running_at" json:"runningAt,omitempty"`
	SucceedAt                     time.Time          `gorm:"column:succeed_at" json:"succeedAt,omitempty"`
	FailedAt                      time.Time          `gorm:"column:failed_at" json:"failedAt,omitempty"`
	ReadyAt                       time.Time          `gorm:"column:ready_at" json:"readyAt,omitempty"`
	DeletedTime                   time.Time          `gorm:"column:deleted_time" json:"deletedAt,omitempty"`
	InitStartTime                 time.Time          `gorm:"column:init_start_time" json:"initStartTime,omitempty"`
	ImageNameToPullTime           map[string]float64 `gorm:"-"`
	PossibleReason                string             `gorm:"-"`
	PossibleReasonStr             string             `gorm:"column:possible_reason" json:"possiblereason,omitempty"`
	SLOViolationReason            string             `gorm:"column:slo_violation_reason" json:"sloviolationreason,omitempty"`
	PodSLO                        int64              `gorm:"column:pod_slo" json:"podslo,omitempty"`
	DeliverySLO                   int64              `gorm:"column:delivery_slo" json:"deliveryslo,omitempty"`
	DeliverySLOAdjusted           bool               `gorm:"column:delivery_slo_adjusted" json:"deliverysloadjusted,omitempty"`
	DeliveryDuration              time.Duration      `gorm:"column:delivery_duration" json:"deliveryduration,omitempty"`
	DeliveryStatus                string             `gorm:"column:delivery_status" json:"deliverystatus,omitempty"`
	DeliveryStatusOrig            string             `gorm:"column:delivery_status_orig" json:"deliverystatusorig,omitempty"`
	SloHint                       string             `gorm:"column:slo_hint" json:"slohint,omitempty"`
	PullTimeoutImageName          string             `gorm:"-"`
	DeleteEndTime                 time.Time
	DeleteTimeoutTime             time.Time
	UpgradeEndTime                time.Time
	UpgradeTimeoutTime            time.Time
	UpgradeResult                 string
	DeleteResult                  string
}

func (*Slodata) EsTableName

func (s *Slodata) EsTableName() string

func (*Slodata) TableName

func (s *Slodata) TableName() string

func (*Slodata) TypeName

func (s *Slodata) TypeName() string

type Span

type Span struct {
	DocId             string    `gorm:"column:doc_id"`
	Name              string    `json:"name,omitempty" gorm:"column:or_name"`
	OrResource        string    `gorm:"column:or_resource"`
	OrNamespace       string    `gorm:"column:or_namespace"`
	OrUID             string    `gorm:"column:or_uid"`
	OrAPIGroup        string    `gorm:"column:or_apigroup"`
	OrAPIVersion      string    `gorm:"column:or_apiversion"`
	OrResourceVersion string    `gorm:"column:or_resource_version"`
	OrSubresource     string    `gorm:"column:or_subresource"`
	SpanName          string    `gorm:"column:span_name" `
	Type              string    `json:"type,omitempty" gorm:"column:span_type"`
	Begin             time.Time `json:"begin,omitempty" gorm:"column:span_begin"`
	End               time.Time `json:"end,omitempty" gorm:"column:span_end"`
	Elapsed           int64     `json:"elapsed,omitempty" gorm:"column:span_elapsed"`
	Cluster           string    `json:"cluster,omitempty" gorm:"column:span_cluster"`
	ActionType        string    `json:"actionType,omitempty" gorm:"column:span_action_type"`
	TimeStamp         time.Time `json:"timeStamp,omitempty" gorm:"column:span_timestamp"`
	Omitempty         bool      `json:"omitempty,omitempty" gorm:"column:span_omitempty"`
	SpanConfig        string    `gorm:"column:span_config"`
	Sqlroperties      string    `gorm:"column:properties"`
}

对外数据模型

func (*Span) EsTableName

func (s *Span) EsTableName() string

当前 es 和 ob 版本的表名还不一致, 过度阶段增加一个EsTableName()返回 Es的表名 后续表名统一后, 删除 EsTableName() 仅使用 TableName()

func (*Span) TableName

func (s *Span) TableName() string

func (*Span) TypeName

func (s *Span) TypeName() string

type Spans

type Spans struct {
	TraceID       string        `json:"traceID"`
	SpanID        string        `json:"spanID"`
	OperationName string        `json:"operationName"`
	References    []References  `json:"references"`
	StartTime     int64         `json:"startTime"`
	Duration      int64         `json:"duration"`
	Tags          []Tags        `json:"tags"`
	Logs          []interface{} `json:"logs"`
	ProcessID     string        `json:"processID"`
	Warnings      interface{}   `json:"warnings"`
}

type Tags

type Tags struct {
	Key   string      `json:"key"`
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

type TraceDetailMetaData

type TraceDetailMetaData struct {
	TraceInfo TraceInfo `json:"traceInfo"`
	Resource  Resource  `json:"resource"`
}

type TraceInfo

type TraceInfo struct {
	SpanTotal      int     `json:"spanTotal"`
	ErrorSpanCount int     `json:"errorSpanCount"`
	ServiceTotal   int     `json:"serviceTotal"`
	TotalDuration  string  `json:"totalDuration"`
	MaxConsumeSpan string  `json:"maxConsumeSpan"`
	Action         *Action `json:"action"`
}

type TraceListMetaData

type TraceListMetaData struct {
	DeliveryInfo DeliveryInfo `json:"deliveryInfo"`
	Resource     Resource     `json:"resource"`
}

type TraceStats

type TraceStats struct {
	Cluster        string    `json:"Cluster"`
	Namespace      string    `json:"Namespace"`
	Name           string    `json:"Name"`
	UID            string    `json:"UID"`
	TraceType      string    `json:"TraceType"`
	StartTimestamp time.Time `json:"StartTimestamp"`
	Error          bool      `json:"Error"`
	FailModule     string    `json:"FailModule"`
	FailReason     string    `json:"FailReason"`
	FailMessage    string    `json:"FailMessage"`
	Owner          string    `json:"接口人"`
	HostIP         string
}

Jump to

Keyboard shortcuts

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