fix: record auditlog ng telemetry on client initialization#139
Merged
Conversation
jeanscherf
reviewed
May 27, 2026
jeanscherf
reviewed
May 27, 2026
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.
Description
Moves the ALS v3 (
auditlog_ng)AUDITLOG_CREATE_CLIENTcapability metric from the public factory wrapper to the sharedAuditClientinitialization path. This keeps the signal as client/capability initialization rather than audit-event volume, while ensuring directAuditClient(config)construction emits the same SDK usage telemetry ascreate_client(config=...).The factory still records error metrics for validation/configuration failures that happen before
AuditClientcan be initialized, preserving the previous error telemetry behavior. The package version is bumped to0.20.2.Related Issue
Internal tracking: AFSDK-3392
Type of Change
Please check the relevant option:
How to Test
uv run pytest tests/core/unit/test_version.py tests/core/unit/auditlog_ng/unit/test_create_client.py tests/core/unit/auditlog_ng/unit/test_client.py tests/core/unit/telemetry/test_metrics_decorator.py -quv run pytest tests -m 'not integration' -quv run ruff check pyproject.toml src/sap_cloud_sdk/core/auditlog_ng/__init__.py src/sap_cloud_sdk/core/auditlog_ng/client.py src/sap_cloud_sdk/core/telemetry/metrics_decorator.py tests/core/unit/auditlog_ng/unit/test_create_client.py tests/core/unit/auditlog_ng/unit/test_client.py tests/core/unit/telemetry/test_metrics_decorator.pyuv run ty checkuv builduv run pytest tests/core/integration/auditlog -quv run pytest tests -m integration --ignore=tests/destination/integration -qExpected result: direct
AuditClient(config)and factory-created clients both record exactly oneauditlog_ng/create_clientcapability metric on successful initialization, without instrumentingsend()orsend_json().Checklist
Before submitting your PR, please review and check the following:
Breaking Changes
None.
Additional Notes
send()andsend_json()remain uninstrumented intentionally. The dashboard signal should represent ALS v3 capability/client initialization, not audit event volume.Local verification performed:
53 passedfor focused version/auditlog NG/telemetry tests.2098 passed, 125 deselectedfor non-integration tests.21 passedfor AuditLog integration tests with configured bindings.65 passed, 31 skippedfor integration tests excluding Destination.uv run ty checkcompleted with only pre-existing DMS integration warnings.uv buildproducedsap_cloud_sdk-0.20.2sdist and wheel.Full integration was also executed; remaining failures were limited to known Destination integration scenarios and are unrelated to ALS v3 telemetry.