gigl.common.services.gcp_cloud_logging#

Attributes#

Classes#

Module Contents#

class gigl.common.services.gcp_cloud_logging.GCPCloudLoggingService[source]#
get_logs_iterator_from_k8_container(project_id, cluster_name, pod_name, datetime_start, datetime_end, query_filter)[source]#

Get logs for a kubernetes pod from GCP Logging.

Parameters:
  • 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.

  • example (For)

  • can (if you want to get logs that contain dataflow job uris you)

  • filter (use the following query) – https://console.cloud.google.com/dataflow/jobs/

Returns:

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.

Return type:

Iterable[str]

class gigl.common.services.gcp_cloud_logging.LogEntries(list_log_entry_pager)[source]#
Parameters:

list_log_entry_pager (google.cloud.logging_v2.services.logging_service_v2.pagers.ListLogEntriesPager)

gigl.common.services.gcp_cloud_logging.CLOUD_LOGGING_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ'[source]#
gigl.common.services.gcp_cloud_logging.logger[source]#