Skip to content

Commit 01dc768

Browse files
committed
deps: update opentelemetry-cpp to 1.19.0
PR-URL: #260 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #268
1 parent 96edafa commit 01dc768

File tree

353 files changed

+7408
-1786
lines changed

Some content is hidden

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

353 files changed

+7408
-1786
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
FROM otel/cpp_format_tools
5+
6+
ARG GRPC_VERSION=v1.55.0
7+
ARG PROTOBUF_VERSION=23.4
8+
ARG ABSEIL_CPP_VERSION=20240116.1
9+
10+
ENV PROTOBUF_VERSION=${PROTOBUF_VERSION}
11+
ENV ABSEIL_CPP_VERSION=${ABSEIL_CPP_VERSION}
12+
13+
COPY ci /opt/ci
14+
15+
RUN apt update && apt install -y wget \
16+
ninja-build \
17+
libcurl4-openssl-dev \
18+
markdownlint
19+
20+
RUN cd /opt/ci && bash setup_cmake.sh
21+
RUN cd /opt/ci && bash setup_ci_environment.sh
22+
RUN cd /opt && bash ci/setup_googletest.sh \
23+
&& bash ci/setup_grpc.sh -r ${GRPC_VERSION}
24+
25+
ADD https://github.com/bazelbuild/bazelisk/releases/download/v1.22.1/bazelisk-linux-amd64 /usr/local/bin
26+
27+
RUN git config --global core.autocrlf input \
28+
&& chmod +x /usr/local/bin/bazelisk-linux-amd64
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
4+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/javascript-node
5+
{
6+
"name": "opentelemetry-cpp",
7+
"build": {
8+
"context": "..",
9+
"dockerfile": "Dockerfile.dev",
10+
"args": {
11+
"GRPC_VERSION": "v1.55.0",
12+
"PROTOBUF_VERSION": "23.4",
13+
"ABSEIL_CPP_VERSION":"20240116.1"
14+
}
15+
},
16+
"settings": {
17+
"terminal.integrated.shell.linux": "/bin/sh"
18+
},
19+
"extensions": [
20+
"ms-vscode.cpptools",
21+
"ms-azuretools.vscode-docker",
22+
"ms-vscode.cpptools-extension-pack"
23+
],
24+
25+
"remoteUser": "root"
26+
}

deps/opentelemetry-cpp/.iwyu.imp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
[
77
# Work around for C++ STL
88
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },
9+
{ "include": ["<bits/std_abs.h>", "private", "<cstdlib>", "public"] },
10+
{ "include": ["<ext/alloc_traits.h>", "private", "<memory>", "public"] },
11+
{ "include": ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
12+
{ "include": ["<bits/types/struct_FILE.h>", "private", "<stdio.h>", "public"] },
913

1014
# Local opentelemetry-cpp style
1115

@@ -14,6 +18,8 @@
1418
{ "include": ["<gtest/gtest-test-part.h>", "private", "<gtest/gtest.h>", "public"] },
1519
{ "include": ["<gtest/gtest-param-test.h>", "private", "<gtest/gtest.h>", "public"] },
1620
{ "include": ["<gtest/gtest_pred_impl.h>", "private", "<gtest/gtest.h>", "public"] },
21+
{ "include": ["<gtest/gtest-typed-test.h>", "private", "<gtest/gtest.h>", "public"] },
22+
{ "include": ["<gtest/gtest-assertion-result.h>", "private", "<gtest/gtest.h>", "public"] },
1723

1824
# We prefer to include <gmock/gmock.h> for simplicity
1925
{ "include": ["<gmock/gmock-function-mocker.h>", "private", "<gmock/gmock.h>", "public"] },

deps/opentelemetry-cpp/MODULE.bazel

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
module(
5+
name = "opentelemetry-cpp",
6+
version = "1.17.0",
7+
compatibility_level = 0,
8+
repo_name = "io_opentelemetry_cpp",
9+
)
10+
11+
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "com_google_absl")
12+
bazel_dep(name = "bazel_skylib", version = "1.5.0")
13+
bazel_dep(name = "curl", version = "8.8.0")
14+
bazel_dep(name = "grpc", version = "1.63.1.bcr.1", repo_name = "com_github_grpc_grpc")
15+
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "github_nlohmann_json")
16+
bazel_dep(name = "opentelemetry-proto", version = "1.5.0", repo_name = "com_github_opentelemetry_proto")
17+
bazel_dep(name = "opentracing-cpp", version = "1.6.0", repo_name = "com_github_opentracing")
18+
bazel_dep(name = "platforms", version = "0.0.8")
19+
bazel_dep(name = "prometheus-cpp", version = "1.3.0", repo_name = "com_github_jupp0r_prometheus_cpp")
20+
bazel_dep(name = "protobuf", version = "26.0", repo_name = "com_google_protobuf")
21+
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
22+
bazel_dep(name = "zlib", version = "1.3.1.bcr.1")
23+
24+
bazel_dep(name = "google_benchmark", version = "1.8.3", dev_dependency = True, repo_name = "com_github_google_benchmark")
25+
bazel_dep(name = "googletest", version = "1.14.0.bcr.1", dev_dependency = True, repo_name = "com_google_googletest")

