This section describes the configuration for server and client.
The following are the server trace telemetry configuration variables:
-
System Variable telemetry.trace_enabledScope Global Dynamic Yes SET_VARHint AppliesNo Type Boolean Default Value ONControls whether telemetry traces are collected or not .
-
System Variable telemetry.query_text_enabledScope Global Dynamic Yes SET_VARHint AppliesNo Type Boolean Default Value ONControls whether the SQL query text is included in the trace
-
System Variable telemetry.otel_log_levelScope Global Dynamic Yes SET_VARHint AppliesNo Type Enumeration Default Value ERRORValid Values SILENTINFOERRORWARNINGDEBUGControls which OpenTelemetry logs are printed in the server logs
telemetry.otel_resource_attributesSystem Variable telemetry.otel_resource_attributesScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value emptySee corresponding OpenTelemetry variable OTEL_RESOURCE_ATTRIBUTES.
telemetry.otel_exporter_otlp_traces_protocolSystem Variable telemetry.otel_exporter_otlp_traces_protocolScope Global Dynamic No SET_VARHint AppliesNo Type Enumeration Default Value http/protobufValid Values http/protobufhttp/jsonOTLP transport protocol
telemetry.otel_exporter_otlp_traces_endpointSystem Variable telemetry.otel_exporter_otlp_traces_endpointScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value http://localhost:4318/v1/tracesTarget URL to which the exporter sends traces
telemetry.otel_exporter_otlp_traces_certificatesSystem Variable telemetry.otel_exporter_otlp_traces_certificatesScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value The trusted certificate to use when verifying a server's TLS credentials.
telemetry.otel_exporter_otlp_traces_client_keySystem Variable telemetry.otel_exporter_otlp_traces_client_keyScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value Client's private key in PEM format.
telemetry.otel_exporter_otlp_traces_client_certificatesSystem Variable telemetry.otel_exporter_otlp_traces_client_certificatesScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value Client certificate/chain trust for clients private key in PEM format.
telemetry.otel_exporter_otlp_traces_headersSystem Variable telemetry.otel_exporter_otlp_traces_headersScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value emptySee corresponding OpenTelemetry variable OTEL_EXPORTER_TRACES_HEADERS.
telemetry.otel_exporter_otlp_traces_compressionSystem Variable telemetry.otel_exporter_otlp_traces_compressionScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value none (no compression)Valid Values none (no compression)gzipCompression used by exporter
telemetry.otel_exporter_otlp_traces_timeoutSystem Variable telemetry.otel_exporter_otlp_traces_timeoutScope Global Dynamic No SET_VARHint AppliesNo Type Integer Default Value 10000Unit milliseconds Time in milliseconds the OLTP exporter waits for each batch export.
telemetry.otel_bsp_schedule_delaySystem Variable telemetry.otel_bsp_schedule_delayScope Global Dynamic No SET_VARHint AppliesNo Type Integer Default Value 5000Unit milliseconds Delay interval between two consecutive exports in milliseconds
telemetry.otel_bsp_max_queue_sizeSystem Variable telemetry.otel_bsp_max_queue_sizeScope Global Dynamic No SET_VARHint AppliesNo Type Integer Default Value 2048Maximum queue size
telemetry.otel_bsp_max_export_batch_sizeSystem Variable telemetry.otel_bsp_max_export_batch_sizeScope Global Dynamic No SET_VARHint AppliesNo Type Integer Default Value 512Maximum batch size
telemetry.otel_exporter_otlp_traces_min_tlsSystem Variable telemetry.otel_exporter_otlp_traces_min_tlsScope Global Dynamic No SET_VARHint AppliesNo Type Enumeration Default Value [none]Valid Values [none]1.21.3telemetry.otel_exporter_otlp_traces_max_tlsSystem Variable telemetry.otel_exporter_otlp_traces_max_tlsScope Global Dynamic No SET_VARHint AppliesNo Type Enumeration Default Value [none]Valid Values [none]1.21.3telemetry.otel_exporter_otlp_traces_cipherSystem Variable telemetry.otel_exporter_otlp_traces_cipherScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value [none]telemetry.otel_exporter_otlp_traces_cipher_suiteSystem Variable telemetry.otel_exporter_otlp_traces_cipher_suiteScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value [none]
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. |
-
Command-Line Format --otel-traceType Boolean Default Value ONControls whether telemetry traces are collected or not .
-
Command-Line Format --otel-helpType Boolean Default Value OFFWhen enabled, prints help about telemetry_client options .
-
Command-Line Format --otel_log_levelType Enumeration Default Value ERRORValid Values ERRORSILENTWARNINGINFODEBUGControls which OpenTelemetry logs are printed in the server logs
-
Command-Line Format --otel_resource_attributesType String Default Value See corresponding OpenTelemetry variable OTEL_RESOURCE_ATTRIBUTES.
otel_exporter_otlp_traces_protocolCommand-Line Format --otel_exporter_otlp_traces_protocolType Enumeration Default Value http/protobufValid Values http/protobufhttp/jsonOTLP transport protocol
otel_exporter_otlp_traces_endpointCommand-Line Format --otel_exporter_otlp_traces_endpointType String Default Value http://localhost:4318/v1/tracesTarget URL to which the exporter sends traces
otel_exporter_otlp_traces_certificatesCommand-Line Format --otel_exporter_otlp_traces_certificatesType String Default Value The trusted certificate to use when verifying a server's TLS credentials.
otel_exporter_otlp_traces_client_keyCommand-Line Format --otel_exporter_otlp_traces_client_keyType String Default Value Client's private key in PEM format.
otel_exporter_otlp_traces_client_certificatesCommand-Line Format --otel_exporter_otlp_traces_client_certificatesType String Default Value Client certificate/chain trust for clients private key in PEM format.
otel_exporter_otlp_traces_headersCommand-Line Format --otel_exporter_otlp_traces_headersType String Default Value See corresponding OpenTelemetry variable OTEL_EXPORTER_TRACES_HEADERS.
otel_exporter_otlp_traces_compressionCommand-Line Format --otel_exporter_otlp_traces_compressionType String Default Value noneValid Values nonegzipCompression used by exporter
otel_exporter_otlp_traces_timeoutCommand-Line Format --otel_exporter_otlp_traces_timeoutType Integer Default Value 10000Time OLTP exporter waits for each batch export
-
Command-Line Format --otel_bsp_schedule_delayType Integer Default Value 5000Delay interval between two consecutive exports in milliseconds
-
Command-Line Format --otel_bsp_max_queue_sizeType Integer Default Value 2048Maximum queue size
otel_bsp_max_export_batch_sizeCommand-Line Format --otel_bsp_max_export_batch_sizeType Integer Default Value 512Maximum batch size
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.