- Application Trace (mellea.application) - User-facing operations
- Backend Trace (mellea.backend) - LLM backend interactions
- MELLEA_TRACE_APPLICATION: Enable/disable application tracing (default: false)
- MELLEA_TRACE_BACKEND: Enable/disable backend tracing (default: false)
- OTEL_EXPORTER_OTLP_ENDPOINT: OTLP endpoint for trace export
- OTEL_SERVICE_NAME: Service name for traces (default: mellea)
Functions
FUNC is_application_tracing_enabled
- True if application tracing has been enabled via the
MELLEA_TRACE_APPLICATIONenvironment variable.
FUNC is_backend_tracing_enabled
- True if backend tracing has been enabled via the
MELLEA_TRACE_BACKENDenvironment variable.
FUNC trace_application
name: Name of the span**attributes: Additional attributes to add to the span
FUNC trace_backend
name: Name of the span**attributes: Additional attributes to add to the span
FUNC start_backend_span
name: Name of the span**attributes: Additional attributes to add to the span
- The span object if tracing is enabled, otherwise None
FUNC end_backend_span
span: The span object to end
FUNC set_span_attribute
span: The span object (may be None if tracing is disabled)key: Attribute keyvalue: Attribute value
FUNC set_span_error
span: The span object (may be None if tracing is disabled)exception: The exception to record