core.otlp.formatters
Compatibility layer for legacy OTLP formatter imports.
Classes
Formatter that adds OpenTelemetry span details to jobmon logs. |
Functions
|
Structlog processor to add OpenTelemetry span details to log entries. |
|
Get details of the current OpenTelemetry span. |
Module Contents
- class core.otlp.formatters.JobmonOTLPFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]
Bases:
logging.FormatterFormatter that adds OpenTelemetry span details to jobmon logs.
Note: For handlers using _JobmonOTLPLoggingHandler, this formatter is not used for OTLP output (handler creates OTLPLogRecord directly). It only affects console/file output.
- format(record: logging.LogRecord) str[source]
Format log record with OpenTelemetry span details.
- core.otlp.formatters.add_span_details_processor(logger: Any, method_name: str, event_dict: Dict[str, Any]) Dict[str, Any][source]
Structlog processor to add OpenTelemetry span details to log entries.
- Parameters:
logger – The logger instance (not used, but required by Structlog processor signature).
method_name – The logging method name (e.g., “info”, “debug”).
event_dict – The event dictionary representing the log entry.
- Returns:
The modified event dictionary with OpenTelemetry span details added.