Skip to content

Support per extension log level - #2791

Open
SylvainSenechal wants to merge 1 commit into
improvement/BB-686from
improvement/BB-807
Open

Support per extension log level#2791
SylvainSenechal wants to merge 1 commit into
improvement/BB-686from
improvement/BB-807

Conversation

@SylvainSenechal

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.42%. Comparing base (7e9cc25) to head (152ea1b).

Files with missing lines Patch % Lines
bin/ingestion.js 0.00% 2 Missing ⚠️
extensions/mongoProcessor/mongoProcessorTask.js 0.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (42.85%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
extensions/ingestion/IngestionConfigValidator.js 100.00% <100.00%> (ø)
...ns/mongoProcessor/MongoProcessorConfigValidator.js 100.00% <100.00%> (ø)
lib/config/configItems.joi.js 96.29% <100.00%> (+0.14%) ⬆️
bin/ingestion.js 0.00% <0.00%> (ø)
extensions/mongoProcessor/mongoProcessorTask.js 0.00% <0.00%> (ø)

... and 4 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.22% <ø> (ø)
Core Library 81.22% <100.00%> (-0.58%) ⬇️
Ingestion 70.07% <50.00%> (-0.07%) ⬇️
Lifecycle 80.25% <ø> (ø)
Oplog Populator 85.83% <ø> (ø)
Replication 61.98% <ø> (-0.04%) ⬇️
Bucket Scanner 85.76% <ø> (ø)
@@                  Coverage Diff                   @@
##           improvement/BB-686    #2791      +/-   ##
======================================================
- Coverage               75.67%   75.42%   -0.26%     
======================================================
  Files                     201      201              
  Lines                   13929    13932       +3     
======================================================
- Hits                    10541    10508      -33     
- Misses                   3378     3414      +36     
  Partials                   10       10              
Flag Coverage Δ
api:retry 9.06% <42.85%> (+<0.01%) ⬆️
api:routes 8.84% <42.85%> (+<0.01%) ⬆️
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 9.13% <42.85%> (-1.56%) ⬇️
ingestion 12.26% <42.85%> (+<0.01%) ⬆️
lib 8.79% <42.85%> (-0.01%) ⬇️
lifecycle 19.25% <42.85%> (+<0.01%) ⬆️
notification 1.00% <0.00%> (-0.01%) ⬇️
oplogPopulator 0.13% <0.00%> (-0.01%) ⬇️
replication 18.82% <42.85%> (+<0.01%) ⬆️
unit 54.73% <42.85%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread bin/ingestion.js
const log = new werelogs.Logger('Backbeat:IngestionPopulator');
werelogs.configure({ level: config.log.logLevel,
dump: config.log.dumpLevel });
const ingestionLogConfig = ingestionExtConfigs.log ?? config.log;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Partial extension log config drops the global fallback for omitted fields. If a user sets log: { logLevel: 'debug' } without dumpLevel, the ?? sees a non-nullish object and uses it as-is, so dumpLevel becomes undefined instead of falling back to config.log.dumpLevel. Merge at field level instead:

Suggested change
const ingestionLogConfig = ingestionExtConfigs.log ?? config.log;
const ingestionLogConfig = {
logLevel: ingestionExtConfigs.log?.logLevel ?? config.log.logLevel,
dumpLevel: ingestionExtConfigs.log?.dumpLevel ?? config.log.dumpLevel,
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mhh fair enough but im gonna go with the option of making both fields required when specified (If you provide log level you must provide dump level and other way around).
This is how the operator works anyway

Comment thread extensions/mongoProcessor/mongoProcessorTask.js
@SylvainSenechal
SylvainSenechal marked this pull request as ready for review August 4, 2026 13:12
@SylvainSenechal
SylvainSenechal requested review from a team, DarkIsDude and delthas August 4, 2026 13:12
const logJoiOptional =
joi.object({
logLevel: joi.alternatives()
.try('error', 'warn', 'info', 'debug', 'trace').required(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should it be a const array to avoid duplication ?

});

// logJoi with no default :
// Callers fall back to the global log config when this one is not configured

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is pretty standard behaviour ? Why a comment ?

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