24#ifndef MYSQL_TELEMETRY_LOGS_CLIENT_H
25#define MYSQL_TELEMETRY_LOGS_CLIENT_H
39#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
44#ifndef PSI_LOGS_CLIENT_CALL
45#define PSI_LOGS_CLIENT_CALL(M) \
46 SERVICE_PLACEHOLDER(mysql_server_telemetry_logs_client)->M
59#define mysql_log_client_register(P1, P2, P3) \
60 inline_mysql_log_client_register(P1, P2, P3)
64 const char *
category [[maybe_unused]]) {
65#ifdef HAVE_PSI_SERVER_TELEMETRY_LOGS_INTERFACE
74#define mysql_log_client_unregister(P1, P2) \
75 inline_mysql_log_client_unregister(P1, P2)
81#ifdef HAVE_PSI_SERVER_TELEMETRY_LOGS_INTERFACE
90#define mysql_log_client_check_enabled(P1, P2) \
91 inline_mysql_log_client_check_enabled(P1, P2)
95#ifdef HAVE_PSI_SERVER_TELEMETRY_LOGS_INTERFACE
106#define mysql_log_client_log(P1, P2, P3, P4, P5, P6) \
107 inline_mysql_log_client_log(P1, P2, P3, P4, P5, P6)
111 const char *message [[maybe_unused]], time_t
timestamp [[maybe_unused]],
113 size_t attr_count [[maybe_unused]]) {
114#ifdef HAVE_PSI_SERVER_TELEMETRY_LOGS_INTERFACE
184 void error(
const char *message)
const {
191 void warn(
const char *message)
const {
198 void info(
const char *message)
const {
205 void debug(
const char *message)
const {
C++ wrapper for emitting a telemetry log record.
Definition: mysql_telemetry_logs_client.h:126
PSI_logger_key m_logger_key
Definition: mysql_telemetry_logs_client.h:168
OTELLogLevel m_level
Definition: mysql_telemetry_logs_client.h:169
void add_attribute_bool(const char *name, bool value)
Definition: mysql_telemetry_logs_client.h:135
size_t m_attr_count
Definition: mysql_telemetry_logs_client.h:172
void add_attribute_string_view(const char *name, const char *value, size_t len)
Definition: mysql_telemetry_logs_client.h:145
PSI_logger * m_psi
Definition: mysql_telemetry_logs_client.h:167
PSI_LogRecord(PSI_logger_key key, OTELLogLevel level, const char *message)
Definition: mysql_telemetry_logs_client.h:128
const char * m_message
Definition: mysql_telemetry_logs_client.h:170
void add_attribute_string(const char *name, const char *value)
Definition: mysql_telemetry_logs_client.h:140
void add_attribute_uint64(const char *name, uint64_t value)
Definition: mysql_telemetry_logs_client.h:156
log_attribute_t m_attrs[MAX_LOG_ATTRIBUTES]
Definition: mysql_telemetry_logs_client.h:171
void add_attribute_double(const char *name, double value)
Definition: mysql_telemetry_logs_client.h:151
void emit()
Definition: mysql_telemetry_logs_client.h:161
bool check_enabled() const
Definition: mysql_telemetry_logs_client.h:133
C++ wrapper for emitting one or more simple (no attributes) telemetry log records.
Definition: mysql_telemetry_logs_client.h:180
void warn(const char *message) const
Definition: mysql_telemetry_logs_client.h:191
void debug(const char *message) const
Definition: mysql_telemetry_logs_client.h:205
void info(const char *message) const
Definition: mysql_telemetry_logs_client.h:198
PSI_SimpleLogger(PSI_logger_key key)
Definition: mysql_telemetry_logs_client.h:182
void error(const char *message) const
Definition: mysql_telemetry_logs_client.h:184
PSI_logger_key m_logger_key
Definition: mysql_telemetry_logs_client.h:213
static void inline_mysql_log_client_log(PSI_logger *logger, OTELLogLevel level, const char *message, time_t timestamp, const log_attribute_t *attr_array, size_t attr_count)
Definition: mysql_telemetry_logs_client.h:109
static void inline_mysql_log_client_unregister(PSI_logger_info_v1 *info, size_t count)
Definition: mysql_telemetry_logs_client.h:77
static void inline_mysql_log_client_register(PSI_logger_info_v1 *info, size_t count, const char *category)
Definition: mysql_telemetry_logs_client.h:62
static PSI_logger * inline_mysql_log_client_check_enabled(PSI_logger_key key, OTELLogLevel level)
Definition: mysql_telemetry_logs_client.h:93
#define mysql_log_client_check_enabled(P1, P2)
Logger client check if log level is enabled for this logger.
Definition: mysql_telemetry_logs_client.h:90
#define mysql_log_client_log(P1, P2, P3, P4, P5, P6)
Emit log record.
Definition: mysql_telemetry_logs_client.h:106
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
static int count
Definition: myisam_ftdump.cc:45
constexpr value_type timestamp
Definition: classic_protocol_constants.h:278
static const char * category
Definition: sha2_password.cc:170
static Logger logger
The "top-level" logger used when no connection context is given.
Definition: test_trace_plugin.cc:296
Performance schema instrumentation (declarations).
#define PSI_LOGS_CLIENT_CALL(M)
Definition: pfs_telemetry_logs_client_provider.h:45
required string key
Definition: replication_asynchronous_connection_failover.proto:60
constexpr size_t MAX_LOG_ATTRIBUTES
Definition: server_telemetry_logs_client_bits.h:48
OTELLogLevel
Log levels as supported by opentelemetry-cpp (+ "none"), see: api/include/opentelemetry/logs/severity...
Definition: server_telemetry_logs_client_bits.h:43
@ TLOG_DEBUG
Definition: server_telemetry_logs_client_bits.h:43
@ TLOG_WARN
Definition: server_telemetry_logs_client_bits.h:43
@ TLOG_INFO
Definition: server_telemetry_logs_client_bits.h:43
unsigned int PSI_logger_key
Definition: server_telemetry_logs_client_bits.h:45
case opt name
Definition: sslopt-case.h:29
Defines a logger from the side of instrumented code (log API client).
Definition: server_telemetry_logs_client_bits.h:57
Definition: server_telemetry_attribute_bits.h:57
void set_double(const char *attr_name, double v)
Definition: server_telemetry_attribute_bits.h:92
void set_string(const char *attr_name, const char *v)
Definition: server_telemetry_attribute_bits.h:98
void set_string_view(const char *attr_name, const char *v, size_t len)
Definition: server_telemetry_attribute_bits.h:104
void set_bool(const char *attr_name, bool v)
Definition: server_telemetry_attribute_bits.h:62
void set_uint64(const char *attr_name, uint64_t v)
Definition: server_telemetry_attribute_bits.h:86