Skip to main content
OpenTelemetry logging instrumentation for Mellea. Provides log export using OpenTelemetry Logs API with OTLP exporter support. Configuration via environment variables:
  • MELLEA_LOGS_OTLP: Enable OTLP logs exporter (default: false)
  • OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: Logs-specific endpoint (optional, overrides general)
  • OTEL_EXPORTER_OTLP_ENDPOINT: General endpoint for all signals (fallback)
  • OTEL_SERVICE_NAME: Service name for logs (default: mellea)
Example: export MELLEA_LOGS_OTLP=true export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 Programmatic usage: from mellea.telemetry.logging import get_otlp_log_handler import logging logger = logging.getLogger(“my_logger”) handler = get_otlp_log_handler() if handler: logger.addHandler(handler) logger.info(“This log will be exported via OTLP”)

Functions

FUNC get_otlp_log_handler

get_otlp_log_handler() -> Any
Get an OTLP logging handler for Python’s logging module. Returns:
  • LoggingHandler instance if OTLP logging is enabled and configured,
  • None otherwise.