Skip to content

NH-143290 Update debug logging for Lambda#817

Merged
tammy-baylis-swi merged 11 commits into
mainfrom
NH-143290-lambda-logging
Jul 16, 2026
Merged

NH-143290 Update debug logging for Lambda#817
tammy-baylis-swi merged 11 commits into
mainfrom
NH-143290-lambda-logging

Conversation

@tammy-baylis-swi

@tammy-baylis-swi tammy-baylis-swi commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Updates APM Python debug logging to be less duplicative, and to be more clear/useful while in Lambda environment.

Changes:

  • Cache and reuse Lambda-environment detection in SolarWindsDistro (self._is_lambda), and suppress specific debug logs when running in Lambda mode.
  • Update SolarWindsApmConfig.__str__() to exclude service_key and collector in Lambda mode, while preserving masked service_key behavior outside Lambda; adds is_lambda to the output in both scenarios. This is logged at the end of ApmConfig init.
  • Reduce repeated debug noise by logging “no default config file” only once; add/expand unit tests around these behaviors.

Also:

  • Undo a change made by copilot in 3c8b6ec which was making Lambda test publish fail

See ticket for additional testing.

@tammy-baylis-swi
tammy-baylis-swi requested a review from Copilot July 16, 2026 00:10
Comment thread tests/unit/test_apm_config/test_apm_config_cnf_file.py Fixed
Comment thread tests/unit/test_apm_config/test_apm_config_cnf_file.py Fixed
Comment thread tests/unit/test_apm_config/test_apm_config_cnf_file.py Fixed
Comment thread tests/unit/test_apm_config/test_apm_config_cnf_file.py Fixed
Comment thread tests/unit/test_apm_config/test_apm_config_cnf_file.py Fixed

Copilot AI left a comment

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.

Pull request overview

This PR refines debug logging behavior for AWS Lambda deployments and adjusts configuration/log output to avoid emitting sensitive or irrelevant fields in Lambda contexts within the SolarWinds APM OpenTelemetry distribution.

Changes:

  • Cache and reuse Lambda-environment detection in SolarWindsDistro, and suppress specific debug logs when running in Lambda mode.
  • Update SolarWindsApmConfig.__str__() to exclude service_key and collector in Lambda mode, while preserving masked service_key behavior outside Lambda; add is_lambda to the output.
  • Reduce repeated debug noise by logging “no default config file” only once; add/expand unit tests around these behaviors.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
solarwinds_apm/distro.py Adds cached is_lambda evaluation and gates certain debug logs in Lambda mode.
solarwinds_apm/apm_config.py Adds Lambda-specific config rendering for __str__() and deduplicates missing-config-file debug logs.
solarwinds_apm/oboe/json_sampler.py Makes JSON sampler debug logs more actionable by referencing the otelcol extension.
tests/unit/test_distro.py Adds tests verifying missing service key logging differs between Lambda vs non-Lambda.
tests/unit/test_apm_config/test_apm_config.py Adds tests for Lambda/non-Lambda __str__() output and _config_lambda() behavior.
tests/unit/test_apm_config/test_apm_config_cnf_file.py Adds tests ensuring the “no config file” debug message is emitted only once.

Comment thread solarwinds_apm/distro.py
tammy-baylis-swi and others added 4 commits July 15, 2026 17:14
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@tammy-baylis-swi
tammy-baylis-swi marked this pull request as ready for review July 16, 2026 01:24
@tammy-baylis-swi
tammy-baylis-swi requested review from a team as code owners July 16, 2026 01:24
Comment thread solarwinds_apm/version.py
@@ -1 +1 @@
__version__ = "7.0.0"

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.

Fourth digit means not a stable version if I understand correctly ? Just making sure it's not a typo but I think I remember seeing it a bunch in your release PRs

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.

Yes that's correct 👍

I actually didn't mean to commit this but testrelease is next anyway so it'll work.

@jerrytfleung jerrytfleung left a comment

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.

LGTM

@tammy-baylis-swi
tammy-baylis-swi merged commit 07b7063 into main Jul 16, 2026
76 checks passed
@tammy-baylis-swi
tammy-baylis-swi deleted the NH-143290-lambda-logging branch July 16, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants