MySQL 8.4 版本說明
本節說明伺服器和用戶端 OpenTelemetry 支援的安裝。
若要安裝伺服器元件,請執行下列命令
install component 'file://component_telemetry';
若要確認元件是否存在於您的伺服器中,請執行下列查詢
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
欄中,則表示已安裝該元件。
元件安裝也會新增遙測專屬的系統變數。
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 | https://127.0.0.1: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 | https://127.0.0.1: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 |
+----------------------------------------------------------+----------------------------------+
請參閱伺服器設定。
MySQL 用戶端的遙測外掛程式可以使用命令列參數 --telemetry_client
或設定選項 telemetry-client=ON |OFF
來啟用,該設定選項定義在設定檔的 [mysql]
區段中。