Documentation ¶
Index ¶
- Constants
- Variables
- func AesDecrypt(cryptedStr, keyStr string) (string, error)
- func AesEncrypt(origDataStr, keyStr string) (string, error)
- func CURLPerform(method string, url string, body map[string]interface{}) (*simplejson.Json, error)
- func CheckSelfAndGetMasterControllerHostPort() (ok bool, masterCtrlIP string, httpPort, grpcPort int, err error)
- func Contains[T Comparable](slice []T, val T) bool
- func DecryptSecretKey(secretKey string) (string, error)
- func EncryptSecretKey(secretKey string) (string, error)
- func GenerateAesKey(input []byte) string
- func GenerateKuberneteClusterIDByMD5(md5 string) (string, error)
- func GenerateShortUUID() string
- func GenerateUUID(str string) string
- func GetArchType(arch string) int
- func GetCAMD5() string
- func GetCURLIP(ip string) string
- func GetEncryptKey(controllerIP, grpcServerPort, key string) (string, error)
- func GetLocalClusterID() (string, error)
- func GetMasterControllerHostPort() (masterIP string, httpPort, grpcPort int, err error)
- func GetNameSpace() string
- func GetNodeIP() string
- func GetNodeName() string
- func GetOsType(os string) int
- func GetPodIP() string
- func GetPodName() string
- func GetSelfController() (*mysql.Controller, error)
- func GetUUID(str string, namespace uuid.UUID) string
- func InitEnvData()
- func IsStandaloneRunningMode() bool
- func IsTCPActive(ip string, port int) error
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- type Comparable
- type DataChanged
- type GlobalConfig
- type KVPair
Constants ¶
View Source
const ( REMOTE_API_TIMEOUT = 30 INGESTER_API_PORT = 30106 )
View Source
const ( LOCALHOST = "127.0.0.1" MASTER_CONTROLLER_CHECK_PORT = 4040 )
View Source
const ( HEALTH_CHECK_INTERVAL = 60 * time.Second HEALTH_CHECK_URL = "http://%s:%d/v1/health/" )
View Source
const ( HOST_STATE_COMPLETE = 2 HOST_STATE_EXCEPTION = 4 HOST_STATE_MAINTENANCE = 5 HOST_TYPE_VM = 1 HOST_TYPE_NSP = 3 HOST_TYPE_DFI = 4 HOST_HTYPE_ESXI = 2 HOST_HTYPE_KVM = 3 HOST_HTYPE_HYPER_V = 5 HOST_HTYPE_GATEWAY = 6 )
View Source
const ( HOST_VCPUS = 8 HOST_MEMORY_MB = 16384 )
View Source
const ( HOST_TYPE_CONTROLLER = "controller" HOST_TYPE_ANALYZER = "analyzer" )
View Source
const ( CONTROLLER_NODE_TYPE_MASTER = 1 CONTROLLER_NODE_TYPE_SLAVE = 2 CONTROLLER_STATE_NORMAL = 2 CONTROLLER_STATE_EXCEPTION = 4 )
View Source
const ( ARCH_X86 = 1 ARCH_ARM = 2 )
View Source
const ( OS_CENTOS = 1 OS_REDHAT = 2 OS_UBUNTU = 3 OS_SUSE = 4 OS_WINDOWS = 5 OS_ANDROID = 6 )
View Source
const ( VTAP_ENABLE_FALSE = 0 VTAP_ENABLE_TRUE = 1 )
View Source
const ( VTAP_STATE_NOT_CONNECTED = iota VTAP_STATE_NORMAL VTAP_STATE_DISABLE VTAP_STATE_PENDING )
View Source
const ( VTAP_STATE_NOT_CONNECTED_STR = "LOST" VTAP_STATE_NORMAL_STR = "RUNNING" VTAP_STATE_DISABLE_STR = "DISABLE" VTAP_STATE_PENDING_STR = "PENDING" )
View Source
const ( VTAP_TYPE_KVM = 1 + iota VTAP_TYPE_ESXI VTAP_TYPE_WORKLOAD_V VTAP_TYPE_WORKLOAD_P VTAP_TYPE_DEDICATED VTAP_TYPE_POD_HOST VTAP_TYPE_POD_VM VTAP_TYPE_TUNNEL_DECAPSULATION VTAP_TYPE_HYPER_V VTAP_TYPE_K8S_SIDECAR )
View Source
const ( VTAP_EXCEPTION_LICENSE_NOT_ENGOUTH = 0x10000000 VTAP_EXCEPTION_ALLOC_ANALYZER_FAILED = 0x40000000 VTAP_EXCEPTION_ALLOC_CONTROLLER_FAILED = 0x80000000 )
need synchronized update with the cli
View Source
const ( VTAP_LICENSE_TYPE_NONE = iota VTAP_LICENSE_TYPE_A VTAP_LICENSE_TYPE_B VTAP_LICENSE_TYPE_C VTAP_LICENSE_TYPE_DEDICATED VTAP_LICENSE_TYPE_MAX )
View Source
const ( VTAP_LICENSE_FUNCTION_NONE = iota VTAP_LICENSE_FUNCTION_TRAFFIC_DISTRIBUTION VTAP_LICENSE_FUNCTION_NETWORK_MONITORING VTAP_LICENSE_FUNCTION_CALL_MONITORING VTAP_LICENSE_FUNCTION_FUNCTION_MONITORING VTAP_LICENSE_FUNCTION_APPLICATION_MONITORING VTAP_LICENSE_FUNCTION_INDICATOR_MONITORING VTAP_LICENSE_FUNCTION_DATABASE_MONITORING VTAP_LICENSE_FUNCTION_MAX )
View Source
const ( DEFAULT_DOMAIN = "ffffffff-ffff-ffff-ffff-ffffffffffff" DEFAULT_REGION = "ffffffff-ffff-ffff-ffff-ffffffffffff" DEFAULT_AZ = "ffffffff-ffff-ffff-ffff-ffffffffffff" DEFAULT_VTAP_GROUP_ID = 1 DEFAULT_DOMAIN_ICON = -3 DEFAULT_REGION_NAME = "系统默认" )
View Source
const ( DOMAIN_ENABLED_FALSE = 0 DOMAIN_ENABLED_TRUE = 1 DOMAIN_STATE_NORMAL = 1 )
View Source
const ( NPB_POLICY_FLOW_DROP = 0 NPB_POLICY_FLOW_DISTRIBUTE = 1 )
View Source
const ( DEFAULT_ENCRYPTION_PASSWORD = "******" DEFAULT_ALL_MATCH_REGEX = ".*" DEFAULT_NOT_MATCH_REGEX = "^$" DEFAULT_PORT_NAME_REGEX = "^(cni|flannel|vxlan.calico|tunl|en[ospx])" OPENSTACK = 1 VSPHERE = 2 NSP = 3 TENCENT = 4 FILEREADER = 5 AWS = 6 PINGAN = 7 ZSTACK = 8 ALIYUN = 9 HUAWEI_PRIVATE = 10 KUBERNETES = 11 SIMULATION = 12 HUAWEI = 13 QINGCLOUD = 14 QINGCLOUD_PRIVATE = 15 F5 = 16 CMB_CMDB = 17 AZURE = 18 APSARA_STACK = 19 TENCENT_TCE = 20 KINGSOFT_PRIVATE = 22 AGENT_SYNC = 23 MICROSOFT_ACS = 24 BAIDU_BCE = 25 ESHORE = 26 CLOUD_TOWER = 27 NFVO = 28 OPENSTACK_EN = "openstack" VSPHERE_EN = "vsphere" NSP_EN = "nsp" TENCENT_EN = "tencent" FILEREADER_EN = "filereader" AWS_EN = "aws" PINGAN_EN = "pingan" ZSTACK_EN = "zstack" ALIYUN_EN = "aliyun" HUAWEI_PRIVATE_EN = "huawei_private" KUBERNETES_EN = "kubernetes" SIMULATION_EN = "simulation" HUAWEI_EN = "huawei" QINGCLOUD_EN = "qingcloud" QINGCLOUD_PRIVATE_EN = "qingcloud_private" F5_EN = "f5" CMB_CMDB_EN = "cmb_cmdb" AZURE_EN = "azure" APSARA_STACK_EN = "apsara_stack" TENCENT_TCE_EN = "tencent_tce" ESHORE_EN = "eshore" QINGCLOUD_K8S_EN = "qingcloud_k8s" KINGSOFT_PRIVATE_EN = "kingsoft_private" AGENT_SYNC_EN = "genesis" MICROSOFT_ACS_EN = "microsoft_acs" BAIDU_BCE_EN = "baidu_bce" CLOUD_TOWER_EN = "cloudtower" NFVO_EN = "nfvo" TENCENT_CH = "腾讯云" PINGAN_CH = "平安云" ALIYUN_CH = "阿里云" HUAWEI_CH = "华为云" QINGCLOUD_CH = "青云" KINGSOFT_PRIVATE_CH = "金山银河云" MICROSOFT_CH = "微软云" BAIDU_BCE_CH = "百度云" ESHORE_CH = "亿迅云" NFVO_CH = "华为NFVO+" OPENSTACK_CH = "OpenStack" VSPHERE_CH = "vSphere" NSP_CH = "NSP" AWS_CH = "AWS" ZSTACK_CH = "ZStack" KUBERNETES_CH = "Kubernetes" CLOUD_TOWER_CH = "CloudTower" )
View Source
const ( NETWORK_ISP_LCUUID = "ffffffff-ffff-ffff-ffff-ffffffffffff" NETWORK_TYPE_WAN = 3 NETWORK_TYPE_LAN = 4 SUBNET_ISP_LCUUID = "ffffffff-ffff-ffff-ffff-ffffffffffff" )
View Source
const ( VM_STATE_RUNNING = 4 VM_STATE_STOPPED = 9 VM_STATE_EXCEPTION = 11 VM_HTYPE_VM_C = 1 VM_HTYPE_BM_C = 2 VM_HTYPE_VM_N = 3 VM_HTYPE_BM_N = 4 VM_HTYPE_VM_S = 5 VM_HTYPE_BM_S = 6 )
View Source
const ( VIF_DEFAULT_MAC = "00:00:00:00:00:00" VIF_TYPE_WAN = 3 VIF_TYPE_LAN = 4 VIF_DEVICE_TYPE_VM = 1 VIF_DEVICE_TYPE_VROUTER = 5 VIF_DEVICE_TYPE_HOST = 6 VIF_DEVICE_TYPE_DHCP_PORT = 9 VIF_DEVICE_TYPE_POD = 10 VIF_DEVICE_TYPE_POD_SERVICE = 11 VIF_DEVICE_TYPE_REDIS_INSTANCE = 12 VIF_DEVICE_TYPE_RDS_INSTANCE = 13 VIF_DEVICE_TYPE_POD_NODE = 14 VIF_DEVICE_TYPE_LB = 15 VIF_DEVICE_TYPE_NAT_GATEWAY = 16 VIF_DEVICE_TYPE_INTERNET = 0 VIF_DEVICE_TYPE_POD_GROUP = 101 VIF_DEVICE_TYPE_SERVICE = 102 VIF_DEVICE_TYPE_GPROCESS = 120 VIF_DEVICE_TYPE_POD_GROUP_DEPLOYMENT = 130 VIF_DEVICE_TYPE_POD_GROUP_STATEFULSET = 131 VIF_DEVICE_TYPE_POD_GROUP_RC = 132 VIF_DEVICE_TYPE_POD_GROUP_DAEMON_SET = 133 VIF_DEVICE_TYPE_POD_GROUP_REPLICASET_CONTROLLER = 134 VIF_DEVICE_TYPE_POD_GROUP_CLONESET = 135 VIF_DEVICE_TYPE_IP = 255 )
View Source
const ( CREATE_METHOD_LEARN = 0 CREATE_METHOD_USER_DEFINE = 1 CONTACT_CREATE_METHOD_LEARN = 1 // TODO 修改与其他统一 )
View Source
const ( SECURITY_GROUP_RULE_UNKNOWN = 0 SECURITY_GROUP_RULE_ACCEPT = 1 SECURITY_GROUP_RULE_DROP = 2 SECURITY_GROUP_RULE_INGRESS = 1 SECURITY_GROUP_RULE_EGRESS = 2 SECURITY_GROUP_IP_TYPE_UNKNOWN = 0 SECURITY_GROUP_RULE_IPV4 = 1 SECURITY_GROUP_RULE_IPV6 = 2 SECURITY_GROUP_RULE_IPV4_CIDR = "0.0.0.0/0" SECURITY_GROUP_RULE_IPV6_CIDR = "::/0" )
View Source
const ( ROUTING_TABLE_TYPE_VPN = "vpn" ROUTING_TABLE_TYPE_LOCAL = "local" ROUTING_TABLE_TYPE_ROUTER = "router" ROUTING_TABLE_TYPE_NAT_GATEWAY = "nat-gateway" ROUTING_TABLE_TYPE_PEER_CONNECTION = "peer-connection" ROUTING_TABLE_TYPE_INSTANCE = "Instance" ROUTING_TABLE_TYPE_IP = "IP" )
View Source
const ( LB_MODEL_INTERNAL = 1 LB_MODEL_EXTERNAL = 2 LB_SERVER_TYPE_VM = 1 LB_SERVER_TYPE_IP = 2 )
View Source
const ( RDS_UNKNOWN = 0 RDS_TYPE_MYSQL = 1 RDS_TYPE_SQL_SERVER = 2 RDS_TYPE_PPAS = 3 RDS_TYPE_PSQL = 4 // PostgreSQL RDS_TYPE_MARIADB = 5 RDS_STATE_RUNNING = 1 RDS_STATE_RESTORING = 2 RDS_SERIES_BASIC = 1 RDS_SERIES_HA = 2 RDS_MODEL_PRIMARY = 1 RDS_MODEL_READONLY = 2 RDS_MODEL_TEMPORARY = 3 RDS_MODEL_GUARD = 4 RDS_MODEL_SHARE = 5 )
View Source
const ( INTERVAL_1MINUTE = 60 INTERVAL_1HOUR = 3600 INTERVAL_1DAY = 86400 INTERVAL_1WEEK = 604800 INTERVAL_1MONTH = 2678400 INTERVAL_1YEAR = 31536000 )
View Source
const ( DATA_SOURCE_FLOW = "flow_metrics.vtap_flow*" DATA_SOURCE_APP = "flow_metrics.vtap_app*" DATA_SOURCE_STATE_EXCEPTION = 0 DATA_SOURCE_STATE_NORMAL = 1 )
View Source
const ( IPV4_MAX_MASK = 32 IPV6_MAX_MASK = 128 IPV4_DEFAULT_NETMASK = 24 IPV6_DEFAULT_NETMASK = 64 )
View Source
const ( POD_NODE_TYPE_MASTER = 1 POD_NODE_TYPE_NODE = 2 POD_NODE_STATE_EXCEPTION = 0 POD_NODE_STATE_NORMAL = 1 POD_NODE_SERVER_TYPE_HOST = 1 POD_NODE_SERVER_TYPE_VM = 2 )
View Source
const ( POD_SERVICE_TYPE_CLUSTERIP = 1 POD_SERVICE_TYPE_NODEPORT = 2 )
View Source
const ( POD_GROUP_DEPLOYMENT = 1 POD_GROUP_STATEFULSET = 2 POD_GROUP_RC = 3 POD_GROUP_DAEMON_SET = 4 POD_GROUP_REPLICASET_CONTROLLER = 5 POD_GROUP_CLONESET = 6 )
View Source
const ( POD_STATE_EXCEPTION = 0 POD_STATE_RUNNING = 1 )
View Source
const ( K8S_POD_IPV4_NETMASK = 16 K8S_POD_IPV6_NETMASK = 64 )
View Source
const ( RESOURCE_STATE_CODE_SUCCESS = 1 RESOURCE_STATE_CODE_DELETING = 2 RESOURCE_STATE_CODE_EXCEPTION = 3 RESOURCE_STATE_CODE_WARNING = 4 )
View Source
const ( NODE_NAME_KEY = "K8S_NODE_NAME_FOR_OBSERVATRACE" NODE_IP_KEY = "K8S_NODE_IP_FOR_OBSERVATRACE" POD_NAME_KEY = "K8S_POD_NAME_FOR_OBSERVATRACE" POD_IP_KEY = "K8S_POD_IP_FOR_OBSERVATRACE" NAME_SPACE_KEY = "K8S_NAMESPACE_FOR_OBSERVATRACE" RUNNING_MODE_KEY = "OBSERVATRACE_SERVER_RUNNING_MODE" )
View Source
const ( OBSERVATRACE_STATSD_PREFIX = "observatrace_server_controller" CLOUD_METRIC_NAME_TASK_COST = "cloud_task_cost" CLOUD_METRIC_NAME_INFO_COUNT = "cloud_info_count" CLOUD_METRIC_NAME_API_COUNT = "cloud_api_count" CLOUD_METRIC_NAME_API_COST = "cloud_api_cost" GENESIS_METRIC_NAME_K8SINFO_DELAY = "genesis_k8sinfo_delay" )
View Source
const ( TAPMODE_LOCAL = 0 TAPMODE_MIRROR = 1 TAPMODE_ANALYZER = 2 TAPMODE_DECAP = 3 )
View Source
const ( AGENT_IDENTIFIE_IP_AND_MAC = 1 AGENT_IDENTIFIE_IP = 2 )
View Source
const ( BILLING_METHOD_LICENSE = "license" BILLING_METHOD_VOUCHER = "voucher" )
View Source
const ( PLUGIN_TYPE_WASM = 1 PLUGIN_TYPE_SO = 2 )
plugin
View Source
const ( PROMETHEUS_TARGET_CREATE_METHOD_RECORDER = 1 PROMETHEUS_TARGET_CREATE_METHOD_PROMETHEUS = 2 )
View Source
const ( ANALYZER_ALLOC_BY_INGESTED_DATA = "by-ingested-data" ANALYZER_ALLOC_BY_AGENT_COUNT = "by-agent-count" )
View Source
const ( RESOURCE_TYPE_REGION_EN = "region" RESOURCE_TYPE_AZ_EN = "az" RESOURCE_TYPE_SUB_DOMAIN_EN = "sub_domain" RESOURCE_TYPE_HOST_EN = "host" RESOURCE_TYPE_VM_EN = "vm" RESOURCE_TYPE_VPC_EN = "vpc" RESOURCE_TYPE_NETWORK_EN = "network" RESOURCE_TYPE_SUBNET_EN = "subnet" RESOURCE_TYPE_VROUTER_EN = "vrouter" RESOURCE_TYPE_ROUTING_TABLE_EN = "routing_table" RESOURCE_TYPE_DHCP_PORT_EN = "dhcp_port" RESOURCE_TYPE_VINTERFACE_EN = "vinterface" RESOURCE_TYPE_WAN_IP_EN = "wan_ip" RESOURCE_TYPE_LAN_IP_EN = "lan_ip" RESOURCE_TYPE_FLOATING_IP_EN = "floating_ip" RESOURCE_TYPE_SECURITY_GROUP_EN = "security_group" RESOURCE_TYPE_SECURITY_GROUP_RULE_EN = "security_group_rule" RESOURCE_TYPE_VM_SECURITY_GROUP_EN = "vm_security_group" RESOURCE_TYPE_NAT_GATEWAY_EN = "nat_gateway" RESOURCE_TYPE_NAT_RULE_EN = "nat_rule" RESOURCE_TYPE_NAT_VM_CONNECTION_EN = "nat_vm_connection" RESOURCE_TYPE_LB_EN = "lb" RESOURCE_TYPE_LB_VM_CONNECTION_EN = "lb_vm_connection" RESOURCE_TYPE_LB_LISTENER_EN = "lb_listener" RESOURCE_TYPE_LB_TARGET_SERVER_EN = "lb_target_server" RESOURCE_TYPE_PEER_CONNECTION_EN = "peer_connection" RESOURCE_TYPE_CEN_EN = "cen" RESOURCE_TYPE_RDS_INSTANCE_EN = "rds_instance" RESOURCE_TYPE_REDIS_INSTANCE_EN = "redis_instance" RESOURCE_TYPE_POD_CLUSTER_EN = "pod_cluster" RESOURCE_TYPE_POD_NODE_EN = "pod_node" RESOURCE_TYPE_VM_POD_NODE_CONNECTION_EN = "vm_pod_node_connection" RESOURCE_TYPE_POD_NAMESPACE_EN = "pod_namespace" RESOURCE_TYPE_POD_INGRESS_EN = "pod_ingress" RESOURCE_TYPE_POD_INGRESS_RULE_EN = "pod_ingress_rule" RESOURCE_TYPE_POD_INGRESS_RULE_BACKEND_EN = "pod_ingress_rule_backend" RESOURCE_TYPE_POD_SERVICE_EN = "pod_service" RESOURCE_TYPE_POD_SERVICE_PORT_EN = "pod_service_port" RESOURCE_TYPE_POD_GROUP_EN = "pod_group" RESOURCE_TYPE_POD_GROUP_PORT_EN = "pod_group_port" RESOURCE_TYPE_POD_REPLICA_SET_EN = "pod_replica_set" RESOURCE_TYPE_POD_EN = "pod" RESOURCE_TYPE_PROCESS_EN = "process" RESOURCE_TYPE_PROMETHEUS_TARGET_EN = "prometheus_target" RESOURCE_TYPE_VIP_EN = "vip" // http api resource type RESOURCE_TYPE_IP_EN = "ip" RESOURCE_TYPE_ALL_IP_EN = "all_ip" RESOURCE_TYPE_LB_RULE_EN = "lb_rule" )
View Source
const (
ACL_STATE_ENABLE = 1
)
View Source
const (
DATA_SOURCE_OBSERVATRACE_SYSTEM_INTERVAL = 10
)
View Source
const GO_BIRTHDAY = "2006-01-02 15:04:05"
View Source
const K8S_CA_CRT_PATH = "/run/secrets/kubernetes.io/serviceaccount/ca.crt"
View Source
const (
PROCESS_INSTANCE_TYPE = 120 // used in process event
)
View Source
const (
REDIS_STATE_RUNNING = 1
)
View Source
const (
RUNNING_MODE_STANDALONE = "STANDALONE"
)
View Source
const SHORT_UUID_LENGTH int = 10
View Source
const (
STRINGS_JOIN_COMMA = ","
)
View Source
const (
SUB_DOMAIN_ERROR_DISPLAY_NUM = 10
)
View Source
const VTAP_LICENSE_CHECK_INTERVAL = time.Minute
Variables ¶
View Source
var ( TCP = 6 UDP = 17 )
View Source
var ( DefaultMaxCollectPps = 200000 DefaultMaxNpbBps = int64(1000000000) DefaultMaxCPUs = 1 DefaultMaxMemory = 768 DefaultSyncInterval = 60 DefaultStatsInterval = 10 DefaultRsyslogEnabled = 1 DefaultMaxTxBandwidth = int64(0) DefaultBandwidthProbeInterval = 10 DefaultTapInterfaceRegex = "^(tap.*|cali.*|veth.*|eth.*|en[osipx].*|lxc.*|lo|[0-9a-f]+_h)$" DefaultMaxEscapeSeconds = 3600 DefaultMtu = 1500 DefaultOutputVlan = 0 DefaultCollectorSocketType = "TCP" DefaultCompressorSocketType = "TCP" DefaultNpbSocketType = "RAW_UDP" DefaultNpbVlanMode = 0 DefaultCollectorEnabled = 1 DefaultVTapFlow1sEnabled = 1 DefaultL4LogTapTypes = "0" DefaultL4LogIgnoreTapSides = "" DefaultL7LogIgnoreTapSides = "" DefaultNpbDedupEnabled = 1 DefaultPlatformEnabled = 0 DefaultIfMacSource = 0 DefaultVMXMLPath = "/etc/libvirt/qemu/" DefaultExtraNetnsRegex = "" DefaultNatIPEnabled = 0 DefaultCapturePacketSize = 65535 DefaultInactiveServerPortEnabled = 1 DefaultInactiveIPEnabled = 1 DefaultLogThreshold = 300 DefaultLogLevel = "INFO" DefaultLogRetention = 30 DefaultHTTPLogProxyClient = "X-Forwarded-For" DefaultHTTPLogTraceID = "traceparent, sw8" DefaultL7LogPacketSize = 1024 DefaultL4LogCollectNpsThreshold = 10000 DefaultL7LogCollectNpsThreshold = 10000 DefaultL7MetricsEnabled = 1 DefaultL7LogStoreTapTypes = "0" DefaultCaptureSocketType = 0 DefaultCaptureBpf = "" DefaultTapMode = TAPMODE_LOCAL DefaultThreadThreshold = 500 DefaultProcessThreshold = 10 DefaultNtpEnabled = 0 DefaultL4PerformanceEnabled = 1 DefaultPodClusterInternalIP = 0 DefaultDomains = "0" DefaultDecapType = "1,2" DefaultHTTPLogSpanID = "traceparent, sw8" DefaultSysFreeMemoryLimit = 0 DefaultLogFileSize = 1000 DefaultHTTPLogXRequestID = "X-Request-ID" DefaultExternalAgentHTTPProxyEnabled = 1 // 外部Agent数据HTTP代理开关 DefaultExternalAgentHTTPProxyPort = 38086 DefaultPrometheusHttpAPIAddresses = "" DefaultAnalyzerPort = 30033 DefaultProxyControllerPort = 30035 DefaultProxyControllerIP = "" DefaultAnalyzerIP = "" DefaultWasmPlugins = "" DefaultSoPlugins = "" )
View Source
var CAMD5 string
View Source
var CloudMonitorExceptionAPI = map[string]string{ ALIYUN_EN: "NetworkInterfaceSet,ListenerPortAndProtocol,BackendServer,SnatTableEntry,ForwardTableEntry,KVStoreZone,RouteEntry,Permission", TENCENT_EN: "Listeners,NetworkInterfaceSet", OPENSTACK_EN: "services,users", QINGCLOUD_EN: "DescribeSecurityGroupIPSets,DescribeSecurityGroupRules,DescribeLoadBalancerListeners,DescribeLoadBalancerBackends,DescribeNics,DescribeEips", APSARA_STACK_EN: "NetworkInterfaceSet,ListenerPortAndProtocol,BackendServer,SnatTableEntry,ForwardTableEntry,RouteEntry,Permission", TENCENT_TCE_EN: "DescribeNetworkInterfacesEx,DescribeSecurityGroupPolicy", QINGCLOUD_PRIVATE_EN: "DescribeSecurityGroupIPSets,DescribeSecurityGroupRules,DescribeLoadBalancerListeners,DescribeLoadBalancerBackends,DescribeNics,DescribeEips", }
View Source
var DefaultVTapGroupConfig = &mysql.VTapGroupConfiguration{ MaxCollectPps: &DefaultMaxCollectPps, MaxNpbBps: &DefaultMaxNpbBps, MaxCPUs: &DefaultMaxCPUs, MaxMemory: &DefaultMaxMemory, SyncInterval: &DefaultSyncInterval, StatsInterval: &DefaultStatsInterval, RsyslogEnabled: &DefaultRsyslogEnabled, MaxTxBandwidth: &DefaultMaxTxBandwidth, BandwidthProbeInterval: &DefaultBandwidthProbeInterval, TapInterfaceRegex: &DefaultTapInterfaceRegex, MaxEscapeSeconds: &DefaultMaxEscapeSeconds, Mtu: &DefaultMtu, OutputVlan: &DefaultOutputVlan, CollectorSocketType: &DefaultCollectorSocketType, CompressorSocketType: &DefaultCompressorSocketType, NpbSocketType: &DefaultNpbSocketType, NpbVlanMode: &DefaultNpbVlanMode, CollectorEnabled: &DefaultCollectorEnabled, VTapFlow1sEnabled: &DefaultVTapFlow1sEnabled, L4LogTapTypes: &DefaultL4LogTapTypes, L4LogIgnoreTapSides: &DefaultL4LogIgnoreTapSides, L7LogIgnoreTapSides: &DefaultL7LogIgnoreTapSides, NpbDedupEnabled: &DefaultNpbDedupEnabled, PlatformEnabled: &DefaultPlatformEnabled, IfMacSource: &DefaultIfMacSource, VMXMLPath: &DefaultVMXMLPath, NatIPEnabled: &DefaultNatIPEnabled, CapturePacketSize: &DefaultCapturePacketSize, InactiveServerPortEnabled: &DefaultInactiveServerPortEnabled, InactiveIPEnabled: &DefaultInactiveIPEnabled, LogThreshold: &DefaultLogThreshold, LogLevel: &DefaultLogLevel, LogRetention: &DefaultLogRetention, HTTPLogProxyClient: &DefaultHTTPLogProxyClient, HTTPLogTraceID: &DefaultHTTPLogTraceID, L7LogPacketSize: &DefaultL7LogPacketSize, L4LogCollectNpsThreshold: &DefaultL4LogCollectNpsThreshold, L7LogCollectNpsThreshold: &DefaultL7LogCollectNpsThreshold, L7MetricsEnabled: &DefaultL7MetricsEnabled, L7LogStoreTapTypes: &DefaultL7LogStoreTapTypes, CaptureSocketType: &DefaultCaptureSocketType, CaptureBpf: &DefaultCaptureBpf, TapMode: &DefaultTapMode, ThreadThreshold: &DefaultThreadThreshold, ProcessThreshold: &DefaultProcessThreshold, NtpEnabled: &DefaultNtpEnabled, L4PerformanceEnabled: &DefaultL4PerformanceEnabled, PodClusterInternalIP: &DefaultPodClusterInternalIP, Domains: &DefaultDomains, DecapType: &DefaultDecapType, HTTPLogSpanID: &DefaultHTTPLogSpanID, SysFreeMemoryLimit: &DefaultSysFreeMemoryLimit, LogFileSize: &DefaultLogFileSize, HTTPLogXRequestID: &DefaultHTTPLogXRequestID, ExternalAgentHTTPProxyEnabled: &DefaultExternalAgentHTTPProxyEnabled, ExternalAgentHTTPProxyPort: &DefaultExternalAgentHTTPProxyPort, PrometheusHttpAPIAddresses: &DefaultPrometheusHttpAPIAddresses, AnalyzerPort: &DefaultAnalyzerPort, ProxyControllerPort: &DefaultProxyControllerPort, ProxyControllerIP: &DefaultProxyControllerIP, AnalyzerIP: &DefaultAnalyzerIP, WasmPlugins: &DefaultWasmPlugins, SoPlugins: &DefaultSoPlugins, }
View Source
var DomainTypeToIconID = map[int]int{ KUBERNETES: 14, }
View Source
var IconNameToDomainTypes = map[string][]int{ OPENSTACK_CH: {OPENSTACK}, VSPHERE_CH: {VSPHERE}, NSP_CH: {NSP}, TENCENT_CH: {TENCENT, TENCENT_TCE}, AWS_CH: {AWS}, PINGAN_CH: {PINGAN}, ZSTACK_CH: {ZSTACK}, ALIYUN_CH: {ALIYUN, APSARA_STACK}, KUBERNETES_CH: {KUBERNETES}, HUAWEI_CH: {HUAWEI, HUAWEI_PRIVATE}, QINGCLOUD_CH: {QINGCLOUD, QINGCLOUD_PRIVATE}, MICROSOFT_CH: {AZURE, CMB_CMDB, MICROSOFT_ACS}, KINGSOFT_PRIVATE_CH: {KINGSOFT_PRIVATE}, BAIDU_BCE_CH: {BAIDU_BCE}, }
TODO delete tagrecorder dup definition
View Source
var NodeName, NodeIP, PodName, PodIP, NameSpace string
View Source
var ( PluginTypeName = map[int]string{ PLUGIN_TYPE_WASM: "wasm", PLUGIN_TYPE_SO: "so", } )
View Source
var ProtocolMap = map[string]int{ "TCP": TCP, "UDP": UDP, }
View Source
var VTAP_TYPE_TO_DEVICE_TYPE = map[int]int{ VTAP_TYPE_KVM: VIF_DEVICE_TYPE_HOST, VTAP_TYPE_ESXI: VIF_DEVICE_TYPE_HOST, VTAP_TYPE_WORKLOAD_V: VIF_DEVICE_TYPE_VM, VTAP_TYPE_WORKLOAD_P: VIF_DEVICE_TYPE_VM, VTAP_TYPE_DEDICATED: 0, VTAP_TYPE_POD_HOST: VIF_DEVICE_TYPE_POD_NODE, VTAP_TYPE_POD_VM: VIF_DEVICE_TYPE_POD_NODE, VTAP_TYPE_TUNNEL_DECAPSULATION: 0, VTAP_TYPE_HYPER_V: VIF_DEVICE_TYPE_HOST, VTAP_TYPE_K8S_SIDECAR: VIF_DEVICE_TYPE_POD, }
View Source
var VTapExceptionChinese = map[int64]string{ 2 << 0: "自检失败:日志所在磁盘剩余空间不足100MB", 2 << 1: "自检失败:可用内存不足", 2 << 2: "自检失败:Coredump文件过多", 2 << 3: "分发熔断", 2 << 4: "分发流量达到限速", 2 << 5: "到分发点的网关ARP无法找到", 2 << 6: "采集包速率达到限速", 2 << 7: "到数据节点的网关ARP无法找到", 2 << 8: "控制器下发的配置信息校验不通过", 2 << 9: "采集器线程数超限", 2 << 10: "采集器进程数超限", 2 << 11: "采集器编译生成的分发和PCAP策略数量超限", 2 << 12: "空闲内存超限", 2 << 13: "日志文件大小超限", 2 << 14: "控制SOCKET错误", 2 << 15: "数据SOCKET错误", 2 << 16: "分发SOCKET错误", 2 << 17: "集成SOCKET错误", 2 << 18: "CGROUPS配置错误", VTAP_EXCEPTION_LICENSE_NOT_ENGOUTH: "采集器授权个数不足", VTAP_EXCEPTION_ALLOC_ANALYZER_FAILED: "分配数据节点失败", VTAP_EXCEPTION_ALLOC_CONTROLLER_FAILED: "分配控制器失败", }
View Source
var ( VTapStateToChinese = map[int]string{ VTAP_STATE_NOT_CONNECTED: "失联", VTAP_STATE_NORMAL: "运行", VTAP_STATE_DISABLE: "禁用", VTAP_STATE_PENDING: "未注册", } )
View Source
var VTapToChangeTapModes = map[int][]int{ VTAP_TYPE_KVM: []int{TAPMODE_LOCAL, TAPMODE_MIRROR}, VTAP_TYPE_ESXI: []int{TAPMODE_LOCAL, TAPMODE_MIRROR}, VTAP_TYPE_WORKLOAD_V: []int{TAPMODE_LOCAL, TAPMODE_MIRROR}, VTAP_TYPE_WORKLOAD_P: []int{TAPMODE_LOCAL, TAPMODE_MIRROR}, VTAP_TYPE_DEDICATED: []int{TAPMODE_ANALYZER}, VTAP_TYPE_POD_HOST: []int{TAPMODE_LOCAL, TAPMODE_MIRROR}, VTAP_TYPE_POD_VM: []int{TAPMODE_LOCAL, TAPMODE_MIRROR}, VTAP_TYPE_TUNNEL_DECAPSULATION: []int{TAPMODE_DECAP}, VTAP_TYPE_HYPER_V: []int{TAPMODE_LOCAL, TAPMODE_MIRROR}, VTAP_TYPE_K8S_SIDECAR: []int{TAPMODE_LOCAL, TAPMODE_MIRROR}, }
View Source
var VTapTypeChinese = map[int]string{ VTAP_TYPE_KVM: "KVM", VTAP_TYPE_ESXI: "ESXI", VTAP_TYPE_WORKLOAD_V: "云服务器-V", VTAP_TYPE_WORKLOAD_P: "云服务器-P", VTAP_TYPE_DEDICATED: "专属服务器", VTAP_TYPE_POD_HOST: "容器-P", VTAP_TYPE_POD_VM: "容器-V", VTAP_TYPE_TUNNEL_DECAPSULATION: "隧道解封装", VTAP_TYPE_HYPER_V: "Hyper-V", VTAP_TYPE_K8S_SIDECAR: "K8s-Sidecar", }
View Source
var VTapTypeName = map[int]string{ VTAP_TYPE_KVM: "KVM", VTAP_TYPE_ESXI: "ESXI", VTAP_TYPE_WORKLOAD_V: "CHOST_VM", VTAP_TYPE_WORKLOAD_P: "CHOST_BM", VTAP_TYPE_DEDICATED: "DEDICATED", VTAP_TYPE_POD_HOST: "K8S_BM", VTAP_TYPE_POD_VM: "K8S_VM", VTAP_TYPE_TUNNEL_DECAPSULATION: "TUN_DECAP", VTAP_TYPE_HYPER_V: "HYPER_V", VTAP_TYPE_K8S_SIDECAR: "K8S_SIDECAR", }
View Source
var VtapTapModeName = map[int]string{ TAPMODE_LOCAL: "本地", TAPMODE_MIRROR: "镜像", TAPMODE_ANALYZER: "专属", TAPMODE_DECAP: "隧道解封装", }
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func CURLPerform ¶
功能:调用其他模块API并获取返回结果
func Contains ¶
func Contains[T Comparable](slice []T, val T) bool
func DecryptSecretKey ¶
func EncryptSecretKey ¶
func GenerateAesKey ¶
func GenerateShortUUID ¶
func GenerateShortUUID() string
func GenerateUUID ¶
func GetArchType ¶
func GetEncryptKey ¶
func GetLocalClusterID ¶
func GetNameSpace ¶
func GetNameSpace() string
func GetNodeName ¶
func GetNodeName() string
func GetPodName ¶
func GetPodName() string
func GetSelfController ¶
func GetSelfController() (*mysql.Controller, error)
func InitEnvData ¶
func InitEnvData()
func IsStandaloneRunningMode ¶
func IsStandaloneRunningMode() bool
func IsTCPActive ¶
func PKCS7Padding ¶
func PKCS7UnPadding ¶
Types ¶
type Comparable ¶
type DataChanged ¶
type DataChanged string
const ( DATA_CHANGED_VTAP DataChanged = "vtap" DATA_CHANGED_ANALYZER DataChanged = "analyzer" DATA_CHANGED_PLATFORM_DATA DataChanged = "platform_data" DATA_CHANGED_FLOW_ACL DataChanged = "flow_acl" DATA_CHANGED_GROUP DataChanged = "group" DATA_CHANGED_TAP_TYPE DataChanged = "tap_type" DATA_CHANGED_SERVICE DataChanged = "service" )
type GlobalConfig ¶
type GlobalConfig struct { HTTPPort int HTTPNodePort int GRPCPort int GRPCNodePort int MySQLResultSetMax int }
var GConfig *GlobalConfig
Click to show internal directories.
Click to hide internal directories.