Skip to content

Commit 83926c7

Browse files
committed
WL#15199: PERFORMANCE_SCHEMA, OTEL METRICS INTERFACE
Description: ----------- This WL implements core part of the server telemetry metrics feature with the following deliverables: * Definition of service to instrument metrics (pfs_metrics_v1) * Implementation of pfs_metrics_v1 in the performance schema * Added setup_meter and setup_metrics performance schema tables * Code base instrumentation using pfs_metrics_v1 to expose metrics: - from status variables in core server - from status variables in innodb storage engine - from status variables in X plugin - custom metrics from health monitor component * Service definition for metric exporter (mysql_server_telemetry_metrics_v1) * Implementation of this interface in a server component * A test component (test_server_telemetry_metrics) using the service to test the feature Approved by: Marc Alff <marc.alff@oracle.com> Approved by: Chris Powers <chris.powers@oracle.com> Approved by: Kuba Łopuszański <jakub.lopuszanski@oracle.com> Approved by: Jan Kneschke <jan.kneschke@oracle.com> Approved by: Lukasz Kotula <lukasz.kotula@oracle.com> Change-Id: I7d3a9e1dbdb6fe0c275e565abafdae296aaba077
1 parent 5cd86e6 commit 83926c7

File tree

163 files changed

+10791
-56
lines changed

Some content is hidden

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

163 files changed

+10791
-56
lines changed

Doxyfile.in

+1
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,7 @@ RECURSIVE = YES
10231023
EXCLUDE = cmd-line-utils \
10241024
client/mysqlbinlog.cc \
10251025
components/test \
1026+
components/test_server_telemetry_metrics \
10261027
components/test_server_telemetry_traces \
10271028
extra \
10281029
generated \

cmake/abi_check.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ IF(NOT WITHOUT_SERVER)
7474
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_memory_v1.h
7575
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_error_v1.h
7676
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_system_v1.h
77+
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_metric_v1.h
7778
${CMAKE_SOURCE_DIR}/include/mysql/services.h
7879
)
7980
ENDIF()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2022, 2023, 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_metrics
26+
server_metrics_component.cc
27+
server_metrics_helpers.cc
28+
MODULE_ONLY
29+
TEST_ONLY
30+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Copyright (c) 2022, 2023, 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_METRICS_REQUIRED_SERVICES_INCLUDED
24+
#define TEST_SERVER_METRICS_REQUIRED_SERVICES_INCLUDED
25+
26+
#include <mysql/components/component_implementation.h>
27+
#include <mysql/components/service_implementation.h>
28+
#include <mysql/components/services/mysql_server_telemetry_metrics_service.h>
29+
#include <mysql/components/services/psi_metric.h>
30+
#include <mysql/components/services/udf_registration.h>
31+
#include <mysql/psi/mysql_metric.h>
32+
33+
/* A place to specify component-wide declarations, including declarations of
34+
* placeholders for Service dependencies. */
35+
36+
extern REQUIRES_SERVICE_PLACEHOLDER_AS(mysql_server_telemetry_metrics_v1,
37+
metrics_v1_srv);
38+
extern REQUIRES_SERVICE_PLACEHOLDER_AS(udf_registration, udf_registration_srv);
39+
extern REQUIRES_SERVICE_PLACEHOLDER_AS(mysql_string_factory,
40+
string_factory_srv);
41+
extern REQUIRES_SERVICE_PLACEHOLDER_AS(mysql_string_converter,
42+
string_converter_srv);
43+
extern REQUIRES_PSI_METRIC_SERVICE_PLACEHOLDER;
44+
45+
#endif /* TEST_SERVER_METRICS_REQUIRED_SERVICES_INCLUDED */

0 commit comments

Comments
 (0)