Documentation ¶
Index ¶
- Constants
- Variables
- func GetDNSExceptionDesc(errCode uint16) string
- func GetDubboExceptionDesc(errCode uint16) string
- func GetHTTPExceptionDesc(errCode uint16) string
- func GetKafkaExceptionDesc(errCode int16) string
- func GetMQTTV3ExceptionDesc(errCode uint16) string
- func GetMQTTV5ExceptionDesc(errCode uint16) string
- func IPIntToString(ipInt uint32) string
- func L4FlowLogColumns() []*ckdb.Column
- func L4PacketColumns() []*ckdb.Column
- func L7BaseColumns() []*ckdb.Column
- func L7FlowLogColumns() []*ckdb.Column
- func ReleaseL4FlowLog(l *L4FlowLog)
- func ReleaseL4Packet(l *L4Packet)
- func ReleaseL7FlowLog(l *L7FlowLog)
- type ApplicationLayer
- type DataLinkLayer
- type FlowInfo
- type Internet
- type KafakaCode
- type KnowledgeGraph
- func (k *KnowledgeGraph) FillL4(f *pb.Flow, isIPv6 bool, platformData *grpc.PlatformInfoTable)
- func (k *KnowledgeGraph) FillL7(l *pb.AppProtoLogsBaseInfo, platformData *grpc.PlatformInfoTable, ...)
- func (k *KnowledgeGraph) FillOTel(l *L7FlowLog, platformData *grpc.PlatformInfoTable)
- func (k *KnowledgeGraph) WriteBlock(block *ckdb.Block)
- type L4FlowLog
- type L4Packet
- type L7Base
- type L7FlowLog
- func (h *L7FlowLog) EndTime() time.Duration
- func (h *L7FlowLog) Fill(l *pb.AppProtoLogsData, platformData *grpc.PlatformInfoTable, ...)
- func (h *L7FlowLog) FillOTel(l *v1.Span, resAttributes []*v11.KeyValue, ...)
- func (h *L7FlowLog) GenerateNewFlowTags(cache *flow_tag.FlowTagCache)
- func (h *L7FlowLog) ID() uint64
- func (h *L7FlowLog) Release()
- func (h *L7FlowLog) StartTime() time.Duration
- func (h *L7FlowLog) String() string
- func (h *L7FlowLog) WriteBlock(block *ckdb.Block)
- type Metrics
- type NetworkLayer
- type TransportLayer
Constants ¶
View Source
const ( UNKNOWN_SERVER_ERROR = -1 NONE KafakaCode = 0 OFFSET_OUT_OF_RANGE = 1 CORRUPT_MESSAGE = 2 UNKNOWN_TOPIC_OR_PARTITION = 3 INVALID_FETCH_SIZE = 4 LEADER_NOT_AVAILABLE = 5 NOT_LEADER_OR_FOLLOWER = 6 REQUEST_TIMED_OUT = 7 BROKER_NOT_AVAILABLE = 8 REPLICA_NOT_AVAILABLE = 9 MESSAGE_TOO_LARGE = 10 STALE_CONTROLLER_EPOCH = 11 OFFSET_METADATA_TOO_LARGE = 12 NETWORK_EXCEPTION = 13 COORDINATOR_LOAD_IN_PROGRESS = 14 COORDINATOR_NOT_AVAILABLE = 15 NOT_COORDINATOR = 16 INVALID_TOPIC_EXCEPTION = 17 RECORD_LIST_TOO_LARGE = 18 NOT_ENOUGH_REPLICAS = 19 NOT_ENOUGH_REPLICAS_AFTER_APPEND = 20 INVALID_REQUIRED_ACKS = 21 ILLEGAL_GENERATION = 22 INCONSISTENT_GROUP_PROTOCOL = 23 INVALID_GROUP_ID = 24 UNKNOWN_MEMBER_ID = 25 INVALID_SESSION_TIMEOUT = 26 REBALANCE_IN_PROGRESS = 27 INVALID_COMMIT_OFFSET_SIZE = 28 TOPIC_AUTHORIZATION_FAILED = 29 GROUP_AUTHORIZATION_FAILED = 30 CLUSTER_AUTHORIZATION_FAILED = 31 INVALID_TIMESTAMP = 32 UNSUPPORTED_SASL_MECHANISM = 33 ILLEGAL_SASL_STATE = 34 UNSUPPORTED_VERSION = 35 TOPIC_ALREADY_EXISTS = 36 INVALID_PARTITIONS = 37 INVALID_REPLICATION_FACTOR = 38 INVALID_REPLICA_ASSIGNMENT = 39 INVALID_CONFIG = 40 NOT_CONTROLLER = 41 INVALID_REQUEST = 42 UNSUPPORTED_FOR_MESSAGE_FORMAT = 43 POLICY_VIOLATION = 44 OUT_OF_ORDER_SEQUENCE_NUMBER = 45 DUPLICATE_SEQUENCE_NUMBER = 46 INVALID_PRODUCER_EPOCH = 47 INVALID_TXN_STATE = 48 INVALID_PRODUCER_ID_MAPPING = 49 INVALID_TRANSACTION_TIMEOUT = 50 CONCURRENT_TRANSACTIONS = 51 TRANSACTION_COORDINATOR_FENCED = 52 TRANSACTIONAL_ID_AUTHORIZATION_FAILED = 53 SECURITY_DISABLED = 54 OPERATION_NOT_ATTEMPTED = 55 KAFKA_STORAGE_ERROR = 56 LOG_DIR_NOT_FOUND = 57 SASL_AUTHENTICATION_FAILED = 58 UNKNOWN_PRODUCER_ID = 59 REASSIGNMENT_IN_PROGRESS = 60 DELEGATION_TOKEN_AUTH_DISABLED = 61 DELEGATION_TOKEN_NOT_FOUND = 62 DELEGATION_TOKEN_OWNER_MISMATCH = 63 DELEGATION_TOKEN_REQUEST_NOT_ALLOWED = 64 DELEGATION_TOKEN_AUTHORIZATION_FAILED = 65 DELEGATION_TOKEN_EXPIRED = 66 INVALID_PRINCIPAL_TYPE = 67 NON_EMPTY_GROUP = 68 GROUP_ID_NOT_FOUND = 69 FETCH_SESSION_ID_NOT_FOUND = 70 INVALID_FETCH_SESSION_EPOCH = 71 LISTENER_NOT_FOUND = 72 TOPIC_DELETION_DISABLED = 73 FENCED_LEADER_EPOCH = 74 UNKNOWN_LEADER_EPOCH = 75 UNSUPPORTED_COMPRESSION_TYPE = 76 STALE_BROKER_EPOCH = 77 OFFSET_NOT_AVAILABLE = 78 MEMBER_ID_REQUIRED = 79 PREFERRED_LEADER_NOT_AVAILABLE = 80 GROUP_MAX_SIZE_REACHED = 81 FENCED_INSTANCE_ID = 82 ELIGIBLE_LEADERS_NOT_AVAILABLE = 83 ELECTION_NOT_NEEDED = 84 NO_REASSIGNMENT_IN_PROGRESS = 85 GROUP_SUBSCRIBED_TO_TOPIC = 86 INVALID_RECORD = 87 UNSTABLE_OFFSET_COMMIT = 88 THROTTLING_QUOTA_EXCEEDED = 89 PRODUCER_FENCED = 90 RESOURCE_NOT_FOUND = 91 DUPLICATE_RESOURCE = 92 UNACCEPTABLE_CREDENTIAL = 93 INCONSISTENT_VOTER_SET = 94 INVALID_UPDATE_VERSION = 95 FEATURE_UPDATE_FAILED = 96 PRINCIPAL_DESERIALIZATION_FAILURE = 97 SNAPSHOT_NOT_FOUND = 98 POSITION_OUT_OF_RANGE = 99 UNKNOWN_TOPIC_ID = 100 DUPLICATE_BROKER_REGISTRATION = 101 BROKER_ID_NOT_REGISTERED = 102 INCONSISTENT_TOPIC_ID = 103 INCONSISTENT_CLUSTER_ID = 104 TRANSACTIONAL_ID_NOT_FOUND = 105 FETCH_SESSION_TOPIC_ID_ERROR = 106 )
View Source
const BLOCK_HEAD_SIZE = 16
View Source
const (
UNKNOWN_SERVER_ERROR_DESC = "The server experienced an unexpected error when processing the request."
)
View Source
const (
US_TO_S_DEVISOR = 1000000 // 微秒转化为秒的除数
)
Variables ¶
View Source
var ApplicationLayerColumns = []*ckdb.Column{ ckdb.NewColumn("l7_protocol", ckdb.UInt8).SetIndex(ckdb.IndexMinmax), }
View Source
var DataLinkLayerColumns = []*ckdb.Column{ ckdb.NewColumn("mac_0", ckdb.UInt64), ckdb.NewColumn("mac_1", ckdb.UInt64), ckdb.NewColumn("eth_type", ckdb.UInt16).SetIndex(ckdb.IndexSet), ckdb.NewColumn("vlan", ckdb.UInt16).SetIndex(ckdb.IndexSet), }
View Source
var FlowInfoColumns = []*ckdb.Column{ ckdb.NewColumn("time", ckdb.DateTime).SetComment("精度: 秒,等同end_time的秒精度"), ckdb.NewColumn("close_type", ckdb.UInt16).SetIndex(ckdb.IndexSet), ckdb.NewColumn("signal_source", ckdb.UInt16), ckdb.NewColumn("flow_id", ckdb.UInt64).SetIndex(ckdb.IndexMinmax), ckdb.NewColumn("tap_type", ckdb.UInt16), ckdb.NewColumn("nat_source", ckdb.UInt8), ckdb.NewColumn("tap_port_type", ckdb.UInt8), ckdb.NewColumn("tap_port", ckdb.UInt32), ckdb.NewColumn("tap_side", ckdb.LowCardinalityString), ckdb.NewColumn("vtap_id", ckdb.UInt16).SetIndex(ckdb.IndexSet), ckdb.NewColumn("l2_end_0", ckdb.UInt8).SetIndex(ckdb.IndexNone), ckdb.NewColumn("l2_end_1", ckdb.UInt8).SetIndex(ckdb.IndexNone), ckdb.NewColumn("l3_end_0", ckdb.UInt8).SetIndex(ckdb.IndexNone), ckdb.NewColumn("l3_end_1", ckdb.UInt8).SetIndex(ckdb.IndexNone), ckdb.NewColumn("start_time", ckdb.DateTime64us).SetComment("精度: 微秒"), ckdb.NewColumn("end_time", ckdb.DateTime64us).SetComment("精度: 微秒"), ckdb.NewColumn("duration", ckdb.UInt64).SetComment("单位: 微秒"), ckdb.NewColumn("is_new_flow", ckdb.UInt8), ckdb.NewColumn("status", ckdb.UInt8).SetComment("状态 0:正常, 1:异常 ,2:不存在,3:服务端异常, 4:客户端异常"), ckdb.NewColumn("acl_gids", ckdb.ArrayUInt16), ckdb.NewColumn("gprocess_id_0", ckdb.UInt32), ckdb.NewColumn("gprocess_id_1", ckdb.UInt32), ckdb.NewColumn("nat_real_ip4_0", ckdb.IPv4), ckdb.NewColumn("nat_real_ip4_1", ckdb.IPv4), ckdb.NewColumn("nat_real_port_0", ckdb.UInt16), ckdb.NewColumn("nat_real_port_1", ckdb.UInt16), ckdb.NewColumn("direction_score", ckdb.UInt8).SetIndex(ckdb.IndexMinmax), }
View Source
var InternetColumns = []*ckdb.Column{ ckdb.NewColumn("province_0", ckdb.LowCardinalityString), ckdb.NewColumn("province_1", ckdb.LowCardinalityString), }
View Source
var KnowledgeGraphColumns = []*ckdb.Column{ ckdb.NewColumn("region_id_0", ckdb.UInt16), ckdb.NewColumn("region_id_1", ckdb.UInt16), ckdb.NewColumn("az_id_0", ckdb.UInt16), ckdb.NewColumn("az_id_1", ckdb.UInt16), ckdb.NewColumn("host_id_0", ckdb.UInt16), ckdb.NewColumn("host_id_1", ckdb.UInt16), ckdb.NewColumn("l3_device_type_0", ckdb.UInt8), ckdb.NewColumn("l3_device_type_1", ckdb.UInt8), ckdb.NewColumn("l3_device_id_0", ckdb.UInt32), ckdb.NewColumn("l3_device_id_1", ckdb.UInt32), ckdb.NewColumn("pod_node_id_0", ckdb.UInt32), ckdb.NewColumn("pod_node_id_1", ckdb.UInt32), ckdb.NewColumn("pod_ns_id_0", ckdb.UInt16), ckdb.NewColumn("pod_ns_id_1", ckdb.UInt16), ckdb.NewColumn("pod_group_id_0", ckdb.UInt32), ckdb.NewColumn("pod_group_id_1", ckdb.UInt32), ckdb.NewColumn("pod_id_0", ckdb.UInt32), ckdb.NewColumn("pod_id_1", ckdb.UInt32), ckdb.NewColumn("pod_cluster_id_0", ckdb.UInt16), ckdb.NewColumn("pod_cluster_id_1", ckdb.UInt16), ckdb.NewColumn("l3_epc_id_0", ckdb.Int32), ckdb.NewColumn("l3_epc_id_1", ckdb.Int32), ckdb.NewColumn("epc_id_0", ckdb.Int32), ckdb.NewColumn("epc_id_1", ckdb.Int32), ckdb.NewColumn("subnet_id_0", ckdb.UInt16), ckdb.NewColumn("subnet_id_1", ckdb.UInt16), ckdb.NewColumn("service_id_0", ckdb.UInt32), ckdb.NewColumn("service_id_1", ckdb.UInt32), ckdb.NewColumn("auto_instance_id_0", ckdb.UInt32), ckdb.NewColumn("auto_instance_type_0", ckdb.UInt8), ckdb.NewColumn("auto_service_id_0", ckdb.UInt32), ckdb.NewColumn("auto_service_type_0", ckdb.UInt8), ckdb.NewColumn("auto_instance_id_1", ckdb.UInt32), ckdb.NewColumn("auto_instance_type_1", ckdb.UInt8), ckdb.NewColumn("auto_service_id_1", ckdb.UInt32), ckdb.NewColumn("auto_service_type_1", ckdb.UInt8), ckdb.NewColumn("tag_source_0", ckdb.UInt8), ckdb.NewColumn("tag_source_1", ckdb.UInt8), }
View Source
var L4FlowCounter uint32
View Source
var L7FlowLogCounter uint32
View Source
var MetricsColumns = []*ckdb.Column{ ckdb.NewColumn("packet_tx", ckdb.UInt64), ckdb.NewColumn("packet_rx", ckdb.UInt64), ckdb.NewColumn("byte_tx", ckdb.UInt64), ckdb.NewColumn("byte_rx", ckdb.UInt64), ckdb.NewColumn("l3_byte_tx", ckdb.UInt64), ckdb.NewColumn("l3_byte_rx", ckdb.UInt64), ckdb.NewColumn("l4_byte_tx", ckdb.UInt64), ckdb.NewColumn("l4_byte_rx", ckdb.UInt64), ckdb.NewColumn("total_packet_tx", ckdb.UInt64), ckdb.NewColumn("total_packet_rx", ckdb.UInt64), ckdb.NewColumn("total_byte_tx", ckdb.UInt64), ckdb.NewColumn("total_byte_rx", ckdb.UInt64), ckdb.NewColumn("l7_request", ckdb.UInt32), ckdb.NewColumn("l7_response", ckdb.UInt32), ckdb.NewColumn("l7_parse_failed", ckdb.UInt32), ckdb.NewColumn("rtt", ckdb.Float64).SetComment("单位: 微秒"), ckdb.NewColumn("rtt_client", ckdb.Float64).SetComment("单位: 微秒"), ckdb.NewColumn("rtt_server", ckdb.Float64).SetComment("单位: 微秒"), ckdb.NewColumn("tls_rtt", ckdb.Float64).SetComment("单位: 微秒"), ckdb.NewColumn("srt_sum", ckdb.Float64), ckdb.NewColumn("art_sum", ckdb.Float64), ckdb.NewColumn("rrt_sum", ckdb.Float64), ckdb.NewColumn("cit_sum", ckdb.Float64), ckdb.NewColumn("srt_count", ckdb.UInt64), ckdb.NewColumn("art_count", ckdb.UInt64), ckdb.NewColumn("rrt_count", ckdb.UInt64), ckdb.NewColumn("cit_count", ckdb.UInt64), ckdb.NewColumn("srt_max", ckdb.UInt32).SetComment("单位: 微秒"), ckdb.NewColumn("art_max", ckdb.UInt32).SetComment("单位: 微秒"), ckdb.NewColumn("rrt_max", ckdb.UInt32).SetComment("单位: 微秒"), ckdb.NewColumn("cit_max", ckdb.UInt32).SetComment("单位: 微秒"), ckdb.NewColumn("retrans_tx", ckdb.UInt32), ckdb.NewColumn("retrans_rx", ckdb.UInt32), ckdb.NewColumn("zero_win_tx", ckdb.UInt32), ckdb.NewColumn("zero_win_rx", ckdb.UInt32), ckdb.NewColumn("syn_count", ckdb.UInt32), ckdb.NewColumn("synack_count", ckdb.UInt32), ckdb.NewColumn("retrans_syn", ckdb.UInt32), ckdb.NewColumn("retrans_synack", ckdb.UInt32), ckdb.NewColumn("l7_client_error", ckdb.UInt32), ckdb.NewColumn("l7_server_error", ckdb.UInt32), ckdb.NewColumn("l7_server_timeout", ckdb.UInt32), ckdb.NewColumn("l7_error", ckdb.UInt32), }
View Source
var NetworkLayerColumns = []*ckdb.Column{ ckdb.NewColumn("ip4_0", ckdb.IPv4), ckdb.NewColumn("ip4_1", ckdb.IPv4), ckdb.NewColumn("ip6_0", ckdb.IPv6), ckdb.NewColumn("ip6_1", ckdb.IPv6), ckdb.NewColumn("is_ipv4", ckdb.UInt8).SetIndex(ckdb.IndexMinmax), ckdb.NewColumn("protocol", ckdb.UInt8), ckdb.NewColumn("tunnel_tier", ckdb.UInt8), ckdb.NewColumn("tunnel_type", ckdb.UInt16), ckdb.NewColumn("tunnel_tx_id", ckdb.UInt32), ckdb.NewColumn("tunnel_rx_id", ckdb.UInt32), ckdb.NewColumn("tunnel_tx_ip4_0", ckdb.IPv4), ckdb.NewColumn("tunnel_tx_ip4_1", ckdb.IPv4), ckdb.NewColumn("tunnel_rx_ip4_0", ckdb.IPv4), ckdb.NewColumn("tunnel_rx_ip4_1", ckdb.IPv4), ckdb.NewColumn("tunnel_tx_ip6_0", ckdb.IPv6), ckdb.NewColumn("tunnel_tx_ip6_1", ckdb.IPv6), ckdb.NewColumn("tunnel_rx_ip6_0", ckdb.IPv6), ckdb.NewColumn("tunnel_rx_ip6_1", ckdb.IPv6), ckdb.NewColumn("tunnel_is_ipv4", ckdb.UInt8).SetIndex(ckdb.IndexMinmax), ckdb.NewColumn("tunnel_tx_mac_0", ckdb.UInt32), ckdb.NewColumn("tunnel_tx_mac_1", ckdb.UInt32), ckdb.NewColumn("tunnel_rx_mac_0", ckdb.UInt32), ckdb.NewColumn("tunnel_rx_mac_1", ckdb.UInt32), }
View Source
var TransportLayerColumns = []*ckdb.Column{ ckdb.NewColumn("client_port", ckdb.UInt16), ckdb.NewColumn("server_port", ckdb.UInt16).SetIndex(ckdb.IndexSet), ckdb.NewColumn("tcp_flags_bit_0", ckdb.UInt16).SetIndex(ckdb.IndexNone), ckdb.NewColumn("tcp_flags_bit_1", ckdb.UInt16).SetIndex(ckdb.IndexNone), ckdb.NewColumn("syn_seq", ckdb.UInt32).SetComment("握手包的TCP SEQ序列号"), ckdb.NewColumn("syn_ack_seq", ckdb.UInt32).SetComment("握手回应包的TCP SEQ序列号"), ckdb.NewColumn("last_keepalive_seq", ckdb.UInt32), ckdb.NewColumn("last_keepalive_ack", ckdb.UInt32), }
Functions ¶
func GetDNSExceptionDesc ¶
func GetDubboExceptionDesc ¶
func GetHTTPExceptionDesc ¶
func GetKafkaExceptionDesc ¶
func GetMQTTV3ExceptionDesc ¶
func GetMQTTV5ExceptionDesc ¶
func IPIntToString ¶
func L4FlowLogColumns ¶
func L4PacketColumns ¶
func L7BaseColumns ¶
func L7FlowLogColumns ¶
func ReleaseL4FlowLog ¶
func ReleaseL4FlowLog(l *L4FlowLog)
func ReleaseL4Packet ¶
func ReleaseL4Packet(l *L4Packet)
func ReleaseL7FlowLog ¶
func ReleaseL7FlowLog(l *L7FlowLog)
Types ¶
type ApplicationLayer ¶
type ApplicationLayer struct {
L7Protocol uint8 `json:"l7_protocol,omitempty"` // HTTP, DNS, others
}
func (*ApplicationLayer) Fill ¶
func (a *ApplicationLayer) Fill(f *pb.Flow)
func (*ApplicationLayer) WriteBlock ¶
func (a *ApplicationLayer) WriteBlock(block *ckdb.Block)
type DataLinkLayer ¶
type DataLinkLayer struct { MAC0 uint64 `json:"mac_0"` MAC1 uint64 `json:"mac_1"` EthType uint16 `json:"eth_type"` VLAN uint16 `json:"vlan,omitempty"` }
func (*DataLinkLayer) Fill ¶
func (d *DataLinkLayer) Fill(f *pb.Flow)
func (*DataLinkLayer) WriteBlock ¶
func (f *DataLinkLayer) WriteBlock(block *ckdb.Block)
type FlowInfo ¶
type FlowInfo struct { CloseType uint16 `json:"close_type"` SignalSource uint16 `json:"signal_source"` FlowID uint64 `json:"flow_id"` TapType uint16 `json:"tap_type"` NatSource uint8 `json:"nat_source"` TapPortType uint8 `json:"tap_port_type"` // 0: MAC, 1: IPv4, 2:IPv6, 3: ID TapPort uint32 `json:"tap_port"` TapSide string `json:"tap_side"` VtapID uint16 `json:"vtap_id"` L2End0 bool `json:"l2_end_0"` L2End1 bool `json:"l2_end_1"` L3End0 bool `json:"l3_end_0"` L3End1 bool `json:"l3_end_1"` StartTime int64 `json:"start_time"` // us EndTime int64 `json:"end_time"` // us Duration uint64 `json:"duration"` // us IsNewFlow uint8 `json:"is_new_flow"` Status uint8 `json:"status"` AclGids []uint16 GPID0 uint32 GPID1 uint32 NatRealIP0 uint32 NatRealIP1 uint32 NatRealPort0 uint16 NatRealPort1 uint16 DirectionScore uint8 }
func (*FlowInfo) WriteBlock ¶
type Internet ¶
func (*Internet) WriteBlock ¶
type KafakaCode ¶
type KafakaCode int16
type KnowledgeGraph ¶
type KnowledgeGraph struct { RegionID0 uint16 `json:"region_id_0"` RegionID1 uint16 `json:"region_id_1"` AZID0 uint16 `json:"az_id_0"` AZID1 uint16 `json:"az_id_1"` HostID0 uint16 `json:"host_id_0"` HostID1 uint16 `json:"host_id_1"` L3DeviceType0 uint8 `json:"l3_device_type_0"` L3DeviceType1 uint8 `json:"l3_device_type_1"` L3DeviceID0 uint32 `json:"l3_device_id_0"` L3DeviceID1 uint32 `json:"l3_device_id_1"` PodNodeID0 uint32 `json:"pod_node_id_0"` PodNodeID1 uint32 `json:"pod_node_id_1"` PodNSID0 uint16 `json:"pod_ns_id_0"` PodNSID1 uint16 `json:"pod_ns_id_1"` PodGroupID0 uint32 `json:"pod_group_id_0"` PodGroupID1 uint32 `json:"pod_group_id_1"` PodGroupType0 uint8 `json:"pod_group_type_0"` // no need to store PodGroupType1 uint8 `json:"pod_group_type_1"` // no need to store PodID0 uint32 `json:"pod_id_0"` PodID1 uint32 `json:"pod_id_1"` PodClusterID0 uint16 `json:"pod_cluster_id_0"` PodClusterID1 uint16 `json:"pod_cluster_id_1"` L3EpcID0 int32 `json:"l3_epc_id_0"` L3EpcID1 int32 `json:"l3_epc_id_1"` EpcID0 int32 `json:"epc_id_0"` EpcID1 int32 `json:"epc_id_1"` SubnetID0 uint16 `json:"subnet_id_0"` SubnetID1 uint16 `json:"subnet_id_1"` ServiceID0 uint32 `json:"service_id_0"` ServiceID1 uint32 `json:"service_id_1"` AutoInstanceID0 uint32 AutoInstanceType0 uint8 AutoServiceID0 uint32 AutoServiceType0 uint8 AutoInstanceID1 uint32 AutoInstanceType1 uint8 AutoServiceID1 uint32 AutoServiceType1 uint8 TagSource0 uint8 TagSource1 uint8 }
func (*KnowledgeGraph) FillL4 ¶
func (k *KnowledgeGraph) FillL4(f *pb.Flow, isIPv6 bool, platformData *grpc.PlatformInfoTable)
func (*KnowledgeGraph) FillL7 ¶
func (k *KnowledgeGraph) FillL7(l *pb.AppProtoLogsBaseInfo, platformData *grpc.PlatformInfoTable, protocol layers.IPProtocol)
func (*KnowledgeGraph) FillOTel ¶
func (k *KnowledgeGraph) FillOTel(l *L7FlowLog, platformData *grpc.PlatformInfoTable)
func (*KnowledgeGraph) WriteBlock ¶
func (k *KnowledgeGraph) WriteBlock(block *ckdb.Block)
type L4FlowLog ¶
type L4FlowLog struct { pool.ReferenceCount DataLinkLayer NetworkLayer TransportLayer ApplicationLayer Internet KnowledgeGraph FlowInfo Metrics // contains filtered or unexported fields }
func AcquireL4FlowLog ¶
func AcquireL4FlowLog() *L4FlowLog
func TaggedFlowToL4FlowLog ¶
func TaggedFlowToL4FlowLog(f *pb.TaggedFlow, platformData *grpc.PlatformInfoTable) *L4FlowLog
func (*L4FlowLog) HitPcapPolicy ¶
func (*L4FlowLog) WriteBlock ¶
type L4Packet ¶
type L4Packet struct { StartTime int64 EndTime int64 FlowID uint64 VtapID uint16 PacketCount uint32 PacketBatch []byte }
func AcquireL4Packet ¶
func AcquireL4Packet() *L4Packet
func DecodePacketSequence ¶
func DecodePacketSequence(decoder *codec.SimpleDecoder, vtapID uint16) (*L4Packet, error)
func (*L4Packet) WriteBlock ¶
type L7Base ¶
type L7Base struct { // 知识图谱 KnowledgeGraph // 网络层 IP40 uint32 `json:"ip4_0"` IP41 uint32 `json:"ip4_1"` IP60 net.IP `json:"ip6_0"` IP61 net.IP `json:"ip6_1"` IsIPv4 bool `json:"is_ipv4"` Protocol uint8 // 传输层 ClientPort uint16 `json:"client_port"` ServerPort uint16 `json:"server_port"` // 流信息 FlowID uint64 `json:"flow_id"` TapType uint8 `json:"tap_type"` NatSource uint8 `json:"nat_source"` TapPortType uint8 `json:"tap_port_type"` SignalSource uint16 `json:"signal_source"` TunnelType uint8 `json:"tunnel_type"` TapPort uint32 `json:"tap_port"` TapSide string `json:"tap_side"` VtapID uint16 `json:"vtap_id"` ReqTcpSeq uint32 `json:"req_tcp_seq"` RespTcpSeq uint32 `json:"resp_tcp_seq"` StartTime int64 `json:"start_time"` // us EndTime int64 `json:"end_time"` // us GPID0 uint32 GPID1 uint32 ProcessID0 uint32 ProcessID1 uint32 ProcessKName0 string ProcessKName1 string SyscallTraceIDRequest uint64 SyscallTraceIDResponse uint64 SyscallThread0 uint32 SyscallThread1 uint32 SyscallCoroutine0 uint64 SyscallCoroutine1 uint64 SyscallCapSeq0 uint32 SyscallCapSeq1 uint32 }
func (*L7Base) Fill ¶
func (b *L7Base) Fill(log *pb.AppProtoLogsData, platformData *grpc.PlatformInfoTable)
func (*L7Base) WriteBlock ¶
type L7FlowLog ¶
type L7FlowLog struct { pool.ReferenceCount L7Base L7Protocol uint8 L7ProtocolStr string Version string Type uint8 IsTLS uint8 RequestType string RequestDomain string RequestResource string Endpoint string // 数据库nullabled类型的字段, 需使用指针传值写入。如果值无意义,应传递nil. RequestId *uint64 ResponseStatus uint8 ResponseCode *int32 ResponseException string ResponseResult string HttpProxyClient string XRequestId0 string XRequestId1 string TraceId string TraceIdIndex uint64 SpanId string ParentSpanId string SpanKind uint8 AppService string AppInstance string ResponseDuration uint64 RequestLength *int64 ResponseLength *int64 SqlAffectedRows *uint64 DirectionScore uint8 AttributeNames []string AttributeValues []string MetricsNames []string MetricsValues []float64 // contains filtered or unexported fields }
func AcquireL7FlowLog ¶
func AcquireL7FlowLog() *L7FlowLog
func OTelTracesDataToL7FlowLogs ¶
func OTelTracesDataToL7FlowLogs(vtapID uint16, l *v1.TracesData, platformData *grpc.PlatformInfoTable, cfg *flowlogCfg.Config) []*L7FlowLog
func ProtoLogToL7FlowLog ¶
func ProtoLogToL7FlowLog(l *pb.AppProtoLogsData, platformData *grpc.PlatformInfoTable, cfg *flowlogCfg.Config) *L7FlowLog
func (*L7FlowLog) Fill ¶
func (h *L7FlowLog) Fill(l *pb.AppProtoLogsData, platformData *grpc.PlatformInfoTable, cfg *flowlogCfg.Config)
func (*L7FlowLog) FillOTel ¶
func (h *L7FlowLog) FillOTel(l *v1.Span, resAttributes []*v11.KeyValue, platformData *grpc.PlatformInfoTable, cfg *flowlogCfg.Config)
func (*L7FlowLog) GenerateNewFlowTags ¶
func (h *L7FlowLog) GenerateNewFlowTags(cache *flow_tag.FlowTagCache)
func (*L7FlowLog) WriteBlock ¶
type Metrics ¶
type Metrics struct { PacketTx uint64 `json:"packet_tx,omitempty"` PacketRx uint64 `json:"packet_rx,omitempty"` ByteTx uint64 `json:"byte_tx,omitempty"` ByteRx uint64 `json:"byte_rx,omitempty"` L3ByteTx uint64 `json:"l3_byte_tx,omitempty"` L3ByteRx uint64 `json:"l3_byte_rx,omitempty"` L4ByteTx uint64 `json:"l4_byte_tx,omitempty"` L4ByteRx uint64 `json:"l4_byte_rx,omitempty"` TotalPacketTx uint64 `json:"total_packet_tx,omitempty"` TotalPacketRx uint64 `json:"total_packet_rx,omitempty"` TotalByteTx uint64 `json:"total_byte_tx,omitempty"` TotalByteRx uint64 `json:"total_byte_rx,omitempty"` L7Request uint32 `json:"l7_request,omitempty"` L7Response uint32 `json:"l7_response,omitempty"` L7ParseFailed uint32 `json:"l7_parse_failed,omitempty"` RTT uint32 `json:"rtt,omitempty"` // us RTTClient uint32 `json:"rtt_client,omitempty"` // us RTTServer uint32 `json:"rtt_server,omitempty"` // us TLSRTT uint32 `json:"tls_rtt_sum,omitempty"` // us SRTSum uint32 `json:"srt_sum,omitempty"` ARTSum uint32 `json:"art_sum,omitempty"` RRTSum uint64 `json:"rrt_sum,omitempty"` CITSum uint32 `json:"cit_sum,omitempty"` SRTCount uint32 `json:"srt_count,omitempty"` ARTCount uint32 `json:"art_count,omitempty"` RRTCount uint32 `json:"rrt_count,omitempty"` CITCount uint32 `json:"cit_count,omitempty"` SRTMax uint32 `json:"srt_max,omitempty"` // us ARTMax uint32 `json:"art_max,omitempty"` // us RRTMax uint32 `json:"rrt_max,omitempty"` // us CITMax uint32 `json:"cit_max,omitempty"` // us RetransTx uint32 `json:"retrans_tx,omitempty"` RetransRx uint32 `json:"retrans_rx,omitempty"` ZeroWinTx uint32 `json:"zero_win_tx,omitempty"` ZeroWinRx uint32 `json:"zero_win_rx,omitempty"` SynCount uint32 `json:"syn_count,omitempty"` SynackCount uint32 `json:"synack_count,omitempty"` RetransSyn uint32 `json:"retrans_syn,omitempty"` RetransSynack uint32 `json:"retrans_synack,omitempty"` L7ClientError uint32 `json:"l7_client_error,omitempty"` L7ServerError uint32 `json:"l7_server_error,omitempty"` L7ServerTimeout uint32 `json:"l7_server_timeout,omitempty"` L7Error uint32 `json:"l7_error,omitempty"` }
func (*Metrics) WriteBlock ¶
type NetworkLayer ¶
type NetworkLayer struct { IP40 uint32 `json:"ip4_0"` IP41 uint32 `json:"ip4_1"` IP60 net.IP `json:"ip6_0"` IP61 net.IP `json:"ip6_1"` IsIPv4 bool `json:"is_ipv4"` Protocol uint8 `json:"protocol"` TunnelTier uint8 `json:"tunnel_tier,omitempty"` TunnelType uint16 `json:"tunnel_type,omitempty"` TunnelTxID uint32 `json:"tunnel_tx_id,omitempty"` TunnelRxID uint32 `json:"tunnel_rx_id,omitempty"` TunnelTxIP40 uint32 `json:"tunnel_tx_ip4_0,omitempty"` TunnelTxIP41 uint32 `json:"tunnel_tx_ip4_1,omitempty"` TunnelRxIP40 uint32 `json:"tunnel_rx_ip4_0,omitempty"` TunnelRxIP41 uint32 `json:"tunnel_rx_ip4_1,omitempty"` TunnelTxIP60 net.IP `json:"tunnel_tx_ip6_0,omitempty"` TunnelTxIP61 net.IP `json:"tunnel_tx_ip6_1,omitempty"` TunnelRxIP60 net.IP `json:"tunnel_rx_ip6_0,omitempty"` TunnelRxIP61 net.IP `json:"tunnel_rx_ip6_1,omitempty"` TunnelIsIPv4 bool `json:"tunnel_is_ipv4"` TunnelTxMac0 uint32 `json:"tunnel_tx_mac_0,omitempty"` TunnelTxMac1 uint32 `json:"tunnel_tx_mac_1,omitempty"` TunnelRxMac0 uint32 `json:"tunnel_rx_mac_0,omitempty"` TunnelRxMac1 uint32 `json:"tunnel_rx_mac_1,omitempty"` }
func (*NetworkLayer) WriteBlock ¶
func (n *NetworkLayer) WriteBlock(block *ckdb.Block)
type TransportLayer ¶
type TransportLayer struct { ClientPort uint16 `json:"client_port"` ServerPort uint16 `json:"server_port"` TCPFlagsBit0 uint16 `json:"tcp_flags_bit_0,omitempty"` TCPFlagsBit1 uint16 `json:"tcp_flags_bit_1,omitempty"` SynSeq uint32 `json:"syn_seq"` SynAckSeq uint32 `json:"syn_ack_seq"` LastKeepaliveSeq uint32 `json:"last_keepalive_seq"` LastKeepaliveAck uint32 `json:"last_keepalive_ack"` }
func (*TransportLayer) Fill ¶
func (t *TransportLayer) Fill(f *pb.Flow)
func (*TransportLayer) WriteBlock ¶
func (t *TransportLayer) WriteBlock(block *ckdb.Block)
Click to show internal directories.
Click to hide internal directories.