Skip to content

[EXPORTER] Allow to share gRPC clients between OTLP exporters #3041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
213e3cf
Allow to share gRPC clients between OTLP exporters.
owent Aug 29, 2024
5c5f9b7
Add changelog, fix compiling problems without async
owent Aug 29, 2024
37e5081
gRPC depends abseil-cp, so we always enable abseil-cpp when have `WIT…
owent Aug 29, 2024
c9cb2df
Fix linking error
owent Aug 29, 2024
0d409d4
Share `grpc::Channel`
owent Aug 30, 2024
cd80d19
Fix compiling error
owent Aug 30, 2024
ad722f4
Make `OtlpGrpcClientReferenceGuard` always available
owent Aug 30, 2024
f4521f3
Try to cancel running requests when shutdown timeout
owent Aug 30, 2024
38860d3
Modify `running_calls` do not depends the thread for gRPC callback.
owent Aug 30, 2024
b5daf3f
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Sep 6, 2024
8e9d300
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Sep 9, 2024
51e0964
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Sep 12, 2024
40ca747
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Sep 18, 2024
b2aa191
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
marcalff Sep 23, 2024
3547800
Allow to share gRPC Client in sync mode
owent Sep 25, 2024
ef62bc0
Fix shutdown in sync mode
owent Sep 25, 2024
caa1743
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
marcalff Oct 1, 2024
949c679
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
marcalff Oct 7, 2024
e1e6627
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Oct 8, 2024
74ceb64
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
lalitb Oct 8, 2024
d5bb715
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Oct 9, 2024
c9419bf
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Oct 14, 2024
d4b0286
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Oct 16, 2024
72e4cb3
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Oct 18, 2024
edd0c16
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Oct 22, 2024
3ff6e4b
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Oct 24, 2024
829294e
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Oct 24, 2024
94260b3
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
ThomsonTan Oct 29, 2024
4367e62
Change unique_ptr and shared_ptr from `nostd::` to `std::`. Change th…
owent Oct 30, 2024
e2b23aa
Fix includes
owent Oct 30, 2024
5142036
Do not inline otabsl to avoid namespace conflicts
owent Oct 30, 2024
d7266aa
Fix markdown lint
owent Oct 30, 2024
603e2fa
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Nov 1, 2024
adcf88e
Merge remote-tracking branch 'github/main' into allow_construct_grpc_…
owent Nov 5, 2024
b71c655
Add internal logs when shutdown gRPC Client
owent Nov 6, 2024
1145003
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
owent Nov 8, 2024
4d4d3a5
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
marcalff Nov 13, 2024
fe30625
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
marcalff Nov 13, 2024
7b2f29e
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
marcalff Nov 14, 2024
62756bd
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_…
ThomsonTan Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Increment the:
* [SEMANTIC CONVENTIONS] Migration to weaver
[#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)

* [EXPORTER] Allow to share gRPC clients between OTLP exporters.
[#3041](https://github.com/open-telemetry/opentelemetry-cpp/pull/3041)

Important changes:

* [API] Jaeger Propagator should not be deprecated
Expand Down
10 changes: 2 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,8 @@ if(WITH_OTLP_GRPC
OR WITH_OTLP_HTTP
OR WITH_OTLP_FILE)
find_package(Protobuf)
if(Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
if(NOT WITH_ABSEIL)
message(
FATAL_ERROR
"Protobuf 3.22 or upper require abseil-cpp(Recommended version: 20230125 or upper)"
)
endif()
endif()
# Protobuf 3.22 or upper require abseil-cpp, we can find it in
# opentelemetry-cpp-config.cmake

if(WITH_OTLP_GRPC)
find_package(gRPC)
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/nostd/internal/absl/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Notes on Abseil Variant implementation

This is a snapshot of Abseil Variant `absl::variant` from Abseil
`v2020-03-03#8`.
This is a snapshot of Abseil Variant
`absl::OTABSL_OPTION_NAMESPACE_NAME::variant` from Abseil `v2020-03-03#8`.
43 changes: 15 additions & 28 deletions api/include/opentelemetry/nostd/internal/absl/base/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
// namespace absl {
// OTABSL_NAMESPACE_BEGIN
//
// void Foo(); // absl::Foo().
// void Foo(); // absl::OTABSL_OPTION_NAMESPACE_NAME::Foo().
//
// OTABSL_NAMESPACE_END
// } // namespace absl
Expand All @@ -94,40 +94,32 @@
// not support forward declarations of its own types, nor does it support
// user-provided specialization of Abseil templates. Code that violates these
// rules may be broken without warning.)
#if !defined(OTABSL_OPTION_USE_INLINE_NAMESPACE) || \
!defined(OTABSL_OPTION_INLINE_NAMESPACE_NAME)
#if !defined(OTABSL_OPTION_NAMESPACE_NAME)
#error options.h is misconfigured.
#endif

