Skip to content

[v14] feat: add metrics for event sizes (#35440)#35505

Merged
rosstimothy merged 1 commit intobranch/v14from
tross/backport-35440/v14
Dec 7, 2023
Merged

[v14] feat: add metrics for event sizes (#35440)#35505
rosstimothy merged 1 commit intobranch/v14from
tross/backport-35440/v14

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy commented Dec 7, 2023

Backport #35440 to branch/v14

changelog: added prometheus metrics for audit event sizes

Fixes #35161

Large events queried from the Athena audit backend will now be trimmed
before they are stored and before they are returned from a query
according to the existing TrimToMaxSize implementations for each event
type already used by the Dynamo and File backends.

The other backends typically trim the event before storing it, for
Dynamo this is due to the 400 KB item size limit, for the file backend
it's due to the 64 KiB bufio.MaxScanTokenSize.

There is no hard limit to events stored in Parquet files in S3, but
we've been using a 2 GiB limit in the publisher so far.
With this change we will attempt to trim events to 2 GiB before writing
them (if we haven't already run out of memory) instead of just failing.

We've also been using a 1 MiB limit in the querier and just returning an
empty result when an event larger than that is encountered.
With this change we will attempt to trim the event to 1MiB before
returning it.
The 1 MiB limit ultimately stems from the 4MB max gRPC message size.

We could just trim to 1 MiB in the publisher, but I'd prefer to preserve
as much of the event data as possible in case we improve the querying
story for large events in the future (and in case the user wants to
query the events directly from S3).

* feat: add metrics for event sizes
@rosstimothy rosstimothy marked this pull request as ready for review December 7, 2023 18:07
@github-actions github-actions Bot added audit-log Issues related to Teleports Audit Log size/sm labels Dec 7, 2023
@github-actions github-actions Bot requested review from tigrato and zmb3 December 7, 2023 18:07
@rosstimothy rosstimothy enabled auto-merge December 7, 2023 18:08
@rosstimothy rosstimothy added this pull request to the merge queue Dec 7, 2023
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from tigrato December 7, 2023 19:04
Merged via the queue into branch/v14 with commit a3c6ee7 Dec 7, 2023
@rosstimothy rosstimothy deleted the tross/backport-35440/v14 branch December 7, 2023 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit-log Issues related to Teleports Audit Log backport size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants