MySQL 9.7.0
Source Code Documentation
tm_propagation.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2022, 2026, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef TELEMETRY_PROPAGATION_H_INCLUDED
27#define TELEMETRY_PROPAGATION_H_INCLUDED
28
29#include <opentelemetry/context/propagation/text_map_propagator.h>
30#include <opentelemetry/trace/propagation/http_trace_context.h>
31
33
35
36namespace telemetry {
37
39 : public opentelemetry::context::propagation::TextMapCarrier {
40 public:
42
44
45 opentelemetry::nostd::string_view Get(
46 opentelemetry::nostd::string_view key) const noexcept override;
47
48 void Set(opentelemetry::nostd::string_view key,
49 opentelemetry::nostd::string_view value) noexcept override;
50
51 bool Keys(opentelemetry::nostd::function_ref<
52 bool(opentelemetry::nostd::string_view)>
53 callback) const noexcept override;
54
55 private:
57
58 /*
59 Keeps all keys seen,
60 so that Get() can return a string_view.
61 Pointer because Get() is const.
62 */
63 std::vector<my_h_string> *m_seen;
64};
65
67 : public opentelemetry::trace::propagation::HttpTraceContext {};
68
69} // namespace telemetry
70
71#endif /* TELEMETRY_PROPAGATION_H_INCLUDED */
#define MYSQL_THD
Definition: backup_page_tracker.h:38
Definition: tm_propagation.h:39
QueryAttributeTextMapCarrier(MYSQL_THD thd)
Definition: tm_propagation.cc:31
bool Keys(opentelemetry::nostd::function_ref< bool(opentelemetry::nostd::string_view)> callback) const noexcept override
Definition: tm_propagation.cc:128
void Set(opentelemetry::nostd::string_view key, opentelemetry::nostd::string_view value) noexcept override
Definition: tm_propagation.cc:122
std::vector< my_h_string > * m_seen
Definition: tm_propagation.h:63
~QueryAttributeTextMapCarrier() override
Definition: tm_propagation.cc:37
MYSQL_THD m_thd
Definition: tm_propagation.h:56
opentelemetry::nostd::string_view Get(opentelemetry::nostd::string_view key) const noexcept override
Definition: tm_propagation.cc:45
Definition: tm_propagation.h:67
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
Definition: option_usage.cc:40
required string key
Definition: replication_asynchronous_connection_failover.proto:60