gigl.src.common.utils.metrics_service_provider#

Attributes#

Functions#

get_metrics_service_instance()

init_metrics_publisher_grouping_for_job(service_name)

initialize_metrics(task_config_uri, service_name)

Initialize the global metrics publisher from the task config.

Module Contents#

gigl.src.common.utils.metrics_service_provider.get_metrics_service_instance()[source]#
Return type:

Optional[gigl.common.metrics.metrics_interface.OpsMetricPublisher]

gigl.src.common.utils.metrics_service_provider.init_metrics_publisher_grouping_for_job(service_name)[source]#
Parameters:

service_name (str)

Return type:

None

gigl.src.common.utils.metrics_service_provider.initialize_metrics(task_config_uri, service_name)[source]#

Initialize the global metrics publisher from the task config.

Reads the metrics configuration from the task config YAML. If a custom metrics class is specified, attempts to instantiate it. Falls back to NopMetricsPublisher if no class is configured or instantiation fails.

Parameters:
  • task_config_uri (gigl.common.Uri) – URI to the task config YAML file.

  • service_name (str) – Name of the service, used for metric grouping.

Returns:

True if metrics were initialized successfully (including the no-op default when no custom class is configured), False if a custom metrics class was specified but could not be loaded or instantiated.

Return type:

bool

gigl.src.common.utils.metrics_service_provider.JOB_NAME_GROUPING_ENV_KEY = 'GBML_JOB_NAME'[source]#
gigl.src.common.utils.metrics_service_provider.logger[source]#