obelix74 commented on code in PR #3385:
URL: https://github.com/apache/polaris/pull/3385#discussion_r2835868048


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/metrics/MetricsRecordIdentity.java:
##########
@@ -92,4 +93,45 @@ public interface MetricsRecordIdentity {
    * store and index specific metadata fields as needed.
    */
   Map<String, String> metadata();
+
+  // === Request Context Fields ===
+
+  /**
+   * Name of the principal (user) who made the request.
+   *
+   * <p>This is the authenticated principal name from the security context 
when the metrics report
+   * was received. Useful for auditing and tracking which users are accessing 
which tables.
+   */
+  Optional<String> principalName();
+
+  /**
+   * Server-generated request ID for correlation.
+   *
+   * <p>This is the request ID assigned by the Polaris server when the metrics 
report was received.
+   * It can be used to correlate metrics with server logs and other telemetry.
+   */
+  Optional<String> requestId();
+
+  /**
+   * OpenTelemetry trace ID.
+   *
+   * <p>The trace ID from the OpenTelemetry context when the metrics report 
was received. This
+   * enables correlation with distributed traces across services.
+   */
+  Optional<String> otelTraceId();

Review Comment:
   I had to use a provider pattern here since I couldn't bring 
`polaris-runtime-service` dependencies in `polaris-relational-jdbc`.



-- 
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