Skip to main content
Version: v2510

intelligence.zenith_tune.integration.opentelemetry.callback

OpenTelemetry logs callback for Optuna optimization tracking.

OpenTelemetryCallback Objects

class OpenTelemetryCallback()

Callback to export Optuna trial logs to OpenTelemetry.

This callback logs each trial as a single structured log record containing:

  • Trial number, state, and value
  • Trial parameters (as JSON)
  • Best value so far

__init__

def __init__(endpoint: str, attributes: Optional[Dict[str, Any]] = None)

Initialize the OpenTelemetry callback.

Arguments:

  • endpoint - OTLP endpoint (required)
  • attributes - Additional attributes to add to resource and logs

__call__

def __call__(study: optuna.Study, trial: FrozenTrial)

Callback function called after each trial.

Arguments:

  • study - The Optuna study
  • trial - The completed trial