integration

package
v0.0.0-...-385b71e Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterTypeK8s = "k8s"
	ClusterTypeVM  = "vm"
)
View Source
const (
	TraceModeSidecar   = "trace-sidecar"
	TraceModeAll       = "trace"
	TraceModeCollector = "collector"

	MetricModeAll       = "metrics"
	MetricModeCollector = "collector"

	LogModeAll    = "log"
	LogModeSample = "log-sample"
)

Variables

View Source
var PlatformClusterID = uuid.NewMD5(uuid.Nil, []byte("APO-Platform"))

Functions

This section is empty.

Types

type APOCollector

type APOCollector struct {
	CollectorGatewayAddr string                `json:"collectorGatewayAddr"`
	CollectorAddr        string                `json:"collectorAddr,omitempty"`
	Ports                CollectorGatewayPorts `json:"ports"`
}

func (*APOCollector) RemoveHttpPrefix

func (c *APOCollector) RemoveHttpPrefix()

func (*APOCollector) Scan

func (c *APOCollector) Scan(value interface{}) error

实现 Scanner 接口,将 JSON 字符串扫描回 MapStringString

func (APOCollector) Value

func (c APOCollector) Value() (driver.Value, error)

type AdapterAPIConfig

type AdapterAPIConfig struct {
	APIs    map[string]any `json:"apis"`
	Timeout int64          `json:"timeout"`

	LastUpdateTS int64 `json:"lastUpdateTS"`
}

type ArmsConfig

type ArmsConfig struct {
	Address      string `json:"address" mapstructure:"address"`
	AccessKey    string `json:"accessKey" mapstructure:"access_key" secret:"true"`
	AccessSecret string `json:"accessSecret" mapstructure:"access_secret" secret:"true"`
}

type ClickhouseConfig

type ClickhouseConfig struct {
	Address     string `json:"address"`
	UserName    string `json:"userName" secret:"true"`
	Password    string `json:"password" secret:"true"` // Encrypt in B64
	Database    string `json:"database"`
	Replication bool   `json:"replication"`
	Cluster     string `json:"cluster"`
}

type Cluster

type Cluster struct {
	ID           string       `form:"id" json:"id" gorm:"primaryKey;type:varchar(100);column:id"`
	Name         string       `form:"name" json:"name" gorm:"unique;type:varchar(100);column:name"`
	ClusterType  string       `form:"clusterType" json:"clusterType" gorm:"type:varchar(100);column:cluster_type"`
	APOCollector APOCollector `json:"apoCollector,omitempty" gorm:"type:json;column:apo_collector"`
}

type ClusterIntegration

type ClusterIntegration struct {
	Cluster

	Trace  TraceIntegration  `json:"trace"`
	Metric MetricIntegration `json:"metric"`
	Log    LogIntegration    `json:"log"`
}

func (*ClusterIntegration) RemoveSecret

func (ci *ClusterIntegration) RemoveSecret() *ClusterIntegration

type ClusterIntegrationVO

type ClusterIntegrationVO struct {
	*ClusterIntegration

	ChartVersion  string `json:"chartVersion"`
	DeployVersion string `json:"deployVersion"`
}

type CollectorGatewayPorts

type CollectorGatewayPorts map[string]string

type ElasticConfig

type ElasticConfig struct {
	Address  string `json:"address" mapstructure:"address"`
	User     string `json:"user" mapstructure:"user" secret:"true"`
	Password string `json:"password" mapstructure:"password" secret:"true"`
}

type GetCInstallConfigResponse

type GetCInstallConfigResponse struct {
	FileName string `json:"fileName"`
	Content  []byte `json:"content"`
}

type GetCInstallDocResponse

type GetCInstallDocResponse struct {
	InstallMD []byte `json:"installMd"`
}

type GetCInstallRequest

type GetCInstallRequest struct {
	ClusterID string `json:"clusterId" form:"clusterId"`
}

type HuaweiConfig

type HuaweiConfig struct {
	AccessKey    string `json:"accessKey" mapstructure:"access_key" secret:"true"`
	AccessSecret string `json:"accessSecret" mapstructure:"access_secret" secret:"true"`
}

type JSONField

type JSONField[T any] struct {
	Obj T
}

func (*JSONField[T]) AcceptExistedSecret

func (j *JSONField[T]) AcceptExistedSecret(oldV T)

func (*JSONField[T]) MarshalJSON

func (j *JSONField[T]) MarshalJSON() ([]byte, error)

func (*JSONField[T]) ReplaceSecret

func (j *JSONField[T]) ReplaceSecret()

func (*JSONField[T]) Scan

func (j *JSONField[T]) Scan(value interface{}) error

func (*JSONField[T]) UnmarshalJSON

func (j *JSONField[T]) UnmarshalJSON(data []byte) error

func (JSONField[T]) Value

func (j JSONField[T]) Value() (driver.Value, error)

type JaegerConfig

type JaegerConfig struct {
	Address string `json:"address" mapstructure:"address"`
}

type ListClusterResponse

