core.otlp.utils

OTLP utility functions for jobmon.

Functions

get_current_span_details(→ Tuple[Optional[str], ...)

Get details of the current OpenTelemetry span.

add_span_details_processor(→ Dict[str, Any])

Structlog processor to add OpenTelemetry span details to log entries.

Module Contents

core.otlp.utils.get_current_span_details() Tuple[str | None, str | None, str | None][source]

Get details of the current OpenTelemetry span.

Returns:

Tuple of (span_id, trace_id, parent_span_id) as hex strings, or (None, None, None)

core.otlp.utils.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.