// Check that OTABSL_OPTION_INLINE_NAMESPACE_NAME is neither "head" nor ""
#if defined(__cplusplus) && OTABSL_OPTION_USE_INLINE_NAMESPACE == 1
// Check that OTABSL_OPTION_NAMESPACE_NAME is neither "head" nor ""
#if defined(__cplusplus)

#define OTABSL_INTERNAL_INLINE_NAMESPACE_STR \
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_INLINE_NAMESPACE_NAME)
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_NAMESPACE_NAME)

static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != '\0',
"options.h misconfigured: OTABSL_OPTION_INLINE_NAMESPACE_NAME must "
"options.h misconfigured: OTABSL_OPTION_NAMESPACE_NAME must "
"not be empty.");
static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[1] != 'e' ||
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[2] != 'a' ||
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[3] != 'd' ||
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[4] != '\0',
"options.h misconfigured: OTABSL_OPTION_INLINE_NAMESPACE_NAME must "
"options.h misconfigured: OTABSL_OPTION_NAMESPACE_NAME must "
"be changed to a new, unique identifier name.");

#endif

#if OTABSL_OPTION_USE_INLINE_NAMESPACE == 0
#define OTABSL_NAMESPACE_BEGIN
#define OTABSL_NAMESPACE_END
#elif OTABSL_OPTION_USE_INLINE_NAMESPACE == 1
#define OTABSL_NAMESPACE_BEGIN \
inline namespace OTABSL_OPTION_INLINE_NAMESPACE_NAME {

#define OTABSL_NAMESPACE_BEGIN namespace OTABSL_OPTION_NAMESPACE_NAME {
#define OTABSL_NAMESPACE_END }
#else
#error options.h is misconfigured.
#endif

// -----------------------------------------------------------------------------
// Compiler Feature Checks
Expand Down Expand Up @@ -217,7 +209,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||

// OTABSL_HAVE_SOURCE_LOCATION_CURRENT
//
// Indicates whether `absl::SourceLocation::current()` will return useful
// Indicates whether `absl::OTABSL_OPTION_NAMESPACE_NAME::SourceLocation::current()` will return useful
// information in some contexts.
#ifndef OTABSL_HAVE_SOURCE_LOCATION_CURRENT
#if OTABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \
Expand Down Expand Up @@ -570,7 +562,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||

// OTABSL_USES_STD_ANY
//
// Indicates whether absl::any is an alias for std::any.
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::any is an alias for std::any.
#if !defined(OTABSL_OPTION_USE_STD_ANY)
#error options.h is misconfigured.
#elif OTABSL_OPTION_USE_STD_ANY == 0 || \
Expand All @@ -585,7 +577,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||

// OTABSL_USES_STD_OPTIONAL
//
// Indicates whether absl::optional is an alias for std::optional.
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::optional is an alias for std::optional.
#if !defined(OTABSL_OPTION_USE_STD_OPTIONAL)
#error options.h is misconfigured.
#elif OTABSL_OPTION_USE_STD_OPTIONAL == 0 || \
Expand All @@ -600,7 +592,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||

// OTABSL_USES_STD_VARIANT
//
// Indicates whether absl::variant is an alias for std::variant.
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::variant is an alias for std::variant.
#if !defined(OTABSL_OPTION_USE_STD_VARIANT)
#error options.h is misconfigured.
#elif OTABSL_OPTION_USE_STD_VARIANT == 0 || \
Expand All @@ -615,7 +607,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||

// OTABSL_USES_STD_STRING_VIEW
//
// Indicates whether absl::string_view is an alias for std::string_view.
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::string_view is an alias for std::string_view.
#if !defined(OTABSL_OPTION_USE_STD_STRING_VIEW)
#error options.h is misconfigured.
#elif OTABSL_OPTION_USE_STD_STRING_VIEW == 0 || \
Expand Down Expand Up @@ -650,15 +642,10 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// the proper count to skip past the CCTZ fork namespace names. (This number
// is one larger when there is an inline namespace name to skip.)
#if defined(_MSC_VER)
#if OTABSL_OPTION_USE_INLINE_NAMESPACE == 0
#define OTABSL_INTERNAL_MANGLED_NS "absl"
#define OTABSL_INTERNAL_MANGLED_BACKREFERENCE "5"
#else
#define OTABSL_INTERNAL_MANGLED_NS \
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_INLINE_NAMESPACE_NAME) "@absl"
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_NAMESPACE_NAME) "@absl"
#define OTABSL_INTERNAL_MANGLED_BACKREFERENCE "6"
#endif
#endif

