Skip to content

[WIP/PoC] NH-75342 refactor config and logging #355

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ opentelemetry-instrumentation-requests==0.41b0
pytest
pytest-cov
pytest-mock
python-dotenv
requests
flask<3.0.0
werkzeug
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -45,7 +45,8 @@ dependencies = [
'opentelemetry-api == 1.20.0',
'opentelemetry-sdk == 1.20.0',
'opentelemetry-instrumentation == 0.41b0',
'opentelemetry-instrumentation-logging == 0.41b0',
# 'opentelemetry-instrumentation-logging == 0.41b0',
'python-dotenv == 1.0.1',
]

[project.urls]
7 changes: 4 additions & 3 deletions solarwinds_apm/apm_config.py
Original file line number Diff line number Diff line change
@@ -67,11 +67,12 @@ def get_oboe_trigger_trace_mode(cls, trigger_trace_mode: str) -> int:
class SolarWindsApmConfig:
"""SolarWinds APM Configuration Class
The precedence: in-code keyword arguments > Environment Variables > config file > default values.
Note that oboe doesn't read configurations by itself. The Python agent needs to
read environment variables and/or config files and pass them into oboe. This is
done only once during the initialization and the properties cannot be refreshed.

TODO update docstring
"""

# TODO Rm/Subclass (shared) responsibilities of UserConfig

_CONFIG_FILE_DEFAULT = "./solarwinds-apm-config.json"
_DELIMITER = "."
_KEY_MASK = "{}...{}:{}"
1 change: 1 addition & 0 deletions solarwinds_apm/apm_constants.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

INTL_SWO_USER_CONFIG_PATH = "./_solarwinds-apm-config.env"
INTL_SWO_AO_COLLECTOR = "collector.appoptics.com"
INTL_SWO_AO_STG_COLLECTOR = "collector-stg.appoptics.com"
INTL_SWO_CURRENT_TRACE_ENTRY_SPAN_ID = "sw-current-trace-entry-span-id"
Loading