Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance/improve log format #299

Merged
merged 6 commits into from
Aug 2, 2022

Conversation

NeJan2020
Copy link
Collaborator

@NeJan2020 NeJan2020 commented Jul 28, 2022

Description

  • overwrite MarshalJSON() and UnmarshalJSON() for attributeMap for those private Members
  • move those outputs in JSON from zap.filed to message

Related Issue

#298

After Change

KindlingEvent

2022-07-28T18:35:45.733Z        DEBUG   cgoreceiver/cgoreceiver.go:156  Receive Event: &{Source:SOURCE_UNKNOWN Timestamp:1659033341930367401 Name:connect Category:3 ParamsNumber:3 UserAttributes:[latency:UINT(306428) res:INT(0) tuple:BYTEBUF(^A^Y^^@^Y^/var/run/docker.sock^@)] Ctx:{ThreadInfo:{Pid:11474 Tid:11608 Uid:0 Gid:0 Comm:kubelet ContainerId: ContainerName:} FdInfo:{Num:10 TypeFd:8 Filename: Directory: Protocol:0 Role:false Sip:0.0.0.0 Dip:0.0.0.0 Sport:0 Dport:0 Source:18446622435791445440 Destination:18446622435791437824}}}

DataGroup

2022-07-28T18:35:45.741Z        DEBUG   network/network_analyzer.go:322 NetworkAnalyzer To NextProcess:
DataGroup:
        Name: net_request_metric_group
        Values:
                "connect_time": 0
                "request_sent_time": 21010
                "waiting_ttfb_time": 1197746594
                "content_download_time": 656720
                "request_total_time": 1198424324
                "request_io": 35
                "response_io": 10564
        Labels:
        {
                "comm": "kindling-collec",
                "container_id": "c4ffdfa6ebfa",
                "dnat_ip": "10.10.101.124",
                "dnat_port": 6443,
                "dst_ip": "10.96.0.1",
                "dst_port": 443,
                "error_type": 0,
                "is_error": false,
                "is_server": false,
                "is_slow": true,
                "pid": 32433,
                "protocol": "NOSUPPORT",
                "src_ip": "10.10.103.159",
                "src_port": 58178
        }
        Timestamp: 1659033342510904252

…ttributeMap

Signed-off-by: niejiangang <niejiangang@harmonycloud.cn>
Signed-off-by: niejiangang <niejiangang@harmonycloud.cn>
Signed-off-by: niejiangang <niejiangang@harmonycloud.cn>
@NeJan2020 NeJan2020 changed the title WIP: enhance/improve log format enhance/improve log format Jul 29, 2022
@NeJan2020 NeJan2020 requested a review from dxsup July 29, 2022 03:53
@NeJan2020 NeJan2020 force-pushed the fix/improve-log-format branch 2 times, most recently from 56aca24 to 093f874 Compare July 29, 2022 06:41
@NeJan2020 NeJan2020 linked an issue Jul 29, 2022 that may be closed by this pull request
@NeJan2020 NeJan2020 force-pushed the fix/improve-log-format branch from 093f874 to 9c265dd Compare August 1, 2022 01:25
Signed-off-by: niejiangang <niejiangang@harmonycloud.cn>
Signed-off-by: niejiangang <niejiangang@harmonycloud.cn>
Signed-off-by: niejiangang <niejiangang@harmonycloud.cn>
@NeJan2020 NeJan2020 requested a review from dxsup August 1, 2022 05:39
@dxsup dxsup merged commit 6036845 into KindlingProject:main Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to improve log format
2 participants