<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="telemetry-trace-format">
      </a>
      35.3.2 Trace Format
     </h3>
    </div>
   </div>
  </div>
  <p>
   A span represents an operation within a trace. For more
        information, see
   <a class="ulink" href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span" target="_blank">
    OpenTelemetry
        Span
   </a>
   . The following span types are emitted by the
        telemetry component:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="telemetry-trace-format.html#telemetry-trace-format-control" title="Control Span">
       Control Span
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="telemetry-trace-format.html#telemetry-trace-format-session" title="Session Span">
       Session Span
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="telemetry-trace-format.html#telemetry-trace-format-statement" title="Statement Span">
       Statement Span
      </a>
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="telemetry-trace-format-control">
       </a>
       Control Span
      </h4>
     </div>
    </div>
   </div>
   <p>
    Issued when the telemetry configuration changes, notifying
          downstream system of which signal collection has been enabled
          or disabled.
   </p>
   <p>
    This span type has the following attributes:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="literal">
        Name: Control
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        trace_enabled
       </code>
       : Boolean.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        metrics_enabled
       </code>
       : Boolean.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        logs_enabled
       </code>
       : Boolean
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        details
       </code>
       :
      </p>
     </li>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="telemetry-trace-format-session">
       </a>
       Session Span
      </h4>
     </div>
    </div>
   </div>
   <p>
    Issued when a client session ends, recording data relevant to
          that session from initial connection to close of session.
   </p>
   <p>
    This span type has the following attributes:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="literal">
        Name: Session
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.processlist_id
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.thread_id
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.user
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.host
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.group
       </code>
      </p>
     </li>
    </ul>
   </div>
   <p>
    This span also contains dynamic attributes generated with the
          format
    <code class="literal">
     mysql.session_attr.
     <em class="replaceable">
      <code>
       xxx
      </code>
     </em>
    </code>
    ,
          where
    <code class="literal">
     <em class="replaceable">
      <code>
       xxx
      </code>
     </em>
    </code>
    is the
          session connect attribute name. See
    <a class="link" href="performance-schema-session-connect-attrs-table.html" title="29.12.9.2 The session_connect_attrs Table">
     <code class="literal">
      session_connect_attrs
     </code>
    </a>
    .
   </p>
   <p>
    For example, after the following session disconnects:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa43661161"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">select</span> <span class="token operator">*</span> <span class="token keyword">from</span> session_connect_attrs<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> PROCESSLIST_ID <span class="token punctuation">|</span> ATTR_NAME       <span class="token punctuation">|</span> ATTR_VALUE <span class="token punctuation">|</span> ORDINAL_POSITION <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>             10 <span class="token punctuation">|</span> _pid            <span class="token punctuation">|</span> 14488      <span class="token punctuation">|</span>                0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>             10 <span class="token punctuation">|</span> _platform       <span class="token punctuation">|</span> x86_64     <span class="token punctuation">|</span>                1 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>             10 <span class="token punctuation">|</span> _os             <span class="token punctuation">|</span> Linux      <span class="token punctuation">|</span>                2 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>             10 <span class="token punctuation">|</span> _client_name    <span class="token punctuation">|</span> libmysql   <span class="token punctuation">|</span>                3 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>             10 <span class="token punctuation">|</span> os_user         <span class="token punctuation">|</span> malff      <span class="token punctuation">|</span>                4 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>             10 <span class="token punctuation">|</span> _client_version <span class="token punctuation">|</span> 8.4.0<span class="token punctuation">-</span>tr   <span class="token punctuation">|</span>                5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>             10 <span class="token punctuation">|</span> program_name    <span class="token punctuation">|</span> mysql      <span class="token punctuation">|</span>                6 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">7 rows in set (0.00 sec)</span></code></pre>
   </div>
   <p>
    The session span emitted is:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-json"><div class="docs-select-all right" id="sa500386"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-json">Span #
    Trace ID       <span class="token operator">:</span> 4137db42febad2d00a4123286076ba18
    Parent ID      <span class="token operator">:</span> 
    ID             <span class="token operator">:</span> b7ff26660b9fcb35
    Name           <span class="token operator">:</span> session
    Kind           <span class="token operator">:</span> Internal
    Start time     <span class="token operator">:</span> <span class="token number">2023</span>-<span class="token number">01</span>-<span class="token number">11</span> <span class="token number">10</span><span class="token operator">:</span><span class="token number">58</span><span class="token operator">:</span><span class="token number">24.79557649</span> +<span class="token number">0000</span> UTC
    End time       <span class="token operator">:</span> <span class="token number">2023</span>-<span class="token number">01</span>-<span class="token number">11</span> <span class="token number">11</span><span class="token operator">:</span><span class="token number">00</span><span class="token operator">:</span><span class="token number">50.46695685</span> +<span class="token number">0000</span> UTC
    Status code    <span class="token operator">:</span> Unset
    Status message <span class="token operator">:</span> 
Attributes<span class="token operator">:</span>
     -&gt; mysql.processlist_id<span class="token operator">:</span> Int(<span class="token number">10</span><span class="token punctuation">)</span>
     -&gt; mysql.thread_id<span class="token operator">:</span> Int(<span class="token number">50</span><span class="token punctuation">)</span>
     -&gt; mysql.user<span class="token operator">:</span> Str(root<span class="token punctuation">)</span>
     -&gt; mysql.host<span class="token operator">:</span> Str(localhost<span class="token punctuation">)</span>
     -&gt; mysql.group<span class="token operator">:</span> Str(USR_default<span class="token punctuation">)</span>
     -&gt; mysql.session_attr._pid<span class="token operator">:</span> Str(<span class="token number">14488</span><span class="token punctuation">)</span>
     -&gt; mysql.session_attr._platform<span class="token operator">:</span> Str(x86_64<span class="token punctuation">)</span>
     -&gt; mysql.session_attr._os<span class="token operator">:</span> Str(Linux<span class="token punctuation">)</span>
     -&gt; mysql.session_attr._client_name<span class="token operator">:</span> Str(libmysql<span class="token punctuation">)</span>
     -&gt; mysql.session_attr.os_user<span class="token operator">:</span> Str(malff<span class="token punctuation">)</span>
     -&gt; mysql.session_attr._client_version<span class="token operator">:</span> Str(<span class="token number">8.4</span>.<span class="token number">0</span>-tr<span class="token punctuation">)</span>
     -&gt; mysql.session_attr.program_name<span class="token operator">:</span> Str(mysql<span class="token punctuation">)</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="telemetry-trace-format-statement">
       </a>
       Statement Span
      </h4>
     </div>
    </div>
   </div>
   <p>
    Issued when a statement execution ends in the server,
          recording all relevant statement information from the start of
          the execution to its completion.
   </p>
   <p>
    This span type has the following attributes:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="literal">
        Name: stmt
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.event_name
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.lock_time
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.sql_text
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.digest_text
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.current_schema
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.object_type
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.object_schema
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.object_name
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.sql_errno
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.sqlstate
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.message_text
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.error_count
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.warning_count
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.rows_affected
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.rows_sent
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.rows_examined
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.created_tmp_disk_tables
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.created_tmp_tables
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.select_full_join
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.select_full_range_join
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.select_range
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.select_range_check
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.select_scan
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.sort_merge_passes
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.sort_range
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.sort_rows
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.sort_scan
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.no_index_used
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.no_good_index_used
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.max_controlled_memory
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.max_total_memory
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        mysql.cpu_time
       </code>
      </p>
     </li>
    </ul>
   </div>
  </div>
 </div>
 <br/>
</div>
