gigl.common.services.GCPCloudLoggingService#

class gigl.common.services.gcp_cloud_logging.GCPCloudLoggingService#

Bases: object

Methods

__init__

get_logs_iterator_from_k8_container

Get logs for a kubernetes pod from GCP Logging.

__init__() None#
__weakref__#

list of weak references to the object (if defined)

get_logs_iterator_from_k8_container(project_id: str, cluster_name: str, pod_name: str, datetime_start: datetime, datetime_end: datetime, query_filter: str) Iterable[str]#

Get logs for a kubernetes pod from GCP Logging.

Args:

project_id (str): cluster_name (str): pod_name (str): datetime_start (datetime): datetime_end (datetime): query_filter (str): A query filter to filter the logs. For example, if you want to get logs that contain dataflow job uris you can use the following query filter: https://console.cloud.google.com/dataflow/jobs/

Returns:

Iterable[str]: The log messages that match the query filter. Warning this will keep iterating, ensure you provide some restrictive query filter unless you want to download all the logs from the pod.