MySQL 8.4 Reference Manual  /  ...  /  Configuring Trace Telemetry

35.3.1 Configuring Trace Telemetry

This section describes the configuration for server and client.

Server Configuration

The following are the server trace telemetry configuration variables:

Client Configuration

The MySQL client reads telemetry configuration from the [telemetry_client] section of the configuration file. See Installing Client Plugin for information on the telemetry_client option. The following configuration options are available:

Table 35.2 mysql client Telemetry Option Summary

Option Name Description
--telemetry_client Enables the telemetry client.
--otel_bsp_max_export_batch_size See variable OTEL_BSP_MAX_EXPORT_BATCH_SIZE.
--otel_bsp_max_queue_size See variable OTEL_BSP_MAX_QUEUE_SIZE.
--otel_bsp_schedule_delay See variable OTEL_BSP_SCHEDULE_DELAY.
--otel_exporter_otlp_traces_certificates Not in use at this time. Reserved for future development.
--otel_exporter_otlp_traces_client_certificates Not in use at this time. Reserved for future development.
--otel_exporter_otlp_traces_client_key Not in use at this time. Reserved for future development.
--otel_exporter_otlp_traces_compression Compression type
--otel_exporter_otlp_traces_endpoint The trace export endpoint
--otel_exporter_otlp_traces_headers Key-value pairs to be used as headers associated with HTTP requests
--otel_exporter_otlp_traces_protocol The OTLP transport protocol
--otel_exporter_otlp_traces_timeout Time OLTP exporter waits for each batch export
--otel-help When enabled, prints help about telemetry_client options.
--otel_log_level Controls which opentelemetry logs are printed in the server logs
--otel_resource_attributes See corresponding OpenTelemetry variable OTEL_RESOURCE_ATTRIBUTES.
--otel-trace This system variable controls whether telemetry traces are collected or not.

  • trace

    Command-Line Format --otel-trace
    Type Boolean
    Default Value ON

    Controls whether telemetry traces are collected or not .

  • help

    Command-Line Format --otel-help
    Type Boolean
    Default Value OFF

    When enabled, prints help about telemetry_client options .

  • otel_log_level

    Command-Line Format --otel_log_level
    Type Enumeration
    Default Value ERROR
    Valid Values

    ERROR

    SILENT

    WARNING

    INFO

    DEBUG

    Controls which OpenTelemetry logs are printed in the server logs

  • otel_resource_attributes

    Command-Line Format --otel_resource_attributes
    Type String
    Default Value

    See corresponding OpenTelemetry variable OTEL_RESOURCE_ATTRIBUTES.

  • otel_exporter_otlp_traces_protocol

    Command-Line Format --otel_exporter_otlp_traces_protocol
    Type Enumeration
    Default Value http/protobuf
    Valid Values

    http/protobuf

    http/json

    OTLP transport protocol

  • otel_exporter_otlp_traces_endpoint

    Command-Line Format --otel_exporter_otlp_traces_endpoint
    Type String
    Default Value http://localhost:4318/v1/traces

    Target URL to which the exporter sends traces

  • otel_exporter_otlp_traces_certificates

    Command-Line Format --otel_exporter_otlp_traces_certificates
    Type String
    Default Value

    The trusted certificate to use when verifying a server's TLS credentials.

  • otel_exporter_otlp_traces_client_key

    Command-Line Format --otel_exporter_otlp_traces_client_key
    Type String
    Default Value

    Client's private key in PEM format.

  • otel_exporter_otlp_traces_client_certificates

    Command-Line Format --otel_exporter_otlp_traces_client_certificates
    Type String
    Default Value

    Client certificate/chain trust for clients private key in PEM format.

  • otel_exporter_otlp_traces_headers

    Command-Line Format --otel_exporter_otlp_traces_headers
    Type String
    Default Value

    See corresponding OpenTelemetry variable OTEL_EXPORTER_TRACES_HEADERS.

  • otel_exporter_otlp_traces_compression

    Command-Line Format --otel_exporter_otlp_traces_compression
    Type String
    Default Value none
    Valid Values

    none

    gzip

    Compression used by exporter

  • otel_exporter_otlp_traces_timeout

    Command-Line Format --otel_exporter_otlp_traces_timeout
    Type Integer
    Default Value 10000

    Time OLTP exporter waits for each batch export

  • otel_bsp_schedule_delay

    Command-Line Format --otel_bsp_schedule_delay
    Type Integer
    Default Value 5000

    Delay interval between two consecutive exports in milliseconds

  • otel_bsp_max_queue_size

    Command-Line Format --otel_bsp_max_queue_size
    Type Integer
    Default Value 2048

    Maximum queue size

  • otel_bsp_max_export_batch_size

    Command-Line Format --otel_bsp_max_export_batch_size
    Type Integer
    Default Value 512

    Maximum batch size

Client Configuration Example

The following is an example of a my.cnf configuration file containing the Client Telemetry plugin configuration:

[mysql]

telemetry-client = ON

[telemetry_client]
help = ON
trace = OFF
otel-resource-attributes = "RK1=RV1, RK2=RV2, RK3=RV3"
otel-log-level = "error"
otel-exporter-otlp-traces-headers = "K1=V1, K2=V2"
otel-exporter-otlp-traces-protocol = "http/json"

If telemetry-client = ON is set in the configuration file, you do not need to specify --telemetry-client when starting the client.