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

reduce unnecessary logs for mainnet #2808

Merged
merged 3 commits into from
Sep 28, 2021
Merged

Conversation

dayuanc
Copy link
Contributor

@dayuanc dayuanc commented Sep 22, 2021

#2794

Remove unnecessary logs which just used for printing values purpose for mainnet.

@dayuanc dayuanc requested a review from a team as a code owner September 22, 2021 09:28
@dayuanc dayuanc force-pushed the reduce_unnecessary_debug_logs branch from 6d96649 to 20162f4 Compare September 22, 2021 09:30
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #2808 (8ea94a4) into master (a245185) will decrease coverage by 0.05%.
The diff coverage is 50.00%.

❗ Current head 8ea94a4 differs from pull request most recent head cf7a584. Consider uploading reports for the commit cf7a584 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2808      +/-   ##
==========================================
- Coverage   57.87%   57.82%   -0.06%     
==========================================
  Files         245      245              
  Lines       22445    22414      -31     
==========================================
- Hits        12991    12960      -31     
+ Misses       7803     7801       -2     
- Partials     1651     1653       +2     
Impacted Files Coverage Δ
action/protocol/poll/consortium.go 0.00% <0.00%> (ø)
action/protocol/poll/governance_protocol.go 56.06% <0.00%> (ø)
server/itx/heartbeat.go 77.64% <100.00%> (ø)
action/protocol/execution/evm/kvstorefortrie.go 58.33% <0.00%> (-8.34%) ⬇️
db/trie/mptrie/branchnode.go 83.00% <0.00%> (-1.31%) ⬇️
api/api.go 63.08% <0.00%> (-1.23%) ⬇️
action/protocol/execution/evm/evmstatedbadapter.go 49.79% <0.00%> (-0.62%) ⬇️
blocksync/buffer.go 86.36% <0.00%> (-0.41%) ⬇️
action/protocol/execution/evm/evm.go 46.78% <0.00%> (-0.40%) ⬇️
action/protocol/staking/protocol.go 54.00% <0.00%> (-0.32%) ⬇️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a245185...cf7a584. Read the comment docs.

@raullenchai
Copy link
Member

I think these debug logs are fine - as they are not ingested by our ELK - we need to downgrade the unnecessary INFO/WARNING/ERROR logs

@dustinxie
Copy link
Member

i think the request is to review the current logs, and check if anyWARN/INFO can reduce to DEBUG

@dayuanc dayuanc force-pushed the reduce_unnecessary_debug_logs branch from 20162f4 to 0ffe383 Compare September 24, 2021 04:59
@dayuanc
Copy link
Contributor Author

dayuanc commented Sep 24, 2021

So from kibana 90% logs come from error level and most of produced by this line:

log.L().Debug("Failed to get committed state.", zap.Error(err))