deps/opentelemetry-cpp/api/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ target_compile_definitions(
116116
opentelemetry_api
117117
INTERFACE OPENTELEMETRY_ABI_VERSION_NO=${OPENTELEMETRY_ABI_VERSION_NO})
118118

119+
if(WITH_OTLP_RETRY_PREVIEW)
120+
target_compile_definitions(opentelemetry_api
121+
INTERFACE ENABLE_OTLP_RETRY_PREVIEW)
122+
endif()
123+
119124
if(WITH_OTLP_GRPC_SSL_MTLS_PREVIEW)
120125
target_compile_definitions(opentelemetry_api
121126
INTERFACE ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW)
@@ -126,6 +131,11 @@ if(WITH_METRICS_EXEMPLAR_PREVIEW)
126131
INTERFACE ENABLE_METRICS_EXEMPLAR_PREVIEW)
127132
endif()
128133

134+
if(WITH_THREAD_INSTRUMENTATION_PREVIEW)
135+
target_compile_definitions(opentelemetry_api
136+
INTERFACE ENABLE_THREAD_INSTRUMENTATION_PREVIEW)
137+
endif()
138+
129139
if(WITH_OTLP_HTTP_COMPRESSION)
130140
target_compile_definitions(opentelemetry_api
131141
INTERFACE ENABLE_OTLP_COMPRESSION_PREVIEW)

deps/opentelemetry-cpp/api/include/opentelemetry/baggage/baggage_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ inline nostd::shared_ptr<Baggage> GetBaggage(const context::Context &context) no
2727
}
2828

2929
inline context::Context SetBaggage(context::Context &context,
30-
nostd::shared_ptr<Baggage> baggage) noexcept
30+
const nostd::shared_ptr<Baggage> &baggage) noexcept
3131
{
3232
return context.SetValue(kBaggageHeader, baggage);
3333
}

deps/opentelemetry-cpp/api/include/opentelemetry/context/context.h

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@ class Context
2929
// hold a shared_ptr to the head of the DataList linked list
3030
template <class T>
3131
Context(const T &keys_and_values) noexcept
32-
{
33-
head_ = nostd::shared_ptr<DataList>{new DataList(keys_and_values)};
34-
}
32+
: head_{nostd::shared_ptr<DataList>{new DataList(keys_and_values)}}
33+
{}
3534

3635
// Creates a context object from a key and value, this will
3736
// hold a shared_ptr to the head of the DataList linked list
3837
Context(nostd::string_view key, ContextValue value) noexcept
39-
{
40-
head_ = nostd::shared_ptr<DataList>{new DataList(key, value)};
41-
}
38+
: head_{nostd::shared_ptr<DataList>{new DataList(key, value)}}
39+
{}
4240

