If you’re using an integration, input and output should be automatically logged. You can customize it if you’re manually instrumenting or override what the integration set up.
Log Inputs
Most auto-instrumentors automatically populate the input field without requiring manual logging. This section reviews manual instrumentation of input. In the tracing tab, our table view looks for the span attributes"input.value" (or SpanAttributes.INPUT_VALUE or SemanticConventions.INPUT_VALUE) to populate the input column.

SpanAttributes.LLM_INPUT_MESSAGES key. This enables you to view the full series of messages exchanged between the user and assistant on one page.

- Python
This example code shows how you can instrument the inputs of a python app.One thing to note is the format of the
LLM_INPUT_MESSAGES. This attribute is represented as a list of chat completion params, which have role and content fields. In order to set this, you need to set the index as well as each field for each message, as shown in the example below. This example uses the ChatCompletionMessageParam message type from OpenAi, but any data following the format of example_messages below will do.Log Outputs
Most auto-instrumentors automatically populate the output field without requiring manual logging. This section reviews manual instrumentation of output. In the tracing tab, our table view looks for the span attributes"output.value" (or SpanAttributes.OUTPUT_VALUE or SemanticConventions.OUTPUT_VALUE) to populate the Output column.

SpanAttributes.LLM_OUTPUT_MESSAGES key. This enables you to view the full message returned.

- Python
This example code shows how you can log outputs as well. This follows a similar convention to input logging: