nandorKollar commented on code in PR #4773:
URL: https://github.com/apache/polaris/pull/4773#discussion_r3424086979


##########
site/content/in-dev/unreleased/events.md:
##########
@@ -0,0 +1,150 @@
+---
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+#
+title: Events
+type: docs
+weight: 460
+---
+
+Polaris emits events for catalog, namespace, table, view, policy, principal, 
task, and other
+server-side operations. Events can be delivered to configured event listeners 
for auditing,
+observability, or downstream processing.
+
+Each event has:
+
+- `type`: the event type, such as `BEFORE_CREATE_TABLE` or 
`AFTER_CREATE_TABLE`.
+- `metadata`: event metadata, including the event ID, timestamp, realm ID, 
user, request ID, and
+  OpenTelemetry context.
+- `attributes`: typed operation-specific values, such as `catalog_name`, 
`table_name`, or request
+  and response objects.
+
+Built-in event types and categories are defined in the [`PolarisEventType`] 
class.
+
+Built-in attribute names are defined in the [`EventAttributes`] class. Custom 
attributes can be
+added by event emitters and listeners.
+
+{{< alert note >}}
+Custom event attributes are currently not supported in the event filter 
expressions. Only built-in 
+attributes can be used in filter expressions.
+{{< /alert >}}
+
+[`PolarisEventType`]: 
https://github.com/apache/polaris/blob/main/runtime/service/src/main/java/org/apache/polaris/service/events/PolarisEventType.java
+
+[`EventAttributes`]: 
https://github.com/apache/polaris/blob/main/runtime/service/src/main/java/org/apache/polaris/service/events/EventAttributes.java
+
+## Configuring Event Listeners
+
+Enable event listeners with `polaris.event-listener.types`. The value is a 
comma-separated list of
+registered event listener identifiers. Polaris includes listener 
implementations such as
+`persistence-in-memory-buffer` and `aws-cloudwatch`.
+
+```properties
+polaris.event-listener.types=persistence-in-memory-buffer,aws-cloudwatch
+```
+
+By default, a configured listener receives all event types. You can restrict a 
listener to selected
+event types or categories:
+
+```properties
+polaris.event-listener.types=aws-cloudwatch
+polaris.event-listener.aws-cloudwatch.enabled-event-categories=TABLE,VIEW
+polaris.event-listener.aws-cloudwatch.enabled-event-types=AFTER_CREATE_NAMESPACE
+```
+
+When both event categories and event types are configured for a listener, the 
listener receives the
+union of both selections.
+
+## Event Filters

Review Comment:
   I'm wondering, should we maybe replace 
`polaris.event-listener.aws-cloudwatch.enabled-event-types` with this event 
filtering logic. "Eventually, we can achieve the same with the event filter 
that we're aiming for with 
polaris.event-listener.aws-cloudwatch.enabled-event-types, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to