4341
// Accepts a new iterable and then returns a new context that
4442
// contains the new key and value data. It attaches the
@@ -92,22 +90,21 @@ class Context
9290

9391
private:
9492
// A linked list to contain the keys and values of this context node
95-
class DataList
93+
struct DataList
9694
{
97-
public:
98-
char *key_;
95+
char *key_ = nullptr;
9996

100-
nostd::shared_ptr<DataList> next_;
97+
nostd::shared_ptr<DataList> next_{nullptr};
10198

102-
size_t key_length_;
99+
size_t key_length_ = 0UL;
103100

104101
ContextValue value_;
105102

106-
DataList() { next_ = nullptr; }
103+
DataList() = default;
107104

108105
// Builds a data list off of a key and value iterable and returns the head
109106
template <class T>
110-
DataList(const T &keys_and_vals) : key_{nullptr}, next_(nostd::shared_ptr<DataList>{nullptr})
107+
DataList(const T &keys_and_vals)
111108
{
112109
bool first = true;
113110
auto *node = this;
@@ -132,9 +129,18 @@ class Context
132129
{
133130
key_ = new char[key.size()];
134131
key_length_ = key.size();
135-
memcpy(key_, key.data(), key.size() * sizeof(char));
136-
value_ = value;
132+
std::memcpy(key_, key.data(), key.size() * sizeof(char));
137133
next_ = nostd::shared_ptr<DataList>{nullptr};
134+
value_ = value;
135+
}
136+
137+
DataList(const DataList &other)
138+
: key_(new char[other.key_length_]),
139+
next_(other.next_),
140+
key_length_(other.key_length_),
141+
value_(other.value_)
142+
{
143+
std::memcpy(key_, other.key_, other.key_length_ * sizeof(char));
138144
}
139145

140146
DataList &operator=(DataList &&other) noexcept

deps/opentelemetry-cpp/api/include/opentelemetry/context/propagation/global_propagator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class OPENTELEMETRY_EXPORT GlobalTextMapPropagator
3232
return nostd::shared_ptr<TextMapPropagator>(GetPropagator());
3333
}
3434

35-
static void SetGlobalPropagator(nostd::shared_ptr<TextMapPropagator> prop) noexcept
35+
static void SetGlobalPropagator(const nostd::shared_ptr<TextMapPropagator> &prop) noexcept
3636
{
3737
std::lock_guard<common::SpinLockMutex> guard(GetLock());
3838
GetPropagator() = prop;

deps/opentelemetry-cpp/api/include/opentelemetry/context/runtime_context.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ class OPENTELEMETRY_EXPORT RuntimeContext
152152
*
153153
* @param storage a custom runtime context storage
154154
*/
155-
static void SetRuntimeContextStorage(nostd::shared_ptr<RuntimeContextStorage> storage) noexcept
155+
static void SetRuntimeContextStorage(
156+
const nostd::shared_ptr<RuntimeContextStorage> &storage) noexcept
156157
{
157158
GetStorage() = storage;
158159
}

deps/opentelemetry-cpp/api/include/opentelemetry/detail/preprocessor.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,15 @@
1111

1212
#define OPENTELEMETRY_CONCAT(A, B) OPENTELEMETRY_CONCAT_(A, B)
1313
#define OPENTELEMETRY_CONCAT_(A, B) A##B
14+
15+
// Import the C++20 feature-test macros
16+
#ifdef __has_include
17+
# if __has_include(<version>)
18+
# include <version>
19+
# endif
20+
#elif defined(_MSC_VER) && ((defined(__cplusplus) && __cplusplus >= 202002L) || \
21+
(defined(_MSVC_LANG) && _MSVC_LANG >= 202002L))
22+
# if _MSC_VER >= 1922
23+
# include <version>
24+
# endif
25+
#endif

deps/opentelemetry-cpp/api/include/opentelemetry/logs/event_id.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ namespace logs
1919
class EventId
2020
{
2121
public:
22-
EventId(int64_t id, nostd::string_view name) noexcept : id_{id}
22+
EventId(int64_t id, nostd::string_view name) noexcept
23+
: id_{id}, name_{nostd::unique_ptr<char[]>{new char[name.length() + 1]}}
2324
{
24-
name_ = nostd::unique_ptr<char[]>{new char[name.length() + 1]};
2525
std::copy(name.begin(), name.end(), name_.get());
2626
name_.get()[name.length()] = 0;
2727
}

deps/opentelemetry-cpp/api/include/opentelemetry/logs/provider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class OPENTELEMETRY_EXPORT Provider
3939
/**
4040
* Changes the singleton LoggerProvider.
4141
*/
42-
static void SetLoggerProvider(nostd::shared_ptr<LoggerProvider> tp) noexcept
42+
static void SetLoggerProvider(const nostd::shared_ptr<LoggerProvider> &tp) noexcept
4343
{
4444
std::lock_guard<common::SpinLockMutex> guard(GetLock());
4545
GetProvider() = tp;
@@ -60,7 +60,7 @@ class OPENTELEMETRY_EXPORT Provider
6060
/**
6161
* Changes the singleton EventLoggerProvider.
6262
*/
63-
static void SetEventLoggerProvider(nostd::shared_ptr<EventLoggerProvider> tp) noexcept
63+
static void SetEventLoggerProvider(const nostd::shared_ptr<EventLoggerProvider> &tp) noexcept
6464
{
6565
std::lock_guard<common::SpinLockMutex> guard(GetLock());
6666
GetEventProvider() = tp;

deps/opentelemetry-cpp/api/include/opentelemetry/logs/severity.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#pragma once
55

6+
#include <cstdint>
7+
68
#include "opentelemetry/nostd/string_view.h"
79
#include "opentelemetry/version.h"
810

deps/opentelemetry-cpp/api/include/opentelemetry/metrics/provider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Provider
3838
/**
3939
* Changes the singleton MeterProvider.
4040
*/
41-
static void SetMeterProvider(nostd::shared_ptr<MeterProvider> tp) noexcept
41+
static void SetMeterProvider(const nostd::shared_ptr<MeterProvider> &tp) noexcept
4242
{
4343
std::lock_guard<common::SpinLockMutex> guard(GetLock());
4444
GetProvider() = tp;

deps/opentelemetry-cpp/api/include/opentelemetry/nostd/internal/absl/types/internal/variant.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ template <class ReturnType, class FunctionObject, std::size_t... BoundIndices>
221221
struct MakeVisitationMatrix<ReturnType, FunctionObject, index_sequence<>,
222222
index_sequence<BoundIndices...>> {
223223
using ResultType = ReturnType (*)(FunctionObject&&);
224+
// cppcheck-suppress [duplInheritedMember]
224225
static constexpr ResultType Run() {
225226
return &call_with_indices<ReturnType, FunctionObject,
226227
(BoundIndices - 1)...>;
@@ -722,6 +723,7 @@ struct VariantCoreAccess {
722723
Self* self, Args&&... args) {
723724
Destroy(*self);
724725
using New = typename absl::OTABSL_OPTION_NAMESPACE_NAME::variant_alternative<NewIndex, Self>::type;
726+
// cppcheck-suppress [legacyUninitvar]
725727
New* const result = ::new (static_cast<void*>(&self->state_))
726728
New(absl::OTABSL_OPTION_NAMESPACE_NAME::forward<Args>(args)...);
727729
self->index_ = NewIndex;
@@ -1310,6 +1312,7 @@ class VariantStateBaseDestructorNontrivial : protected VariantStateBase<T...> {
13101312
VariantStateBaseDestructorNontrivial* self;
13111313
};
13121314

1315+
// cppcheck-suppress [duplInheritedMember]
13131316
void destroy() { VisitIndices<sizeof...(T)>::Run(Destroyer{this}, index_); }
13141317

13151318
~VariantStateBaseDestructorNontrivial() { destroy(); }

deps/opentelemetry-cpp/api/include/opentelemetry/nostd/shared_ptr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class shared_ptr
3737

3838
struct alignas(kAlignment) PlacementBuffer
3939
{
40-
char data[kMaxSize];
40+
char data[kMaxSize]{};
4141
};
4242

4343
class shared_ptr_wrapper

deps/opentelemetry-cpp/api/include/opentelemetry/nostd/variant.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ OPENTELEMETRY_END_NAMESPACE
5454
# ifdef HAVE_ABSEIL
5555
# include "absl/types/variant.h"
5656
# else
57+
# include "opentelemetry/nostd/internal/absl/base/options.h"
58+
59+
namespace absl
60+
{
61+
namespace OTABSL_OPTION_NAMESPACE_NAME
62+
{
63+
template <class T>
64+
struct variant_size;
65+
template <typename... Ts>
66+
class variant;
67+
} // namespace OTABSL_OPTION_NAMESPACE_NAME
68+
} // namespace absl
69+
5770
# include "opentelemetry/nostd/internal/absl/types/variant.h"
5871
# endif
5972

deps/opentelemetry-cpp/api/include/opentelemetry/plugin/tracer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DynamicLibraryHandle;
2020
class Span final : public trace::Span
2121
{
2222
public:
23-
Span(std::shared_ptr<trace::Tracer> &&tracer, nostd::shared_ptr<trace::Span> span) noexcept
23+
Span(std::shared_ptr<trace::Tracer> &&tracer, const nostd::shared_ptr<trace::Span> &span) noexcept
2424
: tracer_{std::move(tracer)}, span_{span}
2525
{}
2626

deps/opentelemetry-cpp/api/include/opentelemetry/semconv/error_attributes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ namespace error
3636
* <p>
3737
* If the operation has completed successfully, instrumentations SHOULD NOT set @code error.type
3838
* @endcode. <p> If a specific domain defines its own set of error identifiers (such as HTTP or gRPC
39-
* status codes), it's RECOMMENDED to: <p> <ul> <li>Use a domain-specific attribute</li> <li>Set
40-
* @code error.type @endcode to capture all errors, regardless of whether they are defined within
41-
* the domain-specific set or not.</li>
39+
* status codes), it's RECOMMENDED to: <ul> <li>Use a domain-specific attribute</li> <li>Set @code
40+
* error.type @endcode to capture all errors, regardless of whether they are defined within the
41+
* domain-specific set or not.</li>
4242
* </ul>
4343
*/
4444
static constexpr const char *kErrorType = "error.type";

deps/opentelemetry-cpp/api/include/opentelemetry/semconv/http_metrics.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ namespace http
2525
* <p>
2626
* histogram
2727
*/
28-
static constexpr const char *kMetricHttpClientRequestDuration =
29-
"metric.http.client.request.duration";
28+
static constexpr const char *kMetricHttpClientRequestDuration = "http.client.request.duration";
3029
static constexpr const char *descrMetricHttpClientRequestDuration =
3130
"Duration of HTTP client requests.";
3231
static constexpr const char *unitMetricHttpClientRequestDuration = "s";
@@ -52,8 +51,7 @@ CreateSyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter)
5251
* <p>
5352
* histogram
5453
*/
55-
static constexpr const char *kMetricHttpServerRequestDuration =
56-
"metric.http.server.request.duration";
54+
static constexpr const char *kMetricHttpServerRequestDuration = "http.server.request.duration";
5755
static constexpr const char *descrMetricHttpServerRequestDuration =
5856
"Duration of HTTP server requests.";
5957
static constexpr const char *unitMetricHttpServerRequestDuration = "s";

0 commit comments

Comments
 (0)