type ListClusterResponse struct {
	Clusters []Cluster `json:"clusters"`
}

type LogAPI

type LogAPI struct {
	Clickhouse *ClickhouseConfig `json:"clickhouse"`
}

type LogIntegration

type LogIntegration struct {
	ClusterID string `json:"clusterId,omitempty" gorm:"primaryKey;column:cluster_id"`

	Mode string `json:"mode" gorm:"type:varchar(100);column:mode"`

	Name   string `json:"name" gorm:"type:json;column:name"`
	DBType string `json:"dbType" gorm:"type:json;column:db_type"`

	LogAPI               *JSONField[LogAPI]               `json:"logAPI,omitempty" gorm:"type:json;column:log_api"`
	LogSelfCollectConfig *JSONField[LogSelfCollectConfig] `json:"selfCollectConfig" gorm:"type:json;column:self_collect_config"`

	UpdatedAt int64 `json:"-" gorm:"autoUpdateTime:second"`
	IsDeleted bool  `json:"-" gorm:"column:is_deleted;default:false"`
}

type LogSelfCollectConfig

type LogSelfCollectConfig struct {
	Mode string `json:"mode"` // full,abnormal
}

type MetricAPI

type MetricAPI struct {
	VictoriaMetric *VictoriaMetricConfig `json:"victoriametric,omitempty"`
}

type MetricIntegration

type MetricIntegration struct {
	ClusterID string `json:"clusterId,omitempty" gorm:"primaryKey;column:cluster_id"`

	Mode   string `json:"mode" gorm:"type:varchar(100);column:mode"`
	Name   string `json:"name"`
	DSType string `json:"dsType"`

	MetricAPI *JSONField[MetricAPI] `json:"metricAPI" gorm:"type:json;column:metric_api"`

	UpdatedAt int64 `json:"-" gorm:"autoUpdateTime:second"`
	IsDeleted bool  `json:"-" gorm:"column:is_deleted;default:false"`
}

type Nbs3Config

type Nbs3Config struct {
	Address  string `json:"address" mapstructure:"address"`
	User     string `json:"user" mapstructure:"user" secret:"true"`
	Password string `json:"password" mapstructure:"password" secret:"true"`
}

type PinpointConfig

type PinpointConfig struct {
	Address string `json:"address" mapstructure:"address"`
}

type PrometheusConfig

type PrometheusConfig struct {
	ServerURL string `json:"serverURL"`
	Username  string `json:"username" secret:"true"`
	Password  string `json:"password" secret:"true"`
}

type SkywalkingConfig

type SkywalkingConfig struct {
	Address  string `json:"address" mapstructure:"address"`
	User     string `json:"user" mapstructure:"user" secret:"true"`
	Password string `json:"password" mapstructure:"password" secret:"true"`
}

type TraceAPI

type TraceAPI struct {
	Skywalking *SkywalkingConfig `json:"skywalking,omitempty" mapstructure:"skywalking"`
	Jaeger     *JaegerConfig     `json:"jaeger,omitempty" mapstructure:"jaeger"`
	Nbs3       *Nbs3Config       `json:"nbs3,omitempty" mapstructure:"nbs3"`
	Arms       *ArmsConfig       `json:"arms,omitempty" mapstructure:"arms"`
	Huawei     *HuaweiConfig     `json:"huawei,omitempty" mapstructure:"huawei"`
	Elastic    *ElasticConfig    `json:"elastic,omitempty" mapstructure:"elastic"`
	Pinpoint   *PinpointConfig   `json:"pinpoint,omitempty" mapstructure:"pinpoint"`

	// Second
	Timeout int64 `json:"timeout"`
}

TraceAPI contains config for different APM providers using secret:"true" to hide the secret

type TraceIntegration

type TraceIntegration struct {
	ClusterID string `json:"clusterId,omitempty" gorm:"primaryKey;column:cluster_id"`

	Mode    string `json:"mode" gorm:"type:varchar(100);column:mode"`
	ApmType string `json:"apmType" gorm:"type:varchar(100);column:apm_type"`

	TraceAPI          JSONField[TraceAPI]               `json:"traceAPI,omitempty" gorm:"type:json;column:trace_api"`
	SelfCollectConfig JSONField[TraceSelfCollectConfig] `json:"selfCollectConfig" gorm:"type:json;column:self_collect_config"`

	UpdatedAt int64 `json:"-" gorm:"autoUpdateTime:second"`
	IsDeleted bool  `gorm:"column:is_deleted;default:false"`
}

type TraceSelfCollectConfig

type TraceSelfCollectConfig struct {
	InstrumentAll        bool     `json:"instrumentAll"`
	InstrumentNS         []string `json:"instrumentNS,omitempty"`
	InstrumentDisabledNS []string `json:"instrumentDisabledNS,omitempty"`
}

type TriggerAdapterUpdateRequest

type TriggerAdapterUpdateRequest struct {
	LastUpdateTS int64 `form:"lastUpdateTS" json:"lastUpdateTS"`
}

type VictoriaMetricConfig

type VictoriaMetricConfig PrometheusConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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