I am relatively new to the topic. In the sample code of the OP there is no logging right? It's metrics and traces but no logging.
How is logging in OTel?
Logging in OTel is logging with your logging framework of choice. The SDK just requires you initialize the wrapper and it’ll then wrap your existing logging calls and correlate term with a trace/span in active context, if it exists. There is no separate logging API to learn. Logs are exported in a separate pipeline from traces and metrics.
Implementation for many languages are starting to mature, too.
To me traces (or maybe more specifically spans) are essentially a structured log with a unique ID and a reference to a parent ID.
Very open to have someone explain why I'm wrong or why they should be handled separately.