Skip to content

Fix custom log groupings being discarded when parallel adapter loading was enabled#1187

Open
garymccann wants to merge 1 commit intonautobot:developfrom
garymccann:bugfix/1183-fixing_custom_log_groupings
Open

Fix custom log groupings being discarded when parallel adapter loading was enabled#1187
garymccann wants to merge 1 commit intonautobot:developfrom
garymccann:bugfix/1183-fixing_custom_log_groupings

Conversation

@garymccann
Copy link
Copy Markdown
Contributor

Closes: #1183

A bug of sorts which masks detailed log messages through discarding their groupings.

What's Changed

When parallel adapter loading is enabled, the create_job_log_entry() function in _load_adapters_parallel() hardcoded grouping=adapter_type, which collapsed all custom log groupings (e.g., "Loading ServiceNow Data", "Data Quality Issues") to generic "source" or "target" labels.

The fix reads the custom grouping from the captured LogRecord's dict, falling back to adapter_type when no custom grouping was set:

Before

grouping=adapter_type

After

grouping = record.dict.get("grouping", adapter_type)

This affects all SSoT integrations that set extra={"grouping": ...} in their adapter log calls.

To Do

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

@garymccann garymccann requested a review from a team as a code owner April 13, 2026 14:44
log_level=log_level,
message=message,
grouping=adapter_type, # Group by source or target adapter
grouping=grouping,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wonder if it'd be desirable to combine the adapter type and specified grouping string, e.g. "Loading Data (source)" vs "Loading Data (target)"?

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.

interesting - yeah that would be trivial, combine the groupings. @jdrew82 wdyt?

@github-actions
Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  nautobot_ssot/jobs
  base.py
Project Total  

This report was generated by python-coverage-comment-action

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.

Parallel Loading Discards Custom Log Groupings

2 participants