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

bug-fix: better configuration of plugin loggers + trace all algod requests #91

Merged
merged 3 commits into from
Jun 5, 2023

Conversation

tzaffi
Copy link
Contributor

@tzaffi tzaffi commented Jun 4, 2023

Summary

In preparing the bugfix in algorand/go-algorand#5449, I discovered that conduit's logger wasn't printing out at the log-level that I was expecting (TRACE). I made some minor fixes to address this problem and also added the traces that I found helpful. Finally, a couple of logs were missing the received error from algod, so I added these.

Test Plan

CI + local testing

@codecov
Copy link

codecov bot commented Jun 4, 2023

Codecov Report

Merging #91 (56ad193) into master (442791a) will increase coverage by 1.65%.
The diff coverage is 75.64%.

@@            Coverage Diff             @@
##           master      #91      +/-   ##
==========================================
+ Coverage   67.66%   69.31%   +1.65%     
==========================================
  Files          32       36       +4     
  Lines        1976     2428     +452     
==========================================
+ Hits         1337     1683     +346     
- Misses        570      653      +83     
- Partials       69       92      +23     
Impacted Files Coverage Δ
conduit/data/block_export_data.go 100.00% <ø> (+92.30%) ⬆️
conduit/plugins/importers/algod/metrics.go 100.00% <ø> (ø)
...plugins/processors/filterprocessor/gen/generate.go 34.28% <ø> (ø)
pkg/cli/internal/list/list.go 20.75% <ø> (ø)
...lugins/exporters/postgresql/postgresql_exporter.go 66.66% <51.21%> (-11.54%) ⬇️
pkg/cli/cli.go 65.97% <65.97%> (ø)
conduit/pipeline/pipeline.go 66.26% <72.66%> (+0.80%) ⬆️
conduit/data/config.go 76.47% <76.47%> (ø)
conduit/plugins/importers/algod/algod_importer.go 88.34% <90.69%> (+0.03%) ⬆️
conduit/pipeline/errors.go 100.00% <100.00%> (ø)
... and 4 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tzaffi tzaffi changed the title Add-errors-to-some-logs bug-fix: better configuration of plugin loggers + trace all algod requests Jun 4, 2023
conduit/pipeline/pipeline.go Outdated Show resolved Hide resolved
conduit/pipeline/pipeline.go Outdated Show resolved Hide resolved
lgr := log.New()
lgr.SetOutput(p.logger.Out)
lgr.SetLevel(p.logger.Level)
lgr.SetFormatter(makePluginLogFormatter(string(pluginType), cfg.Name))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, all plugin loggers were assigned "processor" as their source.

l.SetFormatter(makePluginLogFormatter(plugins.Processor, cfg.Name))
lgr := log.New()
lgr.SetOutput(p.logger.Out)
lgr.SetLevel(p.logger.Level)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inheriting the log level from the pipeline

@tzaffi tzaffi marked this pull request as ready for review June 4, 2023 02:45
@tzaffi tzaffi requested review from winder and a team June 5, 2023 14:48
@tzaffi tzaffi merged commit 6c45173 into algorand:master Jun 5, 2023
@tzaffi tzaffi deleted the add-errors-to-some-logs branch June 5, 2023 14:51
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.

3 participants