TraxAuditEntry

> NO WARRANTY. Trax auth is plumbing, not a security product. You are solely responsible for securing systems that use it. See API Security.

Immutable record describing one executed GraphQL request. Built by the listener and passed in batches to ITraxAuditSink.WriteAsync.

Signature

public sealed record TraxAuditEntry(
    string PrincipalId,
    string? PrincipalType,
    string? OperationName,
    string Document,
    IReadOnlyDictionary<string, object?>? Variables,
    long DurationMs,
    DateTimeOffset Timestamp,
    bool Success,
    string? ErrorText,
    IReadOnlyDictionary<string, string>? Metadata = null
);

Fields

FieldNotes
PrincipalIdFrom trax:principal-id claim, or TraxAuditOptions.DefaultPrincipalId when absent.
PrincipalTypeFrom trax:principal-type claim. apikey, jwt, or similar. null for anonymous.
OperationNameThe GraphQL operation name, if any.
DocumentThe GraphQL query text. Truncated at TraxAuditOptions.MaxDocumentLength with a trailing ...[truncated] marker.
VariablesPost-redaction. null when there were no variables or the redactor returned null.
DurationMsElapsed request time in milliseconds.
TimestampUTC when the request started, NOT when the entry was persisted.
SuccessFalse on exception or GraphQL errors in the result.
ErrorTextJoined error messages or the exception message.
MetadataBag for host-provided extras (request IP, tenant ID, correlation ID). Not populated by the default listener.