and the left 8% logs from
h.l.Debug("Node status.",
and
h.l.Debug("chain service status",

I think we can delete the error log and downgrade the info log. @raullenchai @dustinxie

@dayuanc dayuanc changed the title reduce unnecessary debug logs reduce unnecessary logs Sep 24, 2021
@dayuanc dayuanc changed the title reduce unnecessary logs reduce unnecessary logs for mainnet Sep 24, 2021
@raullenchai
Copy link
Member

So from kibana 90% logs come from error level and most of produced by this line:

log.L().Debug("Failed to get committed state.", zap.Error(err))

and the left 8% logs from

h.l.Debug("Node status.",

and

h.l.Debug("chain service status",

I think we can delete the error log and downgrade the info log. @raullenchai @dustinxie

Debug logs are disabled by default unless our eng enabled it for debugging

@@ -384,7 +384,7 @@ func main() {
return
}

log.S().Info("Fp token transfer test pass!")
log.S().Debug("Fp token transfer test pass!")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert. minicluster is not running in product

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@@ -94,7 +94,7 @@ func main() {
sf := svr.ChainService(cfg.Chain.ID).StateFactory()
dao := svr.ChainService(cfg.Chain.ID).BlockDAO()
if err := bc.Start(context.Background()); err == nil {
log.L().Info("State DB status is normal.")
log.L().Debug("State DB status is normal.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for this tool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@@ -680,7 +680,6 @@ func (stateDB *StateDBAdapter) GetCommittedState(evmAddr common.Address, k commo
v, err := contract.GetCommittedState(hash.BytesToHash256(k[:]))
if err != nil {
log.L().Debug("Failed to get committed state.", zap.Error(err))
stateDB.logError(err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@CoderZhi CoderZhi merged commit 84f06d3 into master Sep 28, 2021
@CoderZhi CoderZhi deleted the reduce_unnecessary_debug_logs branch September 28, 2021 19:17
millken added a commit that referenced this pull request Oct 8, 2021
* saving, switch to linux

* tracing grpc api

* saving, switch to linux

* tracing grpc api

* update tracer.go for test

* small change

* fix comments

* Squashed commit of the following:

commit 77a5a15
Author: dustinxie <[email protected]>
Date:   Tue Oct 5 23:34:52 2021 -0700

    [api] add cache for ReadContract/State() (#2827)

commit 7d9bf96
Author: Haaai <[email protected]>
Date:   Tue Oct 5 17:31:37 2021 -0700

    bump Go to 1.17 (#2784)

commit 09ef379
Author: dustinxie <[email protected]>
Date:   Tue Oct 5 16:46:49 2021 -0700

    [ioctl] display chainID and encoding (#2820)

commit c2eab8d
Author: Haaai <[email protected]>
Date:   Tue Oct 5 15:45:45 2021 -0700

    fix ioctl accountDelete test (#2825)

commit 9489b57
Author: dustinxie <[email protected]>
Date:   Tue Oct 5 15:14:31 2021 -0700

    remove unnecessary WithFeatureCtx() (#2823)

commit 3933ae9
Author: dayuanc <[email protected]>
Date:   Tue Oct 5 07:40:32 2021 -0700

    limit the pagination size for all API calls to 5000 -- 2781 (#2800)

    Co-authored-by: dayuanc <[email protected]>
    Co-authored-by: CoderZhi <[email protected]>
    Co-authored-by: Raullen Chai <[email protected]>

commit 88d273d
Author: dayuanc <[email protected]>
Date:   Mon Oct 4 10:51:54 2021 -0700

    Add unit tests to cover the functions in action/signedaction.go (#2824)

commit ebe895c
Author: dustinxie <[email protected]>
Date:   Thu Sep 30 15:32:52 2021 -0700

    [reward] extend foundation bonus (#2785)

commit baa0a92
Author: CoderZhi <[email protected]>
Date:   Tue Sep 28 14:09:44 2021 -0700

    Fix codecov (#2813)

commit 84f06d3
Author: dayuanc <[email protected]>
Date:   Tue Sep 28 12:17:47 2021 -0700

    reduce unnecessary logs for mainnet (#2808)

    * downgrade some unnecessary error and info logs

    * fix comments

    Co-authored-by: Raullen Chai <[email protected]>

commit a245185
Author: dustinxie <[email protected]>
Date:   Mon Sep 27 15:27:59 2021 -0700

    [evm] panic in AccessList API (#2816)

commit 8eec1b7
Author: dustinxie <[email protected]>
Date:   Mon Sep 27 11:01:34 2021 -0700

    set Jutland to activate at 10-11-2021 3pm PDT (#2812)

    Co-authored-by: Raullen Chai <[email protected]>

commit e89be88
Author: CoderZhi <[email protected]>
Date:   Sat Sep 25 22:51:54 2021 -0700

    set target height (#2807)

    Co-authored-by: dustinxie <[email protected]>

commit dba4993
Author: CoderZhi <[email protected]>
Date:   Thu Sep 23 11:44:26 2021 -0700

    change commit block failure log level to error (#2810)

commit 0459a1f
Author: mas walker <[email protected]>
Date:   Wed Sep 22 20:18:23 2021 +0800

    unbound feature and version/height (#2768)

    * unbound feature and version/height

    Co-authored-by: Raullen Chai <[email protected]>

commit c1cea44
Author: millken <[email protected]>
Date:   Tue Sep 21 06:31:57 2021 +0800

    update circleci config, using golang 1.16.6 #2789 (#2791)

    Co-authored-by: dustinxie <[email protected]>

commit f245109
Author: Dustin Xie <[email protected]>
Date:   Mon Sep 20 09:54:38 2021 -0700

    [evm] enable opCall fix at Jutland height

commit 3eea5b7
Author: Dustin Xie <[email protected]>
Date:   Mon Sep 20 12:11:36 2021 -0700

    [evm] fix datacopy.json for TestIstanbul

commit 0641db0
Author: CoderZhi <[email protected]>
Date:   Fri Sep 17 14:37:28 2021 -0700

    [evm] fix snapshot bug (#2802)

    * fix snapshot bug

    * add unit test

    Co-authored-by: Raullen Chai <[email protected]>

commit e0683e8
Author: Haaai <[email protected]>
Date:   Sat Sep 18 01:34:12 2021 +0800

    add datacopy contract test (#2788)

    * add datacopy test

    * modify contract

    * remove debug log

    * update testdata

    * add attack bytecode

    * update datacopy.json

    * correct code format

    * remove printStore() in datacopy.sol

    * update contract test data

    Co-authored-by: dustinxie <[email protected]>

commit 44e0a68
Author: Haaai <[email protected]>
Date:   Fri Sep 17 15:31:29 2021 +0800

    Allow ioctl to show the list of actions for an account (#2750)

    * [ioctl] allow ioctl to show the list of actions for an account

commit d10dabe
Author: Haaai <[email protected]>
Date:   Fri Sep 17 12:08:33 2021 +0800

    [api] fix gas estimation calc bug (#2786)

    * fixed gas estimation bug in api.go

* Tracing (#2)

* [reward] extend foundation bonus (#2785)

* Add unit tests to cover the functions in action/signedaction.go (#2824)

* limit the pagination size for all API calls to 5000 -- 2781 (#2800)

Co-authored-by: dayuanc <[email protected]>
Co-authored-by: CoderZhi <[email protected]>
Co-authored-by: Raullen Chai <[email protected]>

* remove unnecessary WithFeatureCtx() (#2823)

* fix ioctl accountDelete test (#2825)

* [ioctl] display chainID and encoding (#2820)

* bump Go to 1.17 (#2784)

* [api] add cache for ReadContract/State() (#2827)

Co-authored-by: dustinxie <[email protected]>
Co-authored-by: dayuanc <[email protected]>
Co-authored-by: dayuanc <[email protected]>
Co-authored-by: CoderZhi <[email protected]>
Co-authored-by: Raullen Chai <[email protected]>
Co-authored-by: Haaai <[email protected]>

Co-authored-by: Raullen Chai <[email protected]>
Co-authored-by: dustinxie <[email protected]>
Co-authored-by: dayuanc <[email protected]>
Co-authored-by: dayuanc <[email protected]>
Co-authored-by: CoderZhi <[email protected]>
Co-authored-by: Haaai <[email protected]>
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.

4 participants