Skip to content

feat: implement auditlog ng client#41

Open
simeongelovski wants to merge 20 commits intoSAP:mainfrom
auditlog-service:auditlog-ng-impl
Open

feat: implement auditlog ng client#41
simeongelovski wants to merge 20 commits intoSAP:mainfrom
auditlog-service:auditlog-ng-impl

Conversation

@simeongelovski
Copy link
Copy Markdown
Member

@simeongelovski simeongelovski commented Apr 7, 2026

Summary

This PR introduces a new auditlog_ng client for the SAP Cloud SDK for Python.

The new client enables sending Audit Log Service NG (v3) events over OTLP/gRPC and is designed for integration into Python services and agents.

What’s included

  • New sap_cloud_sdk.core.auditlog_ng module
  • AuditClient + create_client() factory
  • Generated protobuf support for Audit Log event schemas
  • Event validation via protovalidate
  • Telemetry integration for client creation
  • Unit tests, proto generation flow, and packaging support

Usage

Example:

from sap_cloud_sdk.core.auditlog_ng import create_client
from sap_cloud_sdk.core.auditlog_ng.gen.sap.auditlog.auditevent.v2 import auditevent_pb2 as pb

client = create_client(
    endpoint="localhost:4317",
    deployment_id="my-deployment",
    namespace="sap.als",
    insecure=True,
)

event = pb.DataAccess()
event_id = client.send(event, "DataAccess")
client.close()

Testing

Added unit tests under tests/core/unit/auditlog_ng

@simeongelovski simeongelovski requested a review from a team as a code owner April 7, 2026 14:06
@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Apr 7, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@jeanscherf jeanscherf left a comment

Choose a reason for hiding this comment

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

The gen/ directory contains generated *_pb2.py files but there are no .proto source files checked in. Without the sources no one can regenerate or update the generated code.

  • Add proto source files to src/sap_cloud_sdk/core/auditlog_ng/proto/ with a
    buf.yaml and buf.gen.yaml that configure output into gen/ and src/buf/.
    (really liked buf btw! Thanks for the suggestion!).

  • Also add a Makefile at the repo root with at minimum:

.PHONY: proto
proto:
    cd src/sap_cloud_sdk/core/auditlog_ng/proto && buf generate
  • Add .github/workflows/proto-verify.yml that runs
    make proto and then git diff --exit-code to fail the PR if generated files differ.

Let me know if you need any help with all that.

Co-authored-by: Jean Scherf <jeanscherf@gmail.com>
@simeongelovski simeongelovski changed the title Implement Auditlog NG client feat: Implement Auditlog NG client Apr 8, 2026
@simeongelovski simeongelovski changed the title feat: Implement Auditlog NG client feat: implement auditlog ng client Apr 9, 2026
Copy link
Copy Markdown
Member

@jeanscherf jeanscherf left a comment

Choose a reason for hiding this comment

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

Great work! Thank you for the contribution!
LGTM

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.

3 participants