#undef OTABSL_INTERNAL_HAS_KEYWORD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
// types, etc..
#if defined(__clang__)
#define OTABSL_INTERNAL_EXTERN_DECL(type, name) \
extern const ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<type> name;
extern const ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<type> name;
#else // Otherwise, just define the macro to do nothing.
#define OTABSL_INTERNAL_EXTERN_DECL(type, name)
#endif // defined(__clang__)

// See above comment at top of file for details.
#define OTABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) \
OTABSL_INTERNAL_EXTERN_DECL(type, name) \
inline constexpr ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<type> name = init
inline constexpr ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<type> name = init

#else

Expand All @@ -89,14 +89,14 @@
#define OTABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \
template <class /*AbslInternalDummy*/ = void> \
struct AbslInternalInlineVariableHolder##name { \
static constexpr ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<var_type> kInstance = init; \
static constexpr ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<var_type> kInstance = init; \
}; \
\
template <class AbslInternalDummy> \
constexpr ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<var_type> \
constexpr ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<var_type> \
AbslInternalInlineVariableHolder##name<AbslInternalDummy>::kInstance; \
\
static constexpr const ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<var_type>& \
static constexpr const ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<var_type>& \
name = /* NOLINT */ \
AbslInternalInlineVariableHolder##name<>::kInstance; \
static_assert(sizeof(void (*)(decltype(name))) != 0, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// absl::base_internal::Invoke(f, args...) is an implementation of
// absl::OTABSL_OPTION_NAMESPACE_NAME::base_internal::Invoke(f, args...) is an implementation of
// INVOKE(f, args...) from section [func.require] of the C++ standard.
//
// [func.require]
Expand Down Expand Up @@ -73,7 +73,7 @@ struct MemFunAndRef : StrippedAccept<MemFunAndRef> {
template <typename MemFunType, typename C, typename Obj, typename... Args>
struct AcceptImpl<MemFunType C::*, Obj, Args...>
: std::integral_constant<bool, std::is_base_of<C, Obj>::value &&
absl::is_function<MemFunType>::value> {
absl::OTABSL_OPTION_NAMESPACE_NAME::is_function<MemFunType>::value> {
};

template <typename MemFun, typename Obj, typename... Args>
Expand All @@ -94,7 +94,7 @@ struct MemFunAndPtr : StrippedAccept<MemFunAndPtr> {
template <typename MemFunType, typename C, typename Ptr, typename... Args>
struct AcceptImpl<MemFunType C::*, Ptr, Args...>
: std::integral_constant<bool, !std::is_base_of<C, Ptr>::value &&
absl::is_function<MemFunType>::value> {
absl::OTABSL_OPTION_NAMESPACE_NAME::is_function<MemFunType>::value> {
};

template <typename MemFun, typename Ptr, typename... Args>
Expand All @@ -116,7 +116,7 @@ struct DataMemAndRef : StrippedAccept<DataMemAndRef> {
template <typename R, typename C, typename Obj>
struct AcceptImpl<R C::*, Obj>
: std::integral_constant<bool, std::is_base_of<C, Obj>::value &&
!absl::is_function<R>::value> {};
!absl::OTABSL_OPTION_NAMESPACE_NAME::is_function<R>::value> {};

template <typename DataMem, typename Ref>
static decltype(std::declval<Ref>().*std::declval<DataMem>()) Invoke(
Expand All @@ -134,7 +134,7 @@ struct DataMemAndPtr : StrippedAccept<DataMemAndPtr> {
template <typename R, typename C, typename Ptr>
struct AcceptImpl<R C::*, Ptr>
: std::integral_constant<bool, !std::is_base_of<C, Ptr>::value &&
!absl::is_function<R>::value> {};
!absl::OTABSL_OPTION_NAMESPACE_NAME::is_function<R>::value> {};

template <typename DataMem, typename Ptr>
static decltype((*std::declval<Ptr>()).*std::declval<DataMem>()) Invoke(
Expand Down
8 changes: 4 additions & 4 deletions api/include/opentelemetry/nostd/internal/absl/base/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// can be used in defining new arrays. If you use this macro on a pointer by
// mistake, you will get a compile-time error.
#define OTABSL_ARRAYSIZE(array) \
(sizeof(::absl::macros_internal::ArraySizeHelper(array)))
(sizeof(::absl::OTABSL_OPTION_NAMESPACE_NAME::macros_internal::ArraySizeHelper(array)))

namespace absl {
OTABSL_NAMESPACE_BEGIN
Expand All @@ -60,7 +60,7 @@ OTABSL_NAMESPACE_END
// static storage duration, and that the constructor should do nothing to its
// state. Use of this macro indicates to the reader that it is legal to
// declare a static instance of the class, provided the constructor is given
// the absl::base_internal::kLinkerInitialized argument.
// the absl::OTABSL_OPTION_NAMESPACE_NAME::base_internal::kLinkerInitialized argument.
//
// Normally, it is unsafe to declare a static variable that has a constructor or
// a destructor because invocation order is undefined. However, if the type can
Expand All @@ -70,10 +70,10 @@ OTABSL_NAMESPACE_END
//
// Example:
// // Declaration
// explicit MyClass(absl::base_internal:LinkerInitialized x) {}
// explicit MyClass(absl::OTABSL_OPTION_NAMESPACE_NAME::base_internal:LinkerInitialized x) {}
//
// // Invocation
// static MyClass my_global(absl::base_internal::kLinkerInitialized);
// static MyClass my_global(absl::OTABSL_OPTION_NAMESPACE_NAME::base_internal::kLinkerInitialized);
namespace absl {
OTABSL_NAMESPACE_BEGIN
namespace base_internal {
Expand Down
50 changes: 16 additions & 34 deletions api/include/opentelemetry/nostd/internal/absl/base/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
//
// OTABSL_OPTION_USE_STD_ANY
//
// This option controls whether absl::any is implemented as an alias to
// This option controls whether absl::OTABSL_OPTION_NAMESPACE_NAME::any is implemented as an alias to
// std::any, or as an independent implementation.
//
// A value of 0 means to use Abseil's implementation. This requires only C++11
Expand All @@ -93,19 +93,19 @@
// useful when you are building your entire program, including all of its
// dependencies, from source. It should not be used otherwise -- for example,
// if you are distributing Abseil in a binary package manager -- since in
// mode 2, absl::any will name a different type, with a different mangled name
// mode 2, absl::OTABSL_OPTION_NAMESPACE_NAME::any will name a different type, with a different mangled name
// and binary layout, depending on the compiler flags passed by the end user.
// For more info, see https://abseil.io/about/design/dropin-types.
//
// User code should not inspect this macro. To check in the preprocessor if
// absl::any is a typedef of std::any, use the feature macro OTABSL_USES_STD_ANY.
// absl::OTABSL_OPTION_NAMESPACE_NAME::any is a typedef of std::any, use the feature macro OTABSL_USES_STD_ANY.

#define OTABSL_OPTION_USE_STD_ANY 0


// OTABSL_OPTION_USE_STD_OPTIONAL
//
// This option controls whether absl::optional is implemented as an alias to
// This option controls whether absl::OTABSL_OPTION_NAMESPACE_NAME::optional is implemented as an alias to
// std::optional, or as an independent implementation.
//
// A value of 0 means to use Abseil's implementation. This requires only C++11
Expand All @@ -118,21 +118,21 @@
// and use an alias only if a working std::optional is available. This option
// is useful when you are building your program from source. It should not be
// used otherwise -- for example, if you are distributing Abseil in a binary
// package manager -- since in mode 2, absl::optional will name a different
// package manager -- since in mode 2, absl::OTABSL_OPTION_NAMESPACE_NAME::optional will name a different
// type, with a different mangled name and binary layout, depending on the
// compiler flags passed by the end user. For more info, see
// https://abseil.io/about/design/dropin-types.

// User code should not inspect this macro. To check in the preprocessor if
// absl::optional is a typedef of std::optional, use the feature macro
// absl::OTABSL_OPTION_NAMESPACE_NAME::optional is a typedef of std::optional, use the feature macro
// OTABSL_USES_STD_OPTIONAL.

#define OTABSL_OPTION_USE_STD_OPTIONAL 0


// OTABSL_OPTION_USE_STD_STRING_VIEW
//
// This option controls whether absl::string_view is implemented as an alias to
// This option controls whether absl::OTABSL_OPTION_NAMESPACE_NAME::string_view is implemented as an alias to
// std::string_view, or as an independent implementation.
//
// A value of 0 means to use Abseil's implementation. This requires only C++11
Expand All @@ -145,20 +145,20 @@
// and use an alias only if a working std::string_view is available. This
// option is useful when you are building your program from source. It should
// not be used otherwise -- for example, if you are distributing Abseil in a
// binary package manager -- since in mode 2, absl::string_view will name a
// binary package manager -- since in mode 2, absl::OTABSL_OPTION_NAMESPACE_NAME::string_view will name a
// different type, with a different mangled name and binary layout, depending on
// the compiler flags passed by the end user. For more info, see
// https://abseil.io/about/design/dropin-types.
//
// User code should not inspect this macro. To check in the preprocessor if
// absl::string_view is a typedef of std::string_view, use the feature macro
// absl::OTABSL_OPTION_NAMESPACE_NAME::string_view is a typedef of std::string_view, use the feature macro
// OTABSL_USES_STD_STRING_VIEW.

#define OTABSL_OPTION_USE_STD_STRING_VIEW 0

// OTABSL_OPTION_USE_STD_VARIANT
//
// This option controls whether absl::variant is implemented as an alias to
// This option controls whether absl::OTABSL_OPTION_NAMESPACE_NAME::variant is implemented as an alias to
// std::variant, or as an independent implementation.
//
// A value of 0 means to use Abseil's implementation. This requires only C++11
Expand All @@ -171,41 +171,23 @@
// and use an alias only if a working std::variant is available. This option
// is useful when you are building your program from source. It should not be
// used otherwise -- for example, if you are distributing Abseil in a binary
// package manager -- since in mode 2, absl::variant will name a different
// package manager -- since in mode 2, absl::OTABSL_OPTION_NAMESPACE_NAME::variant will name a different
// type, with a different mangled name and binary layout, depending on the
// compiler flags passed by the end user. For more info, see
// https://abseil.io/about/design/dropin-types.
//
// User code should not inspect this macro. To check in the preprocessor if
// absl::variant is a typedef of std::variant, use the feature macro
// absl::OTABSL_OPTION_NAMESPACE_NAME::variant is a typedef of std::variant, use the feature macro
// OTABSL_USES_STD_VARIANT.

#define OTABSL_OPTION_USE_STD_VARIANT 0


// OTABSL_OPTION_USE_INLINE_NAMESPACE
// OTABSL_OPTION_INLINE_NAMESPACE_NAME
// OTABSL_OPTION_NAMESPACE_NAME
//
// These options controls whether all entities in the absl namespace are
// contained within an inner inline namespace. This does not affect the
// user-visible API of Abseil, but it changes the mangled names of all symbols.
//
// This can be useful as a version tag if you are distributing Abseil in
// precompiled form. This will prevent a binary library build of Abseil with
// one inline namespace being used with headers configured with a different
// inline namespace name. Binary packagers are reminded that Abseil does not
// guarantee any ABI stability in Abseil, so any update of Abseil or
// configuration change in such a binary package should be combined with a
// new, unique value for the inline namespace name.
//
// A value of 0 means not to use inline namespaces.
//
// A value of 1 means to use an inline namespace with the given name inside
// namespace absl. If this is set, OTABSL_OPTION_INLINE_NAMESPACE_NAME must also
// be changed to a new, unique identifier name. In particular "head" is not
// allowed.
// All codes in otabsl are under OTABSL_OPTION_NAMESPACE_NAME, we do not use inline namespace to avoid
// conlict with external Abseil.

#define OTABSL_OPTION_USE_INLINE_NAMESPACE 1
#define OTABSL_OPTION_INLINE_NAMESPACE_NAME otel_v1
#define OTABSL_OPTION_NAMESPACE_NAME otel_v1

#endif // OTABSL_BASE_OPTIONS_H_
Loading