MySQL 9.1.0
Source Code Documentation
server_telemetry_logs_bits.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 2024 Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef SERVER_TELEMETRY_LOGS_BITS_H
25#define SERVER_TELEMETRY_LOGS_BITS_H
26
27#include <time.h> // time_t
28#include <cstddef> // size_t
29#include <cstdint> // uint64_t
30
32
33typedef void (*log_delivery_callback_t)(const char *logger_name,
34 OTELLogLevel severity,
35 const char *message, time_t timestamp,
36 const log_attribute_t *attr_array,
37 size_t attr_count);
38
39/**
40 Register telemetry logger callback.
41
42 @param logger pointer to callback function to be registered.
43 @retval FALSE: success
44 @retval TRUE: failure
45*/
47
48/**
49 Unregister telemetry logger callback.
50
51 @param logger pointer to callback function to be unregistered.
52 @retval FALSE: success
53 @retval TRUE: failure
54*/
57
58/**
59 Wrapper method to notify telemetry logger callback (if registered) of new log
60 event.
61*/
63 PSI_logger *logger, OTELLogLevel level, const char *message,
64 time_t timestamp, const log_attribute_t *attr_array, size_t attr_count);
65
66#endif /* SERVER_TELEMETRY_LOGS_BITS_H */
constexpr value_type timestamp
Definition: classic_protocol_constants.h:278
static Logger logger
The "top-level" logger used when no connection context is given.
Definition: test_trace_plugin.cc:296
bool(* register_telemetry_logger_v1_t)(log_delivery_callback_t logger)
Register telemetry logger callback.
Definition: server_telemetry_logs_bits.h:46
bool(* unregister_telemetry_logger_v1_t)(log_delivery_callback_t logger)
Unregister telemetry logger callback.
Definition: server_telemetry_logs_bits.h:55
void(* notify_telemetry_logger_v1_t)(PSI_logger *logger, OTELLogLevel level, const char *message, time_t timestamp, const log_attribute_t *attr_array, size_t attr_count)
Wrapper method to notify telemetry logger callback (if registered) of new log event.
Definition: server_telemetry_logs_bits.h:62
void(* log_delivery_callback_t)(const char *logger_name, OTELLogLevel severity, const char *message, time_t timestamp, const log_attribute_t *attr_array, size_t attr_count)
Definition: server_telemetry_logs_bits.h:33
OTELLogLevel
Log levels as supported by opentelemetry-cpp (+ "none"), see: api/include/opentelemetry/logs/severity...
Definition: server_telemetry_logs_client_bits.h:43
Definition: server_telemetry_attribute_bits.h:57
Include file for Sun RPC to compile out of the box.