-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAT-16112][PLAT-16269] Update log attributes getting sent in Databa…
…se Audit Logging Summary: This diff fixes 2 tickets: 1. [PLAT-16112] Update log attributes that are set from YBA in DBAL. Puts most of the logs under the key `yugabyte` for better organisation. 2. [PLAT-16269] [Master] Enabling audit log on a universe is failing due to error 'the field ''become'' has an invalid value Test Plan: Manually tested and ensured the log attributes are correct. Log Before: ``` { "id": "...", "content": { "timestamp": "2024-12-07T19:37:06Z", "tags": [ "source:yugabyte", "otel_source:datadog_exporter", "datadog.submission_auth:api_key" ], "host": "yb-admin-sahith-uni-1-n1", "service": "yb-otel-collector", "message": "2024-12-07 19:37:06.945 UTC [69811] LOG: AUDIT: SESSION,1,1,MISC,UNKNOWN,COMPOSITE TYPE,public.write_read_test,<previously logged>,<previously logged>", "attributes": { "process_id": "69811", "log": { "file": { "name": "postgresql-2024-12-07_193605.log" } }, "object_type": "COMPOSITE TYPE", "log_level": "LOG", "statement_id": "1", "command": "UNKNOWN", "timestamp_with_ms": "2024-12-07 19:37:06.945 UTC", "yugabyte": { "audit_log_type": "ysql" }, "hostname": "yb-admin-sahith-uni-1-n1", "@timestamp": "2024-12-07T19:37:06Z", "service": "yb-otel-collector", "object_name": "public.write_read_test", "host": "yb-admin-sahith-uni-1-n1", "otel": { "timestamp": "1733600226945000000" }, "statement": "<previously logged>,<previously logged>", "class": "MISC", "substatement_id": "1", "audit_type": "SESSION", "status": "" } } } ``` Log After: ``` { "id": "...", "content": { "timestamp": "2024-12-12T09:20:26Z", "tags": [ "source:yugabyte", "otel_source:datadog_exporter", "datadog.submission_auth:api_key" ], "host": "yb-admin-sahith-uni-1-n1", "service": "yb-otel-collector", "message": "2024-12-12 09:20:26.733 UTC [3634113] LOG: AUDIT: SESSION,1,1,MISC,UNKNOWN,COMPOSITE TYPE,public.write_read_test,<previously logged>,<previously logged>", "attributes": { "yugabyte": { "process_id": "3634113", "log": { "file": { "name": "postgresql-2024-12-12_082604.log" } }, "object_type": "COMPOSITE TYPE", "purpose": "DATA_DOG_LOG_EXPORT", "log_level": "LOG", "audit_log_type": "ysql", "universe_uuid": "75dca85b-05d9-4150-9234-e055d421b52c", "statement_id": "1", "command": "UNKNOWN", "cloud": "gcp", "timestamp_with_ms": "2024-12-12 09:20:26.733 UTC", "node_type": "PRIMARY", "zone": "us-west1-a", "object_name": "public.write_read_test", "statement": "<previously logged>,<previously logged>", "region": "us-west1", "class": "MISC", "substatement_id": "1", "audit_type": "SESSION" }, "hostname": "yb-admin-sahith-uni-1-n1", "@timestamp": "2024-12-12T09:20:26Z", "service": "yb-otel-collector", "host": "yb-admin-sahith-uni-1-n1", "otel": { "timestamp": "1733995226733000000" }, "status": "" } } } ``` Also ran UTs and itests. Reviewers: amalyshev Reviewed By: amalyshev Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D40532
- Loading branch information
Showing
8 changed files
with
228 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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