8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 35 Telemetry / 35.1 Installing OpenTelemetry Support
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

35.1 安装 OpenTelemetry 支持35.1 Installing OpenTelemetry Support

本节描述了服务器和客户端 OpenTelemetry 支持的安装。This section describes the installation of the server and client OpenTelemetry support.

安装服务器组件Installing Server Component

要安装服务器组件,请运行以下命令:To install the server component, run the following command:

install component 'file://component_telemetry';
        

要确认服务器中已存在该组件,请运行以下查询:To confirm the component is present in your server, run the following query:

mysql> select * from mysql.component;
+--------------+--------------------+------------------------------------+
| component_id | component_group_id | component_urn                      |
+--------------+--------------------+------------------------------------+
|            1 |                  1 | file://component_validate_password |
|            2 |                  2 | file://component_telemetry         |
+--------------+--------------------+------------------------------------+
        

如果 component_telemetry 出现在 component_urn 列中,则该组件已安装。If component_telemetry is present in the component_urn column, the component is installed.

组件安装还会添加特定于遥测的系统变量。The component installation also adds telemetry-specific system variables.

mysql> show variables like "%telemetry%";
+----------------------------------------------------------+----------------------------------+
| Variable_name                                            | Value                            |
+----------------------------------------------------------+----------------------------------+
| telemetry.metrics_enabled                                | ON                               |
| telemetry.metrics_reader_frequency_1                     | 10                               |
| telemetry.metrics_reader_frequency_2                     | 60                               |
| telemetry.metrics_reader_frequency_3                     | 0                                |
| telemetry.otel_bsp_max_export_batch_size                 | 512                              |
| telemetry.otel_bsp_max_queue_size                        | 2048                             |
| telemetry.otel_bsp_schedule_delay                        | 5000                             |
| telemetry.otel_exporter_otlp_metrics_certificates        |                                  |
| telemetry.otel_exporter_otlp_metrics_cipher              |                                  |
| telemetry.otel_exporter_otlp_metrics_cipher_suite        |                                  |
| telemetry.otel_exporter_otlp_metrics_client_certificates |                                  |
| telemetry.otel_exporter_otlp_metrics_client_key          |                                  |
| telemetry.otel_exporter_otlp_metrics_compression         | none                             |
| telemetry.otel_exporter_otlp_metrics_endpoint            | http://localhost:4318/v1/metrics |
| telemetry.otel_exporter_otlp_metrics_headers             |                                  |
| telemetry.otel_exporter_otlp_metrics_max_tls             |                                  |
| telemetry.otel_exporter_otlp_metrics_min_tls             |                                  |
| telemetry.otel_exporter_otlp_metrics_protocol            | http/protobuf                    |
| telemetry.otel_exporter_otlp_metrics_timeout             | 10000                            |
| telemetry.otel_exporter_otlp_traces_certificates         |                                  |
| telemetry.otel_exporter_otlp_traces_cipher               |                                  |
| telemetry.otel_exporter_otlp_traces_cipher_suite         |                                  |
| telemetry.otel_exporter_otlp_traces_client_certificates  |                                  |
| telemetry.otel_exporter_otlp_traces_client_key           |                                  |
| telemetry.otel_exporter_otlp_traces_compression          | none                             |
| telemetry.otel_exporter_otlp_traces_endpoint             | http://localhost:4318/v1/traces  |
| telemetry.otel_exporter_otlp_traces_headers              |                                  |
| telemetry.otel_exporter_otlp_traces_max_tls              |                                  |
| telemetry.otel_exporter_otlp_traces_min_tls              |                                  |
| telemetry.otel_exporter_otlp_traces_protocol             | http/protobuf                    |
| telemetry.otel_exporter_otlp_traces_timeout              | 10000                            |
| telemetry.otel_log_level                                 | info                             |
| telemetry.otel_resource_attributes                       |                                  |
| telemetry.query_text_enabled                             | ON                               |
| telemetry.trace_enabled                                  | ON                               |
+----------------------------------------------------------+----------------------------------+
        

请参阅 服务器配置。See Server Configuration.

安装客户端插件Installing Client Plugin

MySQL 客户端的 Telemetry 插件可以通过命令行开关 --telemetry_client 启用,或者通过配置选项 telemetry-client=ON |OFF 在配置文件的 [mysql] 部分中定义来启用。The Telemetry plugin for the MySQL client can be enabled with a command line switch, --telemetry_client or from a configuration option, telemetry-client=ON |OFF, defined in the [mysql] section of the configuration file.