gigl.src.common.utils.metrics_service_provider#
Attributes#
Functions#
|
|
|
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
NopMetricsPublisherif 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:
Trueif metrics were initialized successfully (including the no-op default when no custom class is configured),Falseif a custom metrics class was specified but could not be loaded or instantiated.- Return type:
bool