Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cfg): Add configurable GCP log page size #3556

Merged
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
AuditLogEntry = Any

DEBUG_INCLUDE_FULL_PAYLOADS = False
GCP_LOGGING_PAGE_SIZE = 1000

# Handle yearly, monthly, daily, or hourly partitioning.
# See https://cloud.google.com/bigquery/docs/partitioned-tables.
Expand Down Expand Up @@ -257,6 +256,7 @@ class BigQueryUsageConfig(BaseUsageConfig):
extra_client_options: dict = {}
env: str = builder.DEFAULT_ENV

log_page_size: pydantic.PositiveInt = 1000
query_log_delay: Optional[pydantic.PositiveInt] = None
max_query_duration: timedelta = timedelta(minutes=15)

Expand Down Expand Up @@ -342,7 +342,7 @@ def get_entry_timestamp(entry: AuditLogEntry) -> datetime:
for client in clients:
try:
list_entries: Iterable[AuditLogEntry] = client.list_entries(
filter_=filter, page_size=GCP_LOGGING_PAGE_SIZE
filter_=filter, page_size=self.config.log_page_size
)
list_entry_generators_across_clients.append(list_entries)
except Exception as e:
Expand Down