Skip to content

Commit 2b20acb

Browse files
committed
WL#15201: PERFORMANCE_SCHEMA, OTEL INTERFACE: LOG
Description: ----------- This WL implements core part of the server telemetry logging feature with the following deliverables: * Service definition for log exporter: mysql_server_telemetry_logs * Implementation of mysql_server_telemetry_logs in performance schema * Added setup_loggers performance schema table * Service definition for log clients: mysql_server_telemetry_logs_client * Implementation of mysql_server_telemetry_logs_client in performance schema * C++ wrappers for client API to simplify log instrumentation * Instrument MySQL error logging code to also emit telemetry log records * Test components (test_server_telemetry_logs_{export,client}) using services to test the feature Change-Id: I875ab7b04ad7e7d280875c3862ec1a325fd6a48c
1 parent 3ecc8b5 commit 2b20acb

File tree

125 files changed

+5013
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+5013
-143
lines changed

Doxyfile.in

+1
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@ RECURSIVE = YES
10241024
EXCLUDE = cmd-line-utils \
10251025
client/mysqlbinlog.cc \
10261026
components/test \
1027+
components/test_server_telemetry_logs \
10271028
components/test_server_telemetry_metrics \
10281029
components/test_server_telemetry_traces \
10291030
extra \

components/keyrings/common/component_helpers/include/keyring_log_builtins_definition.h

+4
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ class Log_builtins_keyring {
109109
return LOG_SERVICE_NOTHING_DONE;
110110
}
111111
static DEFINE_METHOD(int, message, (int, ...)) { return 0; }
112+
static DEFINE_METHOD(void, line_set_flag,
113+
(log_line *, log_line_flags_mask, log_line_flags_mask)) {
114+
}
112115

113116
/* log_builtins_string */
114117
static DEFINE_METHOD(char *, find_first, (const char *, int)) {
@@ -184,6 +187,7 @@ class Log_builtins_keyring {
184187
item_set_lexstring, \
185188
keyring_common::service_definition::Log_builtins_keyring:: \
186189
item_set_cstring, \
190+
keyring_common::service_definition::Log_builtins_keyring::line_set_flag, \
187191
keyring_common::service_definition::Log_builtins_keyring:: \
188192
item_set_with_key, \
189193
keyring_common::service_definition::Log_builtins_keyring::item_set, \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License, version 2.0,
5+
# as published by the Free Software Foundation.
6+
#
7+
# This program is also distributed with certain software (including
8+
# but not limited to OpenSSL) that is licensed under separate terms,
9+
# as designated in a particular file or component or in included license
10+
# documentation. The authors of MySQL hereby grant you an additional
11+
# permission to link the program and your derivative works with the
12+
# separately licensed software that they have included with MySQL.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License, version 2.0, for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program; if not, write to the Free Software
21+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22+
23+
DISABLE_MISSING_PROFILE_WARNING()
24+
25+
MYSQL_ADD_COMPONENT(test_server_telemetry_logs_client
26+
server_logs_component.cc
27+
server_logs_helpers.cc
28+
MODULE_ONLY
29+
TEST_ONLY
30+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* Copyright (c) 2023, 2024 Oracle and/or its affiliates.
2+
3+
This program is free software; you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License, version 2.0,
5+
as published by the Free Software Foundation.
6+
7+
This program is also distributed with certain software (including
8+
but not limited to OpenSSL) that is licensed under separate terms,
9+
as designated in a particular file or component or in included license
10+
documentation. The authors of MySQL hereby grant you an additional
11+
permission to link the program and your derivative works with the
12+
separately licensed software that they have included with MySQL.
13+
14+
This program is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License, version 2.0, for more details.
18+
19+
You should have received a copy of the GNU General Public License
20+
along with this program; if not, write to the Free Software
21+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22+
23+
#ifndef TEST_SERVER_LOGS_REQUIRED_SERVICES_INCLUDED
24+
#define TEST_SERVER_LOGS_REQUIRED_SERVICES_INCLUDED
25+
26+
#include <mysql/components/component_implementation.h>
27+
#include <mysql/components/service_implementation.h>
28+
#include <mysql/components/services/log_builtins.h>
29+
#include <mysql/components/services/mysql_server_telemetry_logs_client_service.h>
30+
#include <mysql/components/services/udf_registration.h>
31+
32+
/* A place to specify component-wide declarations, including declarations of
33+
* placeholders for Service dependencies. */
34+
35+
extern REQUIRES_SERVICE_PLACEHOLDER(log_builtins);
36+
extern REQUIRES_SERVICE_PLACEHOLDER(log_builtins_string);
37+
extern REQUIRES_SERVICE_PLACEHOLDER_AS(udf_registration, udf_registration_srv);
38+
extern REQUIRES_SERVICE_PLACEHOLDER(mysql_server_telemetry_logs_client);
39+
40+
#endif /* TEST_SERVER_LOGS_REQUIRED_SERVICES_INCLUDED */

0 commit comments

Comments
 (0)