NH-143290 Update debug logging for Lambda#817
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 excludeservice_keyandcollectorin Lambda mode, while preserving maskedservice_keybehavior outside Lambda; addis_lambdato 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. |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
tammy-baylis-swi
marked this pull request as ready for review
July 16, 2026 01:24
raphael-theriault-swi
approved these changes
Jul 16, 2026
| @@ -1 +1 @@ | |||
| __version__ = "7.0.0" | |||
Contributor
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
Yes that's correct 👍
I actually didn't mean to commit this but testrelease is next anyway so it'll work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates APM Python debug logging to be less duplicative, and to be more clear/useful while in Lambda environment.
Changes:
SolarWindsDistro(self._is_lambda), and suppress specific debug logs when running in Lambda mode.SolarWindsApmConfig.__str__()to exclude service_key and collector in Lambda mode, while preserving masked service_key behavior outside Lambda; addsis_lambdato the output in both scenarios. This is logged at the end of ApmConfig init.Also:
See ticket for additional testing.