azuremlflowopencensus

Is there a workaround to make opencensus work with MLFlow?


I'm not able to import mlflow after having launched a log with opencensus Azure. The MLFlow import runs forever.

My environment is the following:

Here is the code to repoduce the bug:

import logging

from opencensus.ext.azure.log_exporter import AzureLogHandler

logger = logging.getLogger(__name__)
logger.addHandler(AzureLogHandler(connection_string='InstrumentationKey=<your-key>'))
logger.warning('Hello, World!')

import mlflow

Solution

  • I found a workaround, not the cleanest one though.

    I import mlflow at the beginning even if it's not useful this way:

    import mlflow
    import logging
    
    from opencensus.ext.azure.log_exporter import AzureLogHandler
    
    logger = logging.getLogger(__name__)
    logger.addHandler(AzureLogHandler(connection_string='InstrumentationKey=<your-key>'))
    logger.warning('Hello, World!')
    
    